DockStack is a production-grade DevOps platform that simplifies containerized deployments using Docker, Nginx, Terraform, Ansible, and GitHub Actions โ all wired into one centralized pipeline.
- ๐จ Problem Statement
- ๐ก Solution
- ๐๏ธ System Architecture
- ๐งฐ Tech Stack
- ๐ Project Structure
- โ๏ธ Installation & Setup
- ๐ณ Docker Setup
- โ๏ธ Infrastructure โ Terraform
- ๐ค Server Config โ Ansible
- ๐ CI/CD Pipeline
- ๐ Authentication
- ๐ Features
- ๐ฎ Future Improvements
- ๐จโ๐ป Author
- ๐ค Contributing
Modern application deployment involves multiple steps and tools. Managing them manually is time-consuming, error-prone, and overwhelming โ especially for developers new to DevOps.
| โ Pain Point | ๐ฉ Impact |
|---|---|
| Manual Docker container setup | Time wasted on repetitive config |
| Complex server configuration | High chance of human error |
| No centralized deployment management | Scattered tools, no visibility |
| Difficult CI/CD pipeline setup | Slow release cycles |
DockStack provides a centralized DevOps platform that integrates all these tools into one seamless workflow.
โ
Manage projects from a unified dashboard
โ
Deploy applications using Docker containers
โ
Route traffic with Nginx reverse proxy
โ
Provision cloud infrastructure with Terraform
โ
Configure servers automatically with Ansible
โ
Automate every deployment with GitHub Actions
flowchart TD
U([๐ User Browser]) --> N
subgraph APP ["โก Application Layer"]
N[๐ Nginx\nReverse Proxy :80]
N --> FE[โ๏ธ React + Vite\nFrontend]
N --> BE[๐ข Node.js + Express\nBackend API]
BE --> DB[(๐ MongoDB\nDatabase)]
end
subgraph INFRA ["๐๏ธ Infrastructure Layer"]
TF[๐ Terraform\nCloud Provisioning]
AN[๐ค Ansible\nServer Configuration]
TF --> AN
end
subgraph CICD ["๐ CI/CD Layer"]
GH[๐ฆ GitHub Push]
GA[โ๏ธ GitHub Actions]
GH --> GA
GA -->|SSH + Deploy| APP
end
INFRA -->|Prepares Server| APP
style APP fill:#0d2137,stroke:#00d4ff,color:#7dd3fc
style INFRA fill:#1a0a2e,stroke:#7B42BC,color:#c4b5fd
style CICD fill:#0a1f0a,stroke:#16a34a,color:#bbf7d0
| Technology | Purpose |
|---|---|
| UI Component Library | |
| Lightning-fast Bundler | |
| HTTP Client | |
| Client-side Routing |
| Technology | Purpose |
|---|---|
| JavaScript Runtime | |
| REST API Framework | |
| NoSQL Database | |
| Authentication |
| Technology | Purpose |
|---|---|
| Containerization | |
| Multi-container Orchestration | |
| Reverse Proxy | |
| Infrastructure as Code | |
| Server Automation | |
| CI/CD Automation |
dockstack-devops-platform/
โ
โโโ ๐ข backend/
โ โโโ server.js โ App entry point
โ โโโ package.json
โ โโโ .env โ Environment variables
โ โ
โ โโโ config/
โ โ โโโ db.js โ MongoDB connection
โ โ
โ โโโ models/
โ โ โโโ User.js โ User schema
โ โ โโโ Project.js โ Project schema
โ โ โโโ Deployment.js โ Deployment schema
โ โ
โ โโโ controllers/
โ โ โโโ authController.js
โ โ โโโ projectController.js
โ โ โโโ deploymentController.js
โ โ
โ โโโ middleware/
โ โ โโโ authMiddleware.js โ JWT verification
โ โ
โ โโโ routes/
โ โโโ authRoutes.js
โ โโโ projectRoutes.js
โ โโโ deploymentRoutes.js
โ
โโโ โ๏ธ frontend/
โ โโโ vite.config.js
โ โโโ src/
โ โโโ main.jsx
โ โโโ App.jsx
โ โโโ components/
โ โ โโโ Navbar.jsx
โ โ โโโ Sidebar.jsx
โ โ โโโ Loader.jsx
โ โโโ pages/
โ โ โโโ Login.jsx
โ โ โโโ Register.jsx
โ โ โโโ Dashboard.jsx
โ โ โโโ Projects.jsx
โ โ โโโ Profile.jsx
โ โโโ services/
โ โ โโโ api.js โ Axios API config
โ โโโ context/
โ โโโ AuthContext.jsx โ Global auth state
โ
โโโ ๐ nginx/
โ โโโ default.conf โ Reverse proxy rules
โ
โโโ ๐ณ docker/
โ โโโ Dockerfile.backend
โ โโโ Dockerfile.frontend
โ โโโ docker-compose.yml โ Orchestrates all services
โ
โโโ ๐ terraform/
โ โโโ main.tf โ Cloud resource definitions
โ โโโ variables.tf
โ
โโโ ๐ค ansible/
โ โโโ setup.yml โ Installs Docker & Git
โ
โโโ ๐ .github/
โโโ workflows/
โโโ deploy.yml โ Auto-deploy on push
Make sure these are installed before you begin.
git clone https://github.com/YOUR_USERNAME/DockStack.git
cd DockStackcd backend
npm install
npm run dev๐ข Backend API running at
http://localhost:5000
cd frontend
npm install
npm run devโ๏ธ Frontend running at
http://localhost:3000
Run the entire platform โ Frontend, Backend, MongoDB, and Nginx โ with a single command.
docker-compose -f docker/docker-compose.yml up --build| Container | Service | Port |
|---|---|---|
| ๐ nginx | Reverse Proxy | 80 |
| โ๏ธ frontend | React App | 3000 |
| ๐ข backend | Express API | 5000 |
| ๐ mongo | MongoDB | 27017 |
๐ Open
http://localhostin your browser โ Nginx routes everything automatically.
Provisions a cloud server ready for Docker deployments.
# Move into terraform directory
cd terraform
# Initialize Terraform providers
terraform init
# Preview what will be created
terraform plan
# Provision the server
terraform applyโ
Apply complete!
โ
Resources: 2 added, 0 changed, 0 destroyed.
โ
Output: server_ip = "xx.xx.xx.xx"
Automatically installs and configures Docker on your remote server.
ansible-playbook ansible/setup.yml# What setup.yml does:
โ Install Docker & Docker Compose
โ Install Git
โ Configure firewall (UFW)
โ Enable Docker service on bootPush to
mainโ app is live. Zero manual steps.
sequenceDiagram
participant Dev as ๐จโ๐ป Developer
participant GH as ๐ฆ GitHub
participant GA as โ๏ธ GitHub Actions
participant SRV as ๐ฅ๏ธ Cloud Server
Dev->>GH: git push origin main
GH->>GA: Trigger deploy.yml workflow
GA->>GA: ๐ Load SSH secrets & ENV
GA->>SRV: ๐ก SSH into server
SRV->>SRV: ๐ฅ git pull latest code
SRV->>SRV: ๐ณ docker compose up --build
SRV-->>Dev: โ
Deployment successful!
Required GitHub Secrets:
| Secret Key | Description |
|---|---|
SSH_PRIVATE_KEY |
Private key for SSH access |
SERVER_IP |
Your cloud server's public IP |
SSH_USER |
Server login user (e.g. ubuntu) |
JWT-based authentication secures all protected routes.
POST /api/auth/register โ Create a new account
POST /api/auth/login โ Login & receive JWT token
GET /api/projects โ ๐ Protected (token required)
GET /api/deployments โ ๐ Protected (token required)
Client โโโโ POST /login โโโโโถ Server
โโโ JWT Token โโโโ
Client โโโโ Authorization: Bearer <token> โโโถ Protected Routes
| Feature | Status |
|---|---|
| ๐ JWT User Authentication | โ Done |
| ๐ Project Management Dashboard | โ Done |
| ๐ Deployment Tracking | โ Done |
| ๐ณ Dockerized Services | โ Done |
| ๐ Nginx Reverse Proxy | โ Done |
| ๐ Infrastructure as Code (Terraform) | โ Done |
| ๐ค Server Automation (Ansible) | โ Done |
| ๐ CI/CD with GitHub Actions | โ Done |
๐ Kubernetes Deployment โ Container orchestration at scale
๐ Real-time Deployment Logs โ Live streaming log output
๐ Prometheus & Grafana โ Metrics, dashboards & alerting
๐ GitHub Repository Integration โ One-click repo imports
๐ Automatic Container Scaling โ Load-based autoscaling
๐ Role-Based Access Control โ Fine-grained permissions
B.Tech IT Engineering Student DevOps & Full Stack Development Enthusiast
Built with โค๏ธ, countless docker compose up attempts, and way too much coffee โ
Contributions are always welcome! Here's how to get started:
# 1. Fork the repository
# 2. Create your feature branch
git checkout -b feature/your-feature-name
# 3. Commit your changes
git commit -m "feat: add your feature"
# 4. Push and open a Pull Request
git push origin feature/your-feature-nameThis project is open-source and available under the MIT License.
MIT License โ Free to use, modify, and distribute with attribution.