Infrastructure and deployment repository for the LocalStore Platform. Hosts Terraform configurations for AWS deployment, Docker Compose for local development, and CI/CD pipeline configurations.
Spec Version: v1.1-specs
Repository: infra
Status: π‘ In Progress
This repository contains:
- Terraform configurations for AWS infrastructure (VPC, EC2, RDS, etc.)
- Docker Compose files for local development and production
- CI/CD pipelines using GitHub Actions
- Kubernetes manifests (future scaling path)
- IaC: Terraform 1.5+
- Container Runtime: Docker 24+, Docker Compose 2.20+
- Cloud Provider: AWS (ap-southeast-1 - Singapore region)
- CI/CD: GitHub Actions
- DNS/CDN: CloudFlare (optional)
MVP ($20/month):
βββββββββββββββββββββββββββββββββββββββββββ
β AWS EC2 (t2.small) β
β βββββββββββββββββββββββββββββββββββ β
β β Docker Compose β β
β β βββββββββββ βββββββββββ β β
β β β NestJS β β Python β β β
β β β API β β AI β β β
β β ββββββ¬βββββ ββββββ¬βββββ β β
β β β β β β
β β ββββββ΄βββββββββββββ΄βββββ β β
β β β PostgreSQL β β β
β β β + Redis β β β
β β ββββββββββββββββββββββββ β β
β βββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββ
infra/
βββ .github/
β βββ workflows/ # CI/CD pipelines
β β βββ terraform-plan.yml
β β βββ terraform-apply.yml
β β βββ docker-build.yml
β βββ CODEOWNERS
β βββ PULL_REQUEST_TEMPLATE.md
β βββ copilot-instructions.md
β
βββ terraform/
β βββ environments/
β β βββ dev/ # Development environment
β β βββ staging/ # Staging environment
β β βββ prod/ # Production environment
β βββ modules/
β β βββ vpc/ # VPC, subnets, security groups
β β βββ ec2/ # EC2 instances
β β βββ rds/ # RDS PostgreSQL (future)
β β βββ s3/ # S3 buckets
β βββ shared/ # Shared variables and outputs
β
βββ docker/
β βββ compose/
β β βββ docker-compose.yml # Local dev
β β βββ docker-compose.prod.yml # Production
β β βββ docker-compose.test.yml # Testing
β βββ nginx/ # Nginx reverse proxy configs
β βββ scripts/ # Helper scripts
β
βββ k8s/ # Kubernetes manifests (future)
β βββ base/
β βββ overlays/
β
βββ scripts/
β βββ deploy.sh # Deployment script
β βββ config.sh # Environment configuration generator
β βββ ecr.mk # ECR operations Makefile
β
βββ docs/
β βββ DEPLOYMENT.md # Deployment guide
β βββ SECURITY.md # Security configuration
β βββ MONITORING.md # Monitoring setup
β
βββ .env.example # Environment template
βββ SPEC_LINKS.md # Links to specifications
βββ GIT_WORKFLOW.md # Git workflow guide
βββ README.md # This file
# Check required tools
terraform --version # Need 1.5+
docker --version # Need 24+
docker compose version # Need 2.20+
aws --version # Need 2.0+# Clone repository
git clone https://github.com/localstore-platform/infra.git
cd infra
# Copy environment template
cp .env.example .env
# Edit .env with your settings
# Start local development environment
cd docker/compose
docker compose up -d
# Verify services are running
docker compose ps# Configure AWS credentials
aws configure
# Initialize Terraform
cd terraform/environments/prod
terraform init
# Preview changes
terraform plan -out=plan.tfplan
# Apply changes
terraform apply plan.tfplanSee .env.example for all required environment variables.
Key variables:
| Variable | Description | Example |
|---|---|---|
AWS_REGION |
AWS region | ap-southeast-1 |
EC2_INSTANCE_TYPE |
EC2 instance size | t2.small |
DOMAIN_NAME |
Primary domain | quanly.ai |
DB_PASSWORD |
Database password | (secret) |
| Component | Monthly Cost |
|---|---|
| EC2 t2.small | ~$15 |
| EBS Storage (20GB) | ~$2 |
| Data Transfer | ~$3 |
| Total MVP | ~$20/month |
- CPU utilization
- Memory usage
- Disk I/O
- Network traffic
- CPU > 80% for 5 minutes
- Memory > 85%
- Disk usage > 90%
- API response time > 2s
| Port | Service | Source |
|---|---|---|
| 22 | SSH | Admin IPs only |
| 80 | HTTP | 0.0.0.0/0 |
| 443 | HTTPS | 0.0.0.0/0 |
| 5432 | PostgreSQL | VPC only |
| 6379 | Redis | VPC only |
- β Never commit secrets to repository
- β Use AWS Secrets Manager or Parameter Store
- β Enable VPC flow logs
- β Regular security patching
- β SSL/TLS for all external traffic
| Repository | Description | Status |
|---|---|---|
| specs | Documentation & specifications | β Complete |
| api | NestJS backend API | β Sprint 0.5 |
| menu | Next.js public menu website | π‘ In Progress |
| contracts | TypeScript shared types | β v0.1.0 |
| dashboard | Next.js owner dashboard | π‘ Docs Only |
| mobile | Flutter mobile app | π‘ Docs Only |
CODEOWNERS: @localstore-platform/infra-team
For infrastructure support or questions:
- Create an issue in this repository
- Tag
@localstore-platform/infra-teamin PRs - Reference relevant spec sections in SPEC_LINKS.md
MIT License - see LICENSE for details.