#[P-HERO-Level-2-Assignment-2]
- A Node.js Backend Application
This repository contains the source code for a backend application built with Express.js, Mongoose, MongoDB, TypeScript, as the main technologies.
Robust data management: Leverages Mongoose for seamless interaction with MongoDB, ensuring efficient data storage and retrieval
.
Type safety: Enforces type checks through TypeScript, enhancing code reliability and maintainability.
Prerequisites:
Node.js and npm (or Yarn) are installed on your system. You can download them from the official Node.js website: https://nodejs.org/en
A MongoDB instance running locally or remotely.
Installation:
Clone this repository:
##Bash
-
git clone https://github.com/MdMuzahid07/P-HERO-Level-2-Assignment-2.git
-
Navigate to the project directory:
##Bash
#yarn install
There are two ways to run the application:
Development mode (hot reloading):
Bash
yarn start-dev
This starts the application in development mode, enabling hot reloading whenever you make changes to the source code.
Production mode:
##Bash
This builds the application in production mode and then starts it. The built code is placed in the dist directory.
The package.json file defines various scripts to automate tasks:
- start: Start the application in production mode.
- start-dev: Starts the application in development mode with hot reloading.
- lint: Runs ESLint to check for code style and potential errors.
- build: Builds the application for production using TypeScript.
- lint-fix: Automatically fixes linting errors using ESLint.
- prettier: Formats code using Prettier.
- prettier-fix: Automatically formats code using Prettier.