A simple and intuitive TODO list application built with Angular for the frontend, Node.js and Express for the backend, and MongoDB as the database. This app allows users to add, edit, and delete tasks, keeping track of their to-do items efficiently.
- Install Node.js - version used v22.14.0
- Install MongoDB (locally like MongoDB Compass or a cloud-based instance like MongoDB Atlas)
- Clone the TODO-APP git repository
https://github.com/tejapathakoti/TODO.git - Setting up Backend:
- Navigate to cd todo-app/backend and run =>
npm install - Build backend server using =>
npm run build - Start the backend =>
npx esr src/app.ts
- Navigate to cd todo-app/backend and run =>
- Setup Frontend:
- Navigate to cd todo-app/frontend and run =>
npm install - Run =>
ng serve --open
- Navigate to cd todo-app/frontend and run =>
- The app will open in your browser at
http://localhost:4200. - You should be able to see the TODO list app where you can start creating lists and adding tasks.
- To run tests in frontend =>
npm testand for backend =>npm run test .
- Base URL: http://localhost:3000
Fetches all the lists in the Todo application.
URL: /lists Method: GET Request Parameters: None Response: Status Code: 200 OK Body: [ { "_id": "1", "title": "Sample List" }, { "_id": "2", "title": "Another List" } ] Error Response: Status Code: 500 Internal Server Error Body: { "error": "Failed to fetch lists" }
Fetches a single list by its ID.
URL: /lists/:id Method: GET Request Parameters: id: The ID of the list (path parameter). Response: Status Code: 200 OK Body: { "_id": "1", "title": "Sample List" } Error Response: Status Code: 500 Internal Server Error Body: { "error": "Failed to fetch lists" }
Fetches all tasks associated with a specific list.
URL: /lists/:listId/tasks Method: GET Request Parameters: listId: The ID of the list (path parameter). Response: Status Code: 200 OK Body: [ { "_id": "1", "title": "Test Task", "_listId": "1" }, { "_id": "2", "title": "Another Task", "_listId": "1" } ] Error Response: Status Code: 500 Internal Server Error Body: { "error": "Failed to fetch tasks" }
Creates a new list.
URL: /lists Method: POST Request Body: { "title": "New Todo List" } Response: Status Code: 200 OK Body: { "_id": "3", "title": "New Todo List" } Error Response: Status Code: 500 Internal Server Error Body: { "error": "Failed to save list" }
Updates the title of an existing list by its ID.
URL: /lists/:id Method: PUT Request Parameters: id: The ID of the list to be updated (path parameter). Request Body: { "title": "Updated Todo List" } Response: Status Code: 200 OK Body: { "message": "List Updated Successfully" } Error Response: Status Code: 500 Internal Server Error Body: { "error": "Failed to update list" }
Deletes a list by its ID.
URL: /lists/:id Method: DELETE Request Parameters: id: The ID of the list to be deleted (path parameter). Response: Status Code: 200 OK Body: { "_id": "1", "title": "Test List" } Error Response: Status Code: 500 Internal Server Error Body: { "error": "Failed to delete list" }