This project implements a modern cloud infrastructure using AWS ECS, Elasticsearch, and a microservices architecture with Go backend and Next.js frontend.
graph TD
%% Style definitions
classDef mainPipeline fill:#4a148c,stroke:#9c27b0,stroke-width:4px,color:#fff,rx:10px
classDef terraformStage fill:#01579b,stroke:#29b6f6,stroke-width:2px,color:#fff,rx:8px
classDef appStage fill:#2e7d32,stroke:#66bb6a,stroke-width:2px,color:#fff,rx:8px
classDef imageStage fill:#bf360c,stroke:#ff7043,stroke-width:2px,color:#fff,rx:8px
%% Main Pipeline
Main(🎯 CI/CD Pipeline):::mainPipeline --> Terraform
Main --> Application
%% Terraform Pipeline
subgraph Terraform[⚙️ Infrastructure Pipeline]
direction TB
T1[🔍 Validate Terraform] --> T2[📋 Plan Resources]
T2 --> T3[🚀 Apply Changes]
T3 --> T4[♻️ Cleanup/Destroy]
end
%% Application Pipeline
subgraph Application[📦 Application Pipeline]
direction TB
A1[⚡ Run Tests] --> A2[🏭 Build Artifacts]
A2 --> A3[🚀 Production Deploy]
A2 --> |Build Backend| BS[🖥️ Go API Image]:::imageStage
A2 --> |Build Frontend| BC[🎨 Next.js Image]:::imageStage
BS --> A3
BC --> A3
end
%% Subgraph Styles
style Terraform fill:#01579b,stroke:#29b6f6,stroke-width:3px
style Application fill:#2e7d32,stroke:#66bb6a,stroke-width:3px
├── client/ # Next.js frontend application
├── server/ # Go backend service
├── database/ # Elasticsearch configuration
├── Terraform/ # Infrastructure as Code
└── docker-compose files # Development and production environments
make up-devmake up-prod- Frontend: Next.js application (Port 3000)
- Backend: Go service (Port 8080)
- Database: Elasticsearch (Ports 9200, 9300)
The project uses GitLab CI/CD pipeline with three stages:
- Test: Run Go tests
- Build: Build and push Docker images to ECR
- Deploy: Deploy to ECS (PreProd/Prod environments)
- AWS ECS: Container orchestration
- AWS ALB: Load balancing
- AWS VPC: Network infrastructure
- Elasticsearch: Search and analytics engine
- Clone the repository
- Set up environment variables
- Run
make up-devfor development environment
Required environment variables:
MONGO_USERMONGO_PASSJWT_KEYCLIENT_DOMAIN- AWS credentials for deployment
- Create a feature branch
- Make changes
- Submit a merge request
