This repository contains the backend code for a todo list application built using Node.js. The backend exposes a RESTful API for creating, reading, updating, and deleting todo items. It uses a database (Mongo Atlas) to store the todo items and has endpoints for managing user accounts and authentication. The code is organized into different modules for handling different aspects of the application, such as the database, the API routes, and the middleware. The repository also includes scripts for testing code with jest with almost covering 95.23% project, and also setting up the development and production environments and for deploying the code to a server.
- Create, read, update, and delete todo items
- User authentication, authorization and account management
- 95% coverage using jest
- Scalable and maintainable architecture
- Focus on security and performance
Listify/
|
|-- config/
| |-- default.json
| |-- development.json
| |-- test.json
|
|-- middlewares/
| |-- isAuthenticated_middleware.js
| |-- isValidObjectId_middleware.js
| |-- isValidRequest_middleware.js
| |-- error_middleware.js
|
|-- models/
| |-- todoSchema.js
| |-- userSchema.js
|
|-- routes/
| |-- authRoute.js
| |-- todosRoute.js
| |-- userRoute.js
|
|-- startups/
| |-- connectDatabase.js
| |-- routes.js
| |-- configurations.js
| |-- logging.js
|
|-- tests/
| |--integration/
| | |-- routes/
| | | |-- authRoute.spec.js
| | | |-- todosRoute.test.js
| | | |-- userRoute.spec.js
| | |
| | |-- middlewares/
| | |-- isAuthenticated_middleware.js
| |
| |-- unit
| |-- middlewares/
| | |-- error_middleware.test.js
| | |-- isAuthenticated_middleware.test.js
| |
| |-- models/
| | |--userSchema.test.js
| |
| |--startups/
| |-- connectDatabase.test.js
|
|-- .gitignore
|-- index.js
|-- README.md
|-- package.json
|-- node_modules/
*/
To get started with the backend, follow these steps:
- Clone the repository:
git clone https://github.com/aimalexe/Listify.git
- Install the dependencies:
npm install
- Make two files in
config
directory nameddevelopment.json
andtest.json
. Copydefault.json
to both and update the corresponding values for your app. - Set up the development environment:
npm run dev
- Run the tests:
npm run test
for coverage give the flage as-- --coverage
http://localhost:3000/api/todos
http://localhost:3000/api/todos/:id/
http://localhost:3000/api/user/
http://localhost:3000/api/auth/