DAARION Deployment Overview¶
Version: 1.0.0
Phase: INFRA β All-in-One Gateway
Last Updated: 24 Π»ΠΈΡΡΠΎΠΏΠ°Π΄Π° 2025
π― Architecture Overview¶
DAARION uses a microservices architecture with a single NGINX gateway as the entry point.
βββββββββββββββββββ
β Internet β
ββββββββββ¬βββββββββ
β
ββββββββββΌβββββββββ
β NGINX Gateway β
β (Port 80/443) β
ββββββββββ¬βββββββββ
β
βββββββββββββββββββββΌββββββββββββββββββββ
β β β
ββββββΌββββββ βββββββΌβββββββ ββββββββΌββββββ
β Frontend β β API Routes β β WebSockets β
β (SPA) β β /api/* β β /ws/* β
ββββββββββββ βββββββ¬βββββββ ββββββββ¬ββββββ
β β
ββββββββββββββββΌβββββββββββββββ¬βββββ
β β β
βββββββββΌβββββββ βββββΌβββββββββ ββββΌββββββββββ
β Auth Service β βDAO Service β βLiving Map β
β :7011 β β :7016 β β :7017 β
ββββββββ¬ββββββββ βββββ¬βββββββββ ββββ¬ββββββββββ
β β β
ββββββββββββββββΌβββββββββββββββ
β
ββββββββββΌβββββββββββ
β PostgreSQL :5432 β
β NATS :4222 β
β Redis :6379 β
βββββββββββββββββββββ
π¦ Services Stack¶
Infrastructure Services (4)¶
- PostgreSQL β Database
- Redis β Cache & Sessions
- NATS β Message Bus (JetStream)
- Matrix Synapse β Chat server
Core Services (4)¶
- auth-service (7011) β Authentication (Passkey)
- pdp-service (7012) β Authorization (PDP)
- usage-engine (7013) β Metrics & Usage tracking
- messaging-service (7004) β Messenger API
Agent Infrastructure (6)¶
- agent-runtime (7010) β Agent execution
- agent-filter (7005) β Request filtering
- dagi-router (7006) β Routing logic
- llm-proxy (7007) β LLM provider proxy
- memory-orchestrator (7008) β Memory management
- toolcore (7009) β Tool execution
Application Services (6)¶
- agents-service (7014) β Agent Hub (Phase 6)
- microdao-service (7015) β MicroDAO Console (Phase 7)
- dao-service (7016) β DAO Dashboard (Phase 8)
- living-map-service (7017) β Living Map (Phase 9)
- city-service (7001) β City layer
- space-service (7002) β Space layer
Frontend & Gateway (2)¶
- frontend (nginx:80) β React SPA
- gateway (nginx:80/443) β Reverse proxy
Total: 23 services behind a single gateway
π API Routes¶
All services are accessible through the gateway at /api/*:
| Service | External Route | Internal URL |
|---|---|---|
| Auth | /api/auth/ |
http://auth-service:7011/ |
| PDP | /api/pdp/ |
http://pdp-service:7012/ |
| Usage | /api/usage/ |
http://usage-engine:7013/ |
| Agents | /api/agents/ |
http://agents-service:7014/ |
| MicroDAO | /api/microdao/ |
http://microdao-service:7015/ |
| DAO | /api/dao/ |
http://dao-service:7016/ |
| Living Map | /api/living-map/ |
http://living-map-service:7017/living-map/ |
| Messaging | /api/messaging/ |
http://messaging-service:7004/ |
| City | /api/city/ |
http://city-service:7001/api/city/ |
| Space | /api/space/ |
http://space-service:7002/api/space/ |
WebSocket Routes¶
| Service | External Route | Internal URL |
|---|---|---|
| Living Map | /ws/living-map/ |
ws://living-map-service:7017/living-map/stream |
| Agents Events | /ws/agents/ |
ws://agents-service:7014/ws/agents/stream |
| Messaging | /ws/messaging/ |
ws://messaging-service:7004/ws |
π Quick Start (Local Development)¶
Prerequisites¶
- Docker & Docker Compose
- Node.js 18+
- PostgreSQL client (psql)
1. Build Frontend¶
npm install
npm run build
2. Start All Services¶
./scripts/start-all.sh
This will: - Apply database migrations (001-010) - Build all Docker images - Start all services - Configure NGINX gateway
3. Access¶
- Frontend: http://localhost
- API: http://localhost/api/
- Health: http://localhost/health
4. Stop Services¶
./scripts/stop-all.sh
π Project Structure¶
daarion/
βββ docker-compose.all.yml # All-in-one compose
βββ Dockerfile.frontend # Frontend build
βββ nginx/
β βββ all-in-one.conf # Gateway config
β βββ frontend.conf # Frontend nginx
βββ scripts/
β βββ start-all.sh # Start script
β βββ stop-all.sh # Stop script
βββ services/
β βββ auth-service/
β βββ dao-service/
β βββ living-map-service/
β βββ ... (20+ services)
βββ migrations/
β βββ 001_create_users_and_auth.sql
β βββ ...
β βββ 010_create_living_map_tables.sql
βββ src/ # Frontend source
π Security¶
Authentication¶
- Passkey (WebAuthn) for users
- Internal tokens for service-to-service
Authorization¶
- PDP (Policy Decision Point) for all requests
- Role-based access control (RBAC)
- Resource-level permissions
Network¶
- All services in private network
- Only gateway exposed to internet
- No direct service access from outside
π Monitoring & Logs¶
View Logs¶
# All services
docker-compose -f docker-compose.all.yml logs -f
# Specific service
docker-compose -f docker-compose.all.yml logs -f gateway
docker-compose -f docker-compose.all.yml logs -f living-map-service
Health Checks¶
- Gateway: http://localhost/health
- Individual services: Health checks in docker-compose
Metrics¶
- Usage Engine collects all LLM/Agent metrics
- Available through
/api/usage/
π§ Configuration¶
Environment Variables¶
All services use:
- DATABASE_URL β PostgreSQL connection
- NATS_URL β NATS connection
- REDIS_URL β Redis connection
- Service-specific URLs (e.g., AUTH_SERVICE_URL)
Volumes¶
postgres_dataβ Database persistencenats_dataβ NATS JetStream storageredis_dataβ Redis persistencematrix_dataβ Matrix Synapse data
π Troubleshooting¶
Services not starting¶
# Check logs
docker-compose -f docker-compose.all.yml logs
# Check specific service
docker-compose -f docker-compose.all.yml ps
Database connection issues¶
# Check if postgres is healthy
docker-compose -f docker-compose.all.yml ps postgres
# Connect to postgres
docker exec -it daarion-postgres psql -U postgres -d daarion
Frontend not loading¶
# Rebuild frontend
npm run build
# Restart gateway
docker-compose -f docker-compose.all.yml restart gateway
API routes not working¶
- Check nginx config:
nginx/all-in-one.conf - Check if service is running:
bash docker-compose -f docker-compose.all.yml ps [service-name] - Check service logs
π Scaling¶
Horizontal Scaling¶
For production, you can scale services:
docker-compose -f docker-compose.all.yml up -d --scale living-map-service=3
Load Balancing¶
Update nginx config to use multiple backends:
upstream living_map_service {
server living-map-service-1:7017;
server living-map-service-2:7017;
server living-map-service-3:7017;
}
π Production Deployment¶
See DEPLOY_ON_SERVER.md for: - Server setup - Domain configuration - SSL/TLS certificates - Environment variables - Backup strategy
π Related Documentation¶
- Infrastructure:
INFRASTRUCTURE.md - Quick Reference:
docs/infrastructure_quick_ref.ipynb - Phase 9A:
PHASE9A_BACKEND_READY.md - Phase 9B:
PHASE9B_LITE_2D_READY.md - Server Deployment:
DEPLOY_ON_SERVER.md
π DAARION β Unified Gateway Ready!