This is a template project for backend development using Typescript, Node.js, Express, Mongoose, Bcrypt, JWT, NodeMailer, Multer, ESLint, and Prettier. The aim is to reduce setup time for new backend projects.
fs.unlink
..env
file.Follow these steps to set up and run the project locally.
Ensure you have the following installed:
Clone the repository:
git clone https://github.com/yourusername/your-repository.git
cd your-repository
Install dependencies:
Using npm:
npm install
Using yarn:
yarn install
Create a .env
file:
In the root directory of the project, create a .env
file and add the following variables. Adjust the values according to your setup.
# Basic
NODE_ENV=development
DATABASE_URL=mongodb://127.0.0.1:27017/project_name
IP_ADDRESS=192.0.0.0
PORT=5000
# Bcrypt
BCRYPT_SALT_ROUNDS=12
# JWT
JWT_SECRET=jwt_secret
JWT_EXPIRE_IN=1d
# Email
[email protected]
[email protected]
EMAIL_PASS=mkqcfjeqloothyax
EMAIL_PORT=587
EMAIL_HOST=smtp.gmail.com
Run the project:
Using npm:
npm run dev
Using yarn:
yarn run dev
Explain how to run the automated tests for this system.
npm test