A task management application built with Node.js, Express, MongoDB, and Socket.io. This application allows users to sign up, log in, create, update, and delete tasks. It also supports real-time updates using Socket.io.
Note: This is a sandbox/demo application for practicing Node.js API, CRUD, JWT authentication, and Socket.io real-time features. Not intended for production use.
🚧 In progress – made for learning and demo purposes only.
- Node.js
- Express
- MongoDB
- Socket.io
- JWT (JSON Web Token)
- User authentication with JWT
- CRUD operations for tasks
- Real-time updates with Socket.io
- Node.js and npm installed
- MongoDB instance running
-
Clone the repository:
git clone https://github.com/szymoniwacz/node-task-manager.git cd node-task-manager -
Install dependencies:
npm install
-
Set up environment variables:
cp .env.example .env
-
Fill in the
.envfile with your own values
Start the server:
node src/app.jsThe server will start on the port specified in the .env file (default is 5000).
Sign Up:
curl -X POST http://localhost:5000/api/auth/signup \
-H "Content-Type: application/json" \
-d '{
"name": "Test User",
"email": "test@example.com",
"password": "password123"
}'Log In:
curl -X POST http://localhost:5000/api/auth/login \
-H "Content-Type: application/json" \
-d '{
"email": "test@example.com",
"password": "password123"
}'Create Task:
curl -X POST http://localhost:5000/api/tasks \
-H "Content-Type: application/json" \
-H "x-auth-token: <your_token>" \
-d '{
"title": "Sample Task",
"description": "This is a sample task"
}'Get Tasks:
curl -X GET http://localhost:5000/api/tasks \
-H "x-auth-token: <your_token>"Update Task:
curl -X PUT http://localhost:5000/api/tasks/<task_id> \
-H "Content-Type: application/json" \
-H "x-auth-token: <your_token>" \
-d '{
"title": "Updated Task",
"description": "This is an updated task",
"completed": true
}'Delete Task:
curl -X DELETE http://localhost:5000/api/tasks/<task_id> \
-H "x-auth-token: <your_token>"The application uses Socket.io for real-time updates. You can connect to the Socket.io server and listen for events like newTask and updateTask.
node-task-manager/
├── src/
│ ├── models/
│ │ ├── User.js
│ │ └── Task.js
│ ├── routes/
│ │ ├── authRoutes.js
│ │ └── taskRoutes.js
│ ├── controllers/
│ │ ├── authController.js
│ │ └── taskController.js
│ ├── middleware/
│ │ └── authMiddleware.js
│ ├── app.js
│ └── config.js
├── public/
├── .env
├── .gitignore
├── package.json
├── package-lock.json
└── README.md
This project is licensed under the MIT License - see the LICENSE file for details.