This project uses Node.js, Express, and Mongoose to create a server application. Below are the steps to run the project locally.
Ensure you have the following installed on your machine:
Clone the project repository to your local machine using the following command:
git clone https://github.com/shakibgithub944/assignment-2.git
cd yourrepositoryInstall the project dependencies using npm:
npm installEnvironment Variables Example: Create a .env file in the root of the project and add the following content:
PORT=5000
DATABASE_URL=MONGODB_URL
Running the Project To start the server in development mode, use the following command:
npm run start:devThis will start the server with nodemon and ts-node-dev for automatic restarts and TypeScript compilation.
Building the Project To compile the TypeScript code to JavaScript, use:
npm run buildLinting and Formatting To check for linting errors using ESLint, run:
npm run lintTo automatically fix linting errors, run:
npm run lint:fixTo format the code using Prettier, run:
npm run prettierTo automatically fix formatting issues, run:
npm run prettier:fix