ChatFlow Platform - Setup Guide β
Prerequisite: The
shared-infrastack must be running before starting ChatFlow services. It provides PostgreSQL (shared-postgres:5432, databasechatflow), Redis (shared-redis:6379, DB=1), and MailHog (shared-mailhog:1025) on theshared-infraDocker network.
π Overview β
This is the meta repository for the ChatFlow platform. It contains references to all service repositories as git submodules, along with infrastructure, documentation, and orchestration files.
ποΈ Repository Structure β
ChatFlowPlatform/
βββ ChatFlow/ # β Main platform repo (this repo)
β βββ chatflow-identity-api/ # Auth service
β βββ chatflow-conversation-api/ # Chat/conversation service
β βββ chatflow-gateway-api/ # YARP API gateway
β βββ chatflow-ai-service/ # Python AI service
β βββ chatflow-admin-portal/ # Angular admin UI
β βββ chatflow-user-portal/ # Angular user UI
β βββ infrastructure/ # Database schemas, configs
β βββ docs/ # Platform documentation
β βββ scripts/ # Setup and utility scripts
β βββ docker-compose.yml # Orchestration for all services
β
βββ chatflow-sdks/ # Separate public repo β https://github.com/ChatFlowPlatform/chatflow-sdks
βββ angular/ # Angular SDK
βββ react/ # React SDK
βββ javascript/ # Vanilla JS SDK
βββ python/ # Python SDK
βββ dotnet/ # .NET SDK
βββ flutter/ # Flutter SDK
βββ swift/ # Swift SDK
βββ widget/ # Embeddable web widgetπ Quick Start β
Option 1: Clone Everything (Recommended for New Users) β
# Clone the platform with all submodules
git clone --recursive https://github.com/ChatFlowPlatform/chatflow-platform.git
cd chatflow-platform
# Copy environment file
cp .env.example .env
# Edit .env with your configuration
# Start all services
docker-compose up -dOption 2: Use Existing Separate Repos β
If you already have the service repos cloned separately (like your current setup):
cd chatflow-platform
# Initialize submodules to create the nested structure
git submodule update --init --recursive
# The submodules now reference the GitHub versions
# Your separate repos remain independentπ Working with Submodules β
Update Submodules to Latest β
# Update all submodules
git submodule update --remote --merge
# Update specific submodule
git submodule update --remote --merge chatflow-identity-apiMake Changes in a Submodule β
# Navigate to submodule
cd chatflow-identity-api
# Make changes, commit as normal
git add .
git commit -m "Your changes"
git push origin main
# Go back to platform repo
cd ..
# Commit the submodule reference update
git add chatflow-identity-api
git commit -m "Update identity-api submodule"
git pushPull Latest Including Submodules β
# Pull platform changes and update all submodules
git pull --recurse-submodulesπ³ Docker Compose β
The docker-compose.yml file orchestrates all services:
- Infrastructure: PostgreSQL, Redis (also used as message queue via Redis Streams), Cloudflare R2 (object storage)
- Backend Services: Gateway, Auth, Chat, AI
- Monitoring: Prometheus, Grafana (optional)
# Start all services
docker-compose up -d
# View logs
docker-compose logs -f
# Stop all services
docker-compose down
# Rebuild specific service
docker-compose up -d --build auth-serviceπ Service URLs β
Once running, services are available at:
- API Gateway: http://localhost:5000
- Auth Service: http://localhost:5001
- Chat Service: http://localhost:5002
- AI Service: http://localhost:8000
- PostgreSQL: shared-postgres:5432 (via shared-infra network)
- Redis: shared-redis:6379 DB=1 (via shared-infra network)
- Cloudflare R2: managed via Cloudflare dashboard (dash.cloudflare.com/r2)
π¦ Independent Service Development β
Each service can also be developed independently:
# Work on a service outside the platform repo
cd ../chatflow-identity-api
dotnet run
# Or use the submodule inside platform
cd chatflow-platform/chatflow-identity-api
dotnet runπ§ͺ Running Tests β
# Test from submodule
cd chatflow-platform/chatflow-identity-api/tests
dotnet test
# Test from standalone repo
cd ../chatflow-identity-api/tests
dotnet testπ Environment Variables β
Copy .env.example to .env and configure:
# Shared infrastructure credentials (must match shared-infra stack)
POSTGRES_PASSWORD=changeme123
REDIS_PASSWORD=changeme
# JWT
JWT_SECRET=your-super-secret-jwt-key-min-32-chars
# AI Services
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...π Documentation β
- README.md - Platform overview
- ARCHITECTURE.md - System architecture
- CONTRIBUTING.md - Contribution guidelines
- QUICKSTART.md - Quick start guide
π€ Contributing β
- Each service repository has its own contribution guidelines
- For infrastructure/platform-wide changes, create PRs to this repo
- Service-specific changes go to individual service repos
π Common Issues β
Submodules are empty β
git submodule update --init --recursiveSubmodule detached HEAD β
cd chatflow-identity-api
git checkout main
cd ..Update submodule to specific commit β
cd chatflow-identity-api
git checkout <commit-hash>
cd ..
git add chatflow-identity-api
git commit -m "Update submodule to specific version"π― Key Benefits of This Setup β
β
Centralized Overview - Clone one repo to get everything
β
Independent Development - Each service has its own repo
β
Version Control - Platform repo tracks specific submodule versions
β
Easy Orchestration - Single docker-compose for entire stack
β
Flexible Deployment - Deploy individual services or full platform
Need help? Check individual service READMEs or open an issue on GitHub.