Foundation repository for the SpeakASAP refactoring program. This repo hosts shared documentation, infrastructure templates, and service scaffolding used by Phase 1+ services.
speakasap/
βββ README.md # This file
βββ docker-compose.yml # Base Docker Compose template
βββ docker-compose.blue.yml # Blue environment (all services)
βββ docker-compose.green.yml # Green environment (all services)
βββ .env.example # Environment variables template
βββ scripts/
β βββ deploy.sh # Deployment script template
βββ shared/ # Shared utilities
β βββ notifications/ # Notification client
βββ docs/
βββ agents/ # Agent task definitions
βββ infrastructure/ # Infrastructure documentation
β βββ SHARED_SERVICES.md
β βββ PORT_ALLOCATION.md
β βββ DEPLOYMENT_GUIDE.md
βββ refactoring/ # Refactoring plans and tasks
- Copy
docker-compose.ymlto your service directory - Replace
service-namewith your actual service name - Create
docker-compose.blue.ymlanddocker-compose.green.ymlbased on the template - Update container names to include
-blueand-greensuffixes
- Copy
.env.exampleto.envin your service directory - Fill in all required values (see
docs/infrastructure/SHARED_SERVICES.md) - Never commit
.envto git - Keep
.env.exampleupdated with variable names (keys only, no values)
./scripts/deploy.sh
All services use ports in the 42xx range:
| Service | Port | Phase |
|---|---|---|
| Content Service | 4201 | Phase 1 |
| Certification Service | 4202 | Phase 2 |
| Assessment Service | 4203 | Phase 2 |
| Course Service | 4205 | Phase 3 |
| Education Service | 4206 | Phase 3 |
| User Service | 4207 | Phase 3 |
| Payment Service | 4208 | Phase 4 |
| Notification Service | 4209 | Phase 4 |
| API Gateway | 4210 | Phase 5 |
| Frontend | 4211 | Phase 5 |
| Salary Service | 4212 | Phase 4 |
| Financial Service | 4213 | Phase 4 |
See docs/infrastructure/PORT_ALLOCATION.md for complete details.
All services integrate with shared microservices:
- Auth Microservice (
AUTH_SERVICE_URL) - JWT validation, user identity - Database Server (
DB_HOST) - PostgreSQL + Redis (shared) - Logging Microservice (
LOGGING_SERVICE_URL) - Centralized logging - Notifications Microservice (
NOTIFICATIONS_MICROSERVICE_URL) - Email/Telegram/WhatsApp - Payments Microservice (
PAYMENTS_MICROSERVICE_URL) - Payment processing - AI Microservice (
AI_SERVICE_URL) - AI-powered translations and content
See docs/infrastructure/SHARED_SERVICES.md for connection details.
Deployments use blue/green deployment via nginx-microservice:
- Prepare Green: Builds and starts green containers
- Switch Traffic: Updates nginx to route to green
- Monitor Health: Monitors for 30 seconds
- Cleanup: Stops old blue containers if healthy
See docs/infrastructure/DEPLOYMENT_GUIDE.md for complete deployment instructions.
docker-compose.yml provides a template following marathon service patterns:
- Multi-stage build support
- Blue/green deployment ready
- Health checks configured
- Environment variable injection
- nginx-network integration
- Copy
docker-compose.ymlto service directory - Replace
service-namewith actual service name - Update environment variables
- Create blue and green variants
SERVICE_NAME- Service identifierPORT- Service port (42xx range)DB_HOST,DB_PORT,DB_USER,DB_PASSWORD,DB_NAME- Database connectionLOGGING_SERVICE_URL- Centralized logging endpointDATABASE_URL- Full database connection string
AUTH_SERVICE_URL- If service needs authenticationNOTIFICATION_SERVICE_URL- If service sends notificationsAI_SERVICE_URL- If service uses AI features- Timeout and retry configurations
See .env.example for complete list.
- Use environment variables - Never hardcode URLs or ports
- Follow naming conventions - Blue/green container suffixes
- Implement health checks -
/healthendpoint required - Keep .env synced - Update
.env.examplewith new variables (keys only) - Validate before deploy - Test docker-compose files
- Follow marathon patterns - Consistency across services
- Use shared utilities - Leverage
shared/directory
- Deployment Guide:
docs/infrastructure/DEPLOYMENT_GUIDE.md - Port Allocation:
docs/infrastructure/PORT_ALLOCATION.md - Shared Services:
docs/infrastructure/SHARED_SERVICES.md - Refactoring Plans:
docs/refactoring/ - Agent Tasks:
docs/agents/
- Production-only workflows - No dev environment configs
- Centralized logging - All services use
LOGGING_SERVICE_URL - Port range: 42xx reserved for SpeakASAP services
- Blue/green deployment - Zero-downtime deployments via nginx-microservice
- Marathon patterns - Follow marathon service structure for consistency
- Marathon Service:
/Users/sergiystashok/Documents/GitHub/marathon - nginx-microservice: Integration patterns and deployment scripts
- Phase 1 Tasks:
docs/refactoring/PHASE1_TASK_DECOMPOSITION.md