Documentation Index
Fetch the complete documentation index at: https://docs.spn.wtf/llms.txt
Use this file to discover all available pages before exploring further.
Deployment
SPN uses Docker Compose with Caddy for production deployment.
Architecture
┌────────────────────────────────────────┐
│ Caddy (Reverse Proxy) │
│ Routes /api/* → Backend │
│ Routes /* → Frontend │
└───────────────┬────────────────────────┘
│
┌────────┴────────┐
▼ ▼
┌─────────────┐ ┌─────────────┐
│ Backend │ │ Frontend │
│ (FastAPI) │ │ (Static) │
└─────────────┘ └─────────────┘
│
▼
┌─────────────┐
│ PostgreSQL │
└─────────────┘
Prerequisites
- Docker & Docker Compose
- Domain name (for SSL)
- Server with 2GB+ RAM
Quick Deploy
cd ~/spn
git pull
bash deploy.sh
Manual Deployment
1. Build and Start
docker-compose up -d --build
2. Run Migrations
docker-compose exec api alembic upgrade head
3. Verify
curl https://your-domain.com/api/v1/system/health
Environment Variables
Configure in .env:
# Production values
POSTGRES_SERVER=db
POSTGRES_PASSWORD=secure-password
SESSION_SECRET=production-secret
# Production URLs
FRONTEND_URL=https://your-domain.com
CORS_ORIGINS=https://your-domain.com
Services
| Service | Port | Description |
|---|
| API | 8000 | FastAPI backend |
| PostgreSQL | 5432 | Database |
SSL
Caddy automatically provisions Let’s Encrypt SSL.
Troubleshooting
View logs
docker-compose logs -f api
docker-compose logs -f frontend
Restart services
docker-compose restart api
Database issues
docker-compose exec db psql -U postgres -d spn_db