This project is a Fullstack ToDo List application where users can register, log in, and manage their tasks.
The application is divided into two parts:
- Backend (Server): A Web API built using .NET with Entity Framework, hosted in Visual Studio.
- Frontend (Client): A React-based client developed in Visual Studio Code.
- User Management:
- User Registration
- User Login
- Task Management:
- View all tasks of the logged-in user
- Add new tasks
- Update task status (Mark task as done)
- Delete tasks
- Backend: .NET, Entity Framework, MySQL
- Frontend: React
- Development Environments:
- Backend: Visual Studio (VS)
- Frontend: Visual Studio Code (VS Code)
-
Install Required Packages: Make sure you have the necessary NuGet packages installed in your project:
Microsoft.EntityFrameworkCoreMicrosoft.EntityFrameworkCore.MySqlMicrosoft.EntityFrameworkCore.ToolsMicrosoft.EntityFrameworkCore.Design
-
Database Setup:
- Create a MySQL database for the project.
- Update the connection string in
appsettings.jsonto reflect your database credentials.
-
Run the Application: You can run the backend API by opening it in Visual Studio and using the built-in tools to run the project.
-
API Endpoints: The server exposes several endpoints to manage users and tasks:
POST /api/Customers/register- Register a new user.POST /api/Customers/login- Login to get a JWT token.GET /items/user/{id}- Get all tasks for the logged-in user.POST /api/items- Add a new task.PUT /api/items/{id}- Update the task (mark it as completed).DELETE /api/items/{id}- Delete a task.
-
Install Dependencies: From the frontend folder, run the following to install dependencies:
npm install
-
Run the Client: Run the client using:
npm start
This will start the React application and connect to the backend API.
-
Make sure the backend API is running and accessible to the frontend.
-
User Registration:
- A user registers by providing their details (username and password).
- Upon successful registration, the user can log in.
-
User Login:
- After logging in, the user receives a JWT token which is used to authenticate subsequent requests.
-
Task Management:
- Once logged in, the user can view their tasks.
- Users can add, update (mark as completed), and delete tasks.
Controllers/- Contains the API controllers for user and task management.Models/- Contains the entity classes, such asCustomerandItem.Data/- Contains the DbContext.
src/- Contains the React components, including task management UI and service.