Files
blackroad-operating-system/backend/docker-compose.yml
Claude 5da6cc9d23 Add comprehensive FastAPI backend for BlackRoad OS
This commit adds a complete backend infrastructure with:

**Core Infrastructure:**
- FastAPI application with async/await support
- PostgreSQL database with SQLAlchemy ORM
- Redis caching layer
- JWT authentication and authorization
- Docker and Docker Compose configuration

**API Services:**
- Authentication API (register, login, JWT tokens)
- RoadMail API (email service with folders, send/receive)
- BlackRoad Social API (posts, comments, likes, follows)
- BlackStream API (video streaming with views/likes)
- File Storage API (file explorer with upload/download)
- RoadCoin Blockchain API (mining, transactions, wallet)
- AI Chat API (conversations with AI assistant)

**Database Models:**
- User accounts with wallet integration
- Email and folder management
- Social media posts and engagement
- Video metadata and analytics
- File storage with sharing
- Blockchain blocks and transactions
- AI conversation history

**Features:**
- Complete CRUD operations for all services
- Real-time blockchain mining with proof-of-work
- Transaction validation and wallet management
- File upload with S3 integration (ready)
- Social feed with engagement metrics
- Email system with threading support
- AI chat with conversation persistence

**Documentation:**
- Comprehensive README with setup instructions
- API documentation (Swagger/ReDoc auto-generated)
- Deployment guide for multiple platforms
- Testing framework with pytest

**DevOps:**
- Docker containerization
- Docker Compose for local development
- Database migrations with Alembic
- Health check endpoints
- Makefile for common tasks

All APIs are production-ready with proper error handling,
input validation, and security measures.
2025-11-16 06:39:16 +00:00

70 lines
1.6 KiB
YAML

version: '3.8'
services:
# PostgreSQL Database
postgres:
image: postgres:15-alpine
container_name: blackroad_postgres
environment:
POSTGRES_USER: blackroad
POSTGRES_PASSWORD: password
POSTGRES_DB: blackroad_db
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U blackroad"]
interval: 10s
timeout: 5s
retries: 5
# Redis Cache
redis:
image: redis:7-alpine
container_name: blackroad_redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 5
# FastAPI Backend
backend:
build: .
container_name: blackroad_backend
environment:
DATABASE_URL: postgresql://blackroad:password@postgres:5432/blackroad_db
DATABASE_ASYNC_URL: postgresql+asyncpg://blackroad:password@postgres:5432/blackroad_db
REDIS_URL: redis://redis:6379/0
SECRET_KEY: ${SECRET_KEY:-your-secret-key-change-this}
ENVIRONMENT: ${ENVIRONMENT:-development}
DEBUG: ${DEBUG:-True}
ports:
- "8000:8000"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
volumes:
- ./app:/app/app
command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
# Adminer (Database Admin UI)
adminer:
image: adminer:latest
container_name: blackroad_adminer
ports:
- "8080:8080"
depends_on:
- postgres
volumes:
postgres_data:
redis_data: