A simple task management API built with Node.js, Express, and MongoDB. It supports user authentication using JWT and provides endpoints for creating, retrieving, updating, and deleting tasks.
- User registration and authentication
- JWT-based session management
- CRUD operations for tasks
- MongoDB integration via Mongoose
- Environment-based configuration
- Jest testing framework integration
The API is hosted on Render and available at:
👉 https://task-manager-app-demo-sa.onrender.com/
You can use tools like Postman or cURL to interact with the API.
-
Clone the repository:
git clone https://github.com/siddhant197/node-task-manager.git cd node-task-manager
-
Install dependencies:
npm install
-
Configure environment variables:
-
Create a
.env
file in the root directory. -
Define the following variables:
JWT_SECRET=your_jwt_secret MONGODB_URL=your_mongodb_connection_string
-
For testing purposes, create a
.env.test
file with appropriate test configurations.
-
-
Start the development server:
npm run dev
The server will start on
http://localhost:3000
.
The project uses Jest for testing. To run the test suite:
npm test
Ensure that your .env.test
file is properly configured before running tests.
POST /users
: Register a new userPOST /users/login
: Authenticate a userPOST /tasks
: Create a new taskGET /tasks
: Retrieve all tasksGET /tasks/:id
: Retrieve a specific taskPATCH /tasks/:id
: Update a taskDELETE /tasks/:id
: Delete a task
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
This project is licensed under the MIT License.