The Task Manager server-side application is built using Node.js and Express to handle tasks such as user authentication, task management, and communication with a MongoDB database. It provides the backend functionality for the TaskFlow application, handling API requests, managing user sessions, and storing tasks.
- User Authentication: JWT-based authentication for secure login and session management.
- Task Management: Add, update, delete, and retrieve tasks.
- Database Integration: MongoDB is used to store user and task data.
- Cross-Origin Resource Sharing (CORS): Ensures secure cross-origin requests from the frontend.
- Environment Variables: Uses
dotenvfor managing environment configurations like database URIs and JWT secrets.
Currently, there is no live link for the server-side, as it's typically run locally or deployed via services like Heroku or AWS.
- Node.js: JavaScript runtime for building the server.
- Express: Web framework for Node.js to simplify route handling and middleware usage.
- MongoDB & Mongoose: MongoDB database for persistent storage and Mongoose for interacting with the database.
- JWT (JSON Web Token): For secure user authentication.
- dotenv: To manage environment variables.
- cookie-parser: To parse cookies in incoming requests.
- CORS: Middleware to allow secure cross-origin requests.
Follow these steps to set up the server locally:
-
Clone the repository:
git clone https://github.com/Chanbadsha/TaskFlowServer.git
-
Navigate to the project directory:
cd task-manager-server -
Install the dependencies:
npm install
-
Create a
.envfile at the root of the project and configure the following environment variables:MONGODB_URI=<your-mongodb-uri> JWT_SECRET=<your-jwt-secret>
-
Start the server in development mode:
npm run dev
-
The server will run at http://localhost:5000.
cookie-parser: Middleware to parse cookies in incoming requests.cors: Middleware for enabling CORS (Cross-Origin Resource Sharing).dotenv: Loads environment variables from a.envfile.express: Web framework for building the server.jsonwebtoken: To generate and verify JWT tokens for user authentication.mongodb: MongoDB Node.js driver for connecting to MongoDB.mongoose: Mongoose library for interacting with MongoDB.
-
start: Starts the server using Node.js.npm start
-
dev: Starts the server in development mode withnodemon, which automatically restarts the server on file changes.npm run dev
-
test: Placeholder script for testing (currently not implemented).npm run test
Feel free to fork the repository, make changes, and create pull requests. We welcome contributions to enhance the server-side functionality and improve security, performance, and scalability.
This project is licensed under the ISC License - see the LICENSE file for details.