This project automates the deployment of full-stack applications by cloning a Git repository, detecting the technology stack (frontend, backend, and database), generating Dockerfiles, and deploying the application using Docker Compose. Real-time status updates are provided via WebSocket.
- Repository Cloning: Clone repositories from GitHub, GitLab, or Bitbucket.
- Technology Detection: Automatically identify frontend, backend, and database technologies.
- Dockerfile Generation: Generate Dockerfiles based on detected technologies.
- Docker Compose Integration: Orchestrate deployment using
docker-compose.yml. - Real-Time Status Updates: Track deployment progress via WebSocket.
- Nginx Configuration: Auto-configure Nginx to serve the frontend and proxy requests to the backend.
Ensure you have the following installed:
- Node.js (v14 or higher)
- Docker (v20 or higher)
- Docker Compose (v2 or higher)
Your project should follow this structure for seamless deployment:
your-repo/
βββ frontend/ # Frontend code (React, Vue)
βββ backend/ # Backend code (Node.js, Python Flask) (MySQL, PostgreSQL, MongoDB)
βββ database/ # Database initialization scripts
β βββ init/ # Folder containing database initialization scripts
βββ ...
| Component | Accepted Folder Names |
|---|---|
| Frontend | frontend, client, web, ui, app |
| Backend | backend, server, api, services |
| Database | database, db, data, storage |
The database/init/ folder must contain SQL scripts for database setup:
database/
βββ init/
βββ 01-create-tables.sql
βββ 02-insert-data.sql
These environment variables are essential for the Docker deployment process. Make sure to include them in your projectβs environment files so that Docker can set up the deployment correctly.
VITE_API_URL(Vite) orREACT_APP_API_URL(Create React App) β Backend API URL (e.g.,http://localhost:4002/api)- Backend Requests Should start with
/api
DB_HOST: Database host (e.g.,db)DB_USER: Database username (e.g.,root,postgres)DB_PASS: Database password (e.g.,root,postgres)DB_NAME: Database name (e.g.,mydb)PORT: Backend server port (e.g.,4002)
MYSQL_ROOT_PASSWORD(MySQL) orPOSTGRES_PASSWORD(PostgreSQL) β Root password
To ensure Docker can handle the deployment process without errors, you need to create a .env file in your project root directory . Add the required environment variables based on your stack setup.
Example .env file:
# Frontend
VITE_API_URL=http://localhost:4002/api # for Vite
# or
REACT_APP_API_URL=http://localhost:4002/api # for Create React App
# Backend
DB_HOST=db
DB_USER=root
DB_PASS=root
DB_NAME=mydb
PORT=4002
# Database
MYSQL_ROOT_PASSWORD=root # for MySQL
# or
POSTGRES_PASSWORD=postgres # for PostgreSQLThe project currently supports the following technologies for each component:
- React (with Create React App or Vite)
- Vue (with Vite)
More frontend frameworks (e.g., Angular, Svelte) will be integrated in the future.
- Node.js (Express.js or other frameworks)
- Python Flask
More backend frameworks (e.g., Django, Spring Boot) will be integrated in the future.
- MySQL
- PostgreSQL
- MongoDB
More databases (e.g., SQLite, Redis) will be integrated in the future.
Run the following command in your terminal to install dependencies and start both frontend and backend:
git clone https://github.com/drawliin/web-based-auto-deploy-system.git
cd web-based-auto-deploy-systemcd nodejs
npm install
node server.jscd ../react
npm install
npm run dev- Open the frontend in your browser at http://localhost:5173.
- Enter your GitHub repository URL in the input field.
- Click the Clone Repo button.
- The backend will handle cloning the repository and setting up the deployment.
- Replace
https://github.com/your-username/your-repo.gitwith your repository URL.
Track the deployment process in real-time via WebSocket:
ws://localhost:5001
Once the deployment is complete, visit:
http://localhost:8081
.
βββ nodejs/
βββ cloned-repos/ # Directory where cloned repositories are stored
βββ server.js # Main Express server file
βββ react/
βββ src/
βββ App.jsx
βββ index.jsx
βββ ...
To quickly test the deployment system, use one of these sample repositories:
- React Vite + Node.js + MySQL
π Fullstack App With NodeJS and MySQLhttps://github.com/drawliin/FullStack-React-Node-MySQL.git
- React Vite + NodeJS + PostgreSQL
π FullStack App With Node and PostgreSQLhttps://github.com/drawliin/Fullstack-Node-PostgreSQL.git
- React CRA + Python Flask + MySQL
π FullStack App With React (CRA) and FLASKhttps://github.com/drawliin/FullStack-ReactCRA-FLASK.git
- Vue + Node.js + MySQL
π Fullstack App With VueJS and MySQLhttps://github.com/drawliin/FullStack-Vue-MySQL.git
- React Vite + Python Flask + MongoDB
π FullStack App With FLASK and MongoDBhttps://github.com/drawliin/fullstack-python-mongo.git
Contributions are welcome! Feel free to open an issue or submit a pull request for improvements.
- Express.js β Web server framework
- Docker β Containerization
- Socket.IO β Real-time communication
This project is licensed under the MIT License. See the MIT License for details.