Skip to content

ChatFlow Platform - Setup Guide ​

Prerequisite: The shared-infra stack must be running before starting ChatFlow services. It provides PostgreSQL (shared-postgres:5432, database chatflow), Redis (shared-redis:6379, DB=1), and MailHog (shared-mailhog:1025) on the shared-infra Docker 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 ​

powershell
# 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 -d

Option 2: Use Existing Separate Repos ​

If you already have the service repos cloned separately (like your current setup):

powershell
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 ​

powershell
# Update all submodules
git submodule update --remote --merge

# Update specific submodule
git submodule update --remote --merge chatflow-identity-api

Make Changes in a Submodule ​

powershell
# 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 push

Pull Latest Including Submodules ​

powershell
# 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)
powershell
# 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:

πŸ“¦ Independent Service Development ​

Each service can also be developed independently:

powershell
# 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 ​

powershell
# 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:

bash
# 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 ​

🀝 Contributing ​

  1. Each service repository has its own contribution guidelines
  2. For infrastructure/platform-wide changes, create PRs to this repo
  3. Service-specific changes go to individual service repos

πŸ†˜ Common Issues ​

Submodules are empty ​

powershell
git submodule update --init --recursive

Submodule detached HEAD ​

powershell
cd chatflow-identity-api
git checkout main
cd ..

Update submodule to specific commit ​

powershell
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.

Embed AI-powered live chat into any product.