Skip to content

sharonpraju/node-express-boilerplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📌 Tech stack

  • Node
  • Express
  • React
  • Mongo
  • Docker

🔖 General Instructions

  • 📝 Create .env file by copying contents of .env.sample file
  • 🏷️ By default Node server will run on port 5000 and React will run on port 3000 (In case if needed to change this behaviour modify the .env file inside the app directory)
  • ✨ Make sure the port 5000 and 6000 of the host machine is not used by other services since docker attaches the backend service to port 5000 and mongodb to 6000 of the host machine (To change this behaviour modify the .env file inside the root directory)
  • 🔐 Demo credentials to login
  • 📦 Frontend is not dockerized
  • 🏗️ MVC architecture has been followed
  • ♻️ .env file inside the app directory will be used while running without docker and .env file at root directory will be used while running with docker

🚀 To run the project without docker

Starting backend (Node server)

  • Navigate to backend/app directory
  • Run the command npm install
  • Run the command npm start
  • Seed the database with user's data by using the command npx mongoose db:seed:all

🐳 To run the project using docker

  • Navigate to backend directory
  • Run the code docker-compose up -d
  • Find the container ID of node container by using the command docker ps
  • Access the docker container shell using the command docker exec -it CONTAINER_ID sh (Replace the CONTAINER_ID with actual container id obtained from the previous step)
  • Seed the database with user's data by using the command npx mongoose db:seed:all

About

Boilerplate for node applications with express framework

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published