Build
The application is built using SWC (Speedy Web Compiler) for fast TypeScript compilation:- TypeScript compilation via SWC
- NestJS CLI bundling
- Output to
dist/directory
Docker
Development
Docker Compose provides the full local development stack:Production
Production Docker images are built via the project’sDockerfile and deployed to AWS infrastructure.
Infrastructure (Terraform)
Infrastructure is managed via Terraform in theterraform/ directory:
| Resource | Description |
|---|---|
| ECS/Fargate | Application container hosting |
| RDS | Managed PostgreSQL |
| ElastiCache | Managed Redis |
| SQS | Message queues |
| S3 | File storage (images, assets) |
| CloudFront | CDN for static assets |
| KMS | Encryption key management |
| SES | Email sending (fallback) |
| Lambda | Serverless functions |
| Batch | Batch processing jobs (segment sync) |
| SSM | Parameter store for secrets |
CI/CD
GitHub Actions
The project uses GitHub Actions workflows (.github/workflows/) for:
- Automated testing on pull requests
- Build verification
- Deployment to staging/production
AWS CodeBuild
Production builds use AWS CodeBuild (buildspec.yml) for:
- Docker image building
- ECR image pushing
- ECS service deployment
Monitoring
New Relic
Application performance monitoring via New Relic (newrelic.js):
- Transaction tracing
- Error tracking
- Custom metrics
- Browser monitoring
Slack Alerts
Operational alerts are sent to Slack channels:| Alert | Webhook Variable |
|---|---|
| New app installs | APP_INSTALLS_SLACK_WEBHOOK_URL |
| Sequence updates | SEQUENCE_UPDATES_SLACK_WEBHOOK_URL |
| Waitlist joins | WAITLIST_JOINED_SLACK_WEBHOOK_URL |
AWS Lambda Functions
Thelambdas/ directory contains serverless functions for:
- Lightweight processing tasks
- Event-driven operations
- Scheduled tasks that don’t require the full application context
Environment Stages
| Stage | Description |
|---|---|
development | Local Docker Compose |
sandbox | Shared development environment |
staging | Pre-production testing |
production | Live environment |