API Architecture
The statux-api/ repository is a NestJS monorepo containing three applications and three shared libraries.
Monorepo Structure
statux-api/
├── apps/
│ ├── statuspages/ # Port 3000, api.statux.io
│ ├── alerting/ # Port 3001, alerts-api.statux.io
│ └── synthetics/ # Port 3002, synthetics-api.statux.io
├── libs/
│ ├── common/ # @app/common
│ ├── auth/ # @app/auth
│ └── database/ # @app/database
├── package.json # Root dependencies
└── nest-cli.json # Monorepo config
Database Schemas
Each application uses a separate PostgreSQL schema:
| App | Schema | Database |
|---|---|---|
| Statux Pages | statuspages | statux |
| Statux Alerts | alerts | statux |
| Statux Synthetics | synthetics | statux |
Shared entities (Organization, Subscription) use the core schema.
Shared Libraries
@app/common
ApiResponseinterface andResponseInterceptorPaginationQueryDtofor list endpointsHttpExceptionFilterfor error handlingEncryptionServicefor AES-256-GCM encryption
@app/auth
JwtStrategyfor Cognito JWT validationJwtAuthGuard,ProjectAccessGuard,OrgRolesGuard@CurrentUser(),@CurrentProject(),@Public()decorators
@app/database
BaseEntitywith id, createdAt, updatedAt- Shared entities: Organization, OrganizationMember, UserProduct, etc.
DatabaseModule.forRoot()configuration
See Shared Libraries for detailed usage.