Services
NeXuS consists of 11 microservices, 4 databases, and supporting infrastructure. Each service is an independent Docker container with its own build context.
Public Services
These services are exposed via Traefik with automatic HTTPS:
| Service | Container | Port | URL | Purpose |
|---|---|---|---|---|
| Frontend | nexus-frontend | 3000 | nexus.sebhosting.com | Next.js web application |
| API Gateway | nexus-api | 4000 | api.sebhosting.com | REST API, Docker stats, DNS proxy |
| Auth Service | nexus-auth | 6000 | auth.sebhosting.com | JWT authentication, user management |
| CMS Service | nexus-cms | 7000 | cms.sebhosting.com | Headless content management |
| CDN Service | nexus-cdn | 7001 | cdn.sebhosting.com | Static asset delivery |
| Cache Service | nexus-cache | 7002 | cache.sebhosting.com | Distributed caching (Redis + Memcached) |
| WAF Service | nexus-waf | 7003 | waf.sebhosting.com | Web application firewall |
| AI Gateway | nexus-ai | 5000 | ai-gateway.sebhosting.com | Claude API integration |
| MCP Server | nexus-mcp | 5001 | mcp.sebhosting.com | Claude MCP tool server |
| Grafana | nexus-grafana | 3000 | grafana.sebhosting.com | Metrics visualization |
Databases (Internal Only)
Databases run exclusively on the nexus-internal network with no public access:
| Database | Container | Port | Purpose |
|---|---|---|---|
| PostgreSQL 16 | nexus-postgres | 5432 | Users, refresh tokens, relational data |
| MongoDB 7 | nexus-mongodb | 27017 | CMS documents |
| Redis 7 | nexus-redis | 6379 | Session store, caching, pub/sub |
| Memcached | nexus-memcached | 11211 | High-performance object cache |
Monitoring
| Service | Container | Port | Purpose |
|---|---|---|---|
| Prometheus | nexus-prometheus | 9090 | Metrics collection (internal only) |
Service Details
Frontend (nexus-frontend)
- Stack: Next.js 16, React 19, TypeScript, Tailwind CSS
- Features: Dashboard, DNS management, service monitoring, Grafana embed, MCP status
- Auth: JWT access tokens + httpOnly refresh cookies
- Plan system: Feature gating based on Basic/Pro/Enterprise tiers
API Gateway (nexus-api)
- Stack: Express.js, TypeScript
- Endpoints:
/health,/status,/stats,/stats/logs/:name,/dns/* - Responsibilities: Docker container stats, Cloudflare DNS proxy, health aggregation
- Dependencies: PostgreSQL, Redis, MongoDB
Auth Service (nexus-auth)
- Stack: Express.js, bcryptjs, jsonwebtoken, PostgreSQL
- Endpoints:
/auth/register,/auth/login,/auth/refresh,/auth/me,/auth/logout - Security: Rate limiting (20 req/15min), bcrypt cost factor 12, JWT token rotation
- First user automatically gets
adminrole
CMS Service (nexus-cms)
- Stack: Express.js, MongoDB
- Endpoints:
/health,/status - Purpose: Headless content management for dynamic content
CDN Service (nexus-cdn)
- Stack: Express.js
- Endpoints:
/health,/status - Purpose: Static asset delivery and optimization
Cache Service (nexus-cache)
- Stack: Express.js, Redis, Memcached
- Endpoints:
/health,/status - Dependencies: Redis (primary), Memcached (secondary)
- Purpose: Multi-tier distributed caching
WAF Service (nexus-waf)
- Stack: Express.js
- Endpoints:
/health,/status - Purpose: Web application firewall rules and request filtering
AI Gateway (nexus-ai)
- Stack: Express.js
- Endpoints:
/health,/status - Purpose: Proxy and rate-limit requests to Claude API
MCP Server (nexus-mcp)
- Stack: Express.js,
@modelcontextprotocol/sdk - Endpoints:
POST /mcp,/health - Auth: Cloudflare Service Token validation
- Tools: 8 tools across containers, services, and logs modules
- Transport: StreamableHTTPServerTransport with JSON response mode
Grafana (nexus-grafana)
- Image:
grafana/grafana:latest - Auth: Admin password via
GRAFANA_PASSWORDenv var - Data source: Prometheus at
nexus-prometheus:9090 - Dashboards: Container resources, API metrics, database performance, cache hit rates