This is a full-stack ToDo List application built with React.js for the frontend and Node.js, Express, and MongoDB for the backend. The app allows users to create, read, update, and delete (CRUD) tasks, with all data stored in a MongoDB database.
- Add new tasks
- Edit tasks
- Delete tasks
- Fetch tasks from the MongoDB database
- Responsive design
- Frontend: React.js, CSS
- Backend: Node.js, Express.js
- Database: MongoDB
Make sure you have the following installed on your system:
git clone https://github.com/Prik03/TodoList.git
cd todolistFor both frontend (React.js) and backend (Node.js):
cd frontend
npm installcd ../server
npm installCreate a .env file in the server directory and add the following environment variables:
MONGO_URI=<your-mongodb-connection-string>
PORT=5000
Replace <your-mongodb-connection-string> with the connection string of your MongoDB database.
In the server directory, run:
nodemon indexThis will start the Node.js server on port 5000 (or the port you configured in .env).
In the frontend directory, run:
npm run devThis will start the React frontend on port 3000.
Open your browser and go to:
http://localhost:3000
The backend exposes the following API routes:
GET /api/todo: Fetch all tasksPOST /api/todo: Create a new taskPUT /api/todo/:id: Update an existing taskDELETE /api/todo/:id: Delete a task
TodoList/
├── frontend/ # Frontend (React.js)
└── Server/ # Backend (Node.js, Express.js)
├── models/ # MongoDB models (e.g., Task.js)
├── routes/ # API routes
├── controllers/ # Logic for each API endpoint
├── .env # Environment variables
└── README.md # This file
Feel free to submit issues and pull requests to help improve this project.