This repository serves as a comprehensive Node.js backend template equipped with essential features and configurations to kickstart your development process. Below, you'll find instructions on setting up the project environment, along with details on environment variables and commands for both development and production environments.
- nodejs version > 18.0
- mongodb version > 6.0 with minimum 2 replica sets
- gcloud storage (optional)
- Clone the repository: git clone https://github.com/afridsyed326/nodejs-backend-ts-template.git.
- Install dependencies: npm install.
- Create a .env file based on the provided .env.example.
- Set up environment variables in the .env file according to your configuration.
- Start the development server: npm run dev.
JWT_PRIVATE_KEY_USER
your jwt secretEXPRESS_SESSION_SECRET
your express secretPORT
- port on which the backend will run on the serverMONGODB_URL
mongodb connection string. ex: mongodb://localhost:27017/DB_NAME
name of the databaseADMIN_EMAIL
admin emails to auto set the user admin upon reguistering. must be a string of emails seperated by,
GC_BUCKET_NAME
name of google cloud storage bucketFRONTEND_LINK
url where frontend is deployedBACKEND_LINK
url of this backendSMTP_HOST
SMTP Email hostnameSMTP_USER
SMTP email usernameSMTP_PASSWORD
SMTP email passwordPROJECT_NAME
project name used in emails
Replace the service_account.json
file with your google cloud service_account file in root directory
Feel free to explore the codebase, customize configurations, and leverage the provided features to accelerate your backend development process. Should you have any questions or need assistance, please refer to the documentation or reach out to the project maintainers.
Author: SM Afrid Email: [email protected]