Skip to main content

Build

The application is built using SWC (Speedy Web Compiler) for fast TypeScript compilation:
npm run build:merchant-api
The build process:
  1. TypeScript compilation via SWC
  2. NestJS CLI bundling
  3. Output to dist/ directory

Docker

Development

Docker Compose provides the full local development stack:
# Start all services
npm run dev

# Rebuild containers
npm run dev:build

Production

Production Docker images are built via the project’s Dockerfile and deployed to AWS infrastructure.

Infrastructure (Terraform)

Infrastructure is managed via Terraform in the terraform/ directory:
ResourceDescription
ECS/FargateApplication container hosting
RDSManaged PostgreSQL
ElastiCacheManaged Redis
SQSMessage queues
S3File storage (images, assets)
CloudFrontCDN for static assets
KMSEncryption key management
SESEmail sending (fallback)
LambdaServerless functions
BatchBatch processing jobs (segment sync)
SSMParameter 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:
AlertWebhook Variable
New app installsAPP_INSTALLS_SLACK_WEBHOOK_URL
Sequence updatesSEQUENCE_UPDATES_SLACK_WEBHOOK_URL
Waitlist joinsWAITLIST_JOINED_SLACK_WEBHOOK_URL

AWS Lambda Functions

The lambdas/ directory contains serverless functions for:
  • Lightweight processing tasks
  • Event-driven operations
  • Scheduled tasks that don’t require the full application context

Environment Stages

StageDescription
developmentLocal Docker Compose
sandboxShared development environment
stagingPre-production testing
productionLive environment