diff --git a/.gitignore b/.gitignore index edb9a70..58677e6 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,5 @@ __pycache__/ .dist/ scaffold/ bin/format/ -venv/ \ No newline at end of file +venv/ +dist/ diff --git a/template/FullStack/React(Frontend)+Nodejs(Backend)/README.md b/template/FullStack/React(Frontend)+Nodejs(Backend)/README.md index 99e5946..fd888c6 100644 --- a/template/FullStack/React(Frontend)+Nodejs(Backend)/README.md +++ b/template/FullStack/React(Frontend)+Nodejs(Backend)/README.md @@ -26,6 +26,10 @@ This repository provides a simple FullStack template for building modern web app - **MongoDB**: A NoSQL database known for its flexibility and scalability. - **Mongoose**: An elegant MongoDB object modeling for Node.js. +### Devops + +- **Docker** : Docker is an open-source containerization platform by which you can pack your application and all its dependencies into a standardized unit called a container + ## Installation 1. **Populate the .env.example file**: @@ -95,7 +99,25 @@ The application uses MongoDB for storing user information. The `users` collectio - **emailid**: String, unique, cannot be null. - **password**: String, hashed, cannot be null. + +## Instant Docker Setup + +> **Note :** You should have [Docker](https://docs.docker.com/get-started/get-docker/) installed on your machine and it should be online + +- **Run the following command (Docker compose gets automatically downloaded with Docker Desktop) :** + + ```bash + docker-compose up + ``` + +- **Access the application :** + + Visit `http://localhost:80/` in your web browser. + +## Architecture config : + +![architecture](https://github.com/user-attachments/assets/1f6de5a6-4bf8-4832-a48d-e129172258a8) --- -Made using [Universal-Box](https://github.com/Abhishek-Mallick/universal-box) +Made using [Universal-Box](https://github.com/Abhishek-Mallick/universal-box) diff --git a/template/FullStack/React(Frontend)+Nodejs(Backend)/docker-compose.yaml b/template/FullStack/React(Frontend)+Nodejs(Backend)/docker-compose.yaml new file mode 100644 index 0000000..4a2ca08 --- /dev/null +++ b/template/FullStack/React(Frontend)+Nodejs(Backend)/docker-compose.yaml @@ -0,0 +1,38 @@ +version: '3.8' + +services: + mongodb: + image: mongo + container_name: mongodb_uni + ports: + - "27017:27017" + volumes: + - mongodb_template_data:/data/db + + backend: + build: + context: ./server + dockerfile: Dockerfile + container_name: univ_template_nodejs_server + depends_on: + - mongodb + ports: + - "3000:3000" + environment: + MONGO_URL: mongodb://mongodb_uni:27017/uni + JWT_SECRET: jwt_secret + + frontend: + build: + context: ./client + dockerfile: Dockerfile + container_name: univ_template_react_client + depends_on: + - backend + ports: + - "80:80" + environment: + REACT_APP_BASE_URL: http://localhost:3000 + +volumes: + mongodb_template_data: \ No newline at end of file