FastAPI backend for the StatusNest multi-tenant service monitoring platform. Three independently deployed microservices running on AWS ECS Fargate behind an Application Load Balancer.
| Service | Port | Responsibility |
|---|---|---|
auth |
8000 | User registration, login, JWT issuance |
monitor |
8001 | Services CRUD, incidents, subscribers |
status |
8002 | Public status page (Redis-first, RDS fallback) |
All three are routed through CloudFront → ALB using path-based routing.
| Layer | Technology |
|---|---|
| Framework | FastAPI |
| ORM | SQLAlchemy |
| Database | PostgreSQL (AWS RDS) |
| Cache | Redis (AWS ElastiCache) |
| Auth | JWT (python-jose) + bcrypt |
| Tracing | AWS X-Ray SDK |
| Container | Docker → AWS ECR → ECS Fargate |
POST /auth/register # Create account
POST /auth/login # Returns JWT access token
GET /auth/me # Current user info (requires Bearer token)
GET /api/monitor/services # List active services
POST /api/monitor/services # Add service
DELETE /api/monitor/services/{id} # Soft-delete service
GET /api/monitor/incidents # List incidents
POST /api/monitor/incidents # Create incident
PATCH /api/monitor/incidents/{id} # Update incident status
GET /api/monitor/subscribers # List subscribers
POST /api/monitor/subscribers # Add subscriber
GET /api/status/{username} # Public status page data
GET /api/status/{username}/history/{service_id} # 24h history for a service
CloudFront
/auth/* → ALB → auth ECS service (port 8000)
/api/* → ALB → monitor / status (ports 8001, 8002)
| Resource | Value |
|---|---|
| ECS Cluster | --- |
| ALB | --- |
| RDS | --- |
| Redis | --- |
| Region | --- |
Each service reads from AWS Secrets Manager / ECS task definition environment:
DATABASE_URL ---
REDIS_URL ---
JWT_SECRET ---
GitHub Actions with OIDC (no long-lived AWS keys):
- Build Docker image
- Push to ECR
- Update ECS service (force new deployment)
Role: ---
| Repo | Description |
|---|---|
| statusnest-frontend | React SPA |
| statusnest-worker | Lambda monitor + SQS processor |
| statusnest-infra | Terraform IaC for all AWS infrastructure |