This guide will walk you through the process of setting up the backend server for the Task-tracker project on your local machine. The backend server is built using Node.js and Express.
Before you begin, make sure you have the following software installed on your machine:
- Node.js: Download and install Node.js
- MongoDB: Download and install MongoDB
- Clone the Repository:
git clone https://github.com/your-username/task-tracker-backend.git
cd task-tracker-backend
- Install Dependencies:
npm install
- Configuration:
Create a .env
file in the root directory of the project. Add the following content to it:
module.exports = {
mongoURI: '',
jwtsecret: ''
}
Note: Replace <your-mongodb-uri>
with your MongoDB connection URI, and <your-jwt-secret>
with a secure secret for JWT token generation.
Make sure to keep this file private and do not commit it to version control.
- Start the Server:
npm start
The server will start running on http://localhost:3000.
Access the API at http://localhost:3000/api. You can use tools like Postman to test the API endpoints.
- Make sure MongoDB is running. If not, start MongoDB using the appropriate command for your system.
- Do not commit sensitive information like MongoDB URIs and JWT secrets to version control. Use environment variables or other secure methods for production deployment.
If you'd like to contribute to this project, fork the repository, create a new branch, make your changes, and submit a pull request.
This project is licensed under the MIT License.