Status: COMPLETED. The monorepo was successfully separated into independent repositories. This document is retained for historical reference.
The Forail platform currently resides in a single monorepo. This plan defines the separation into 5 independent repositories connected through CI/CD pipelines.
forail-platform/
├── forail-backend ← Django API + Task Engine + Celery
├── forail-frontend ← React UI (Vite + Tailwind)
├── forail-devops ← Docker, Compose, Nginx, CI/CD, infra
├── forail-assistant ← Ollama + ChromaDB RAG (future)
└── forail-mobile ← Android/iOS app (future)
Repo: forail-platform/forail-backend
| Source (current monorepo) | Destination in new repo |
|---|---|
forail/ (Python package) |
forail/ |
forail/main/, forail/api/, forail/conf/, forail/sso/ |
Same |
forail/settings/ |
forail/settings/ |
manage.py |
manage.py |
requirements/ |
requirements/ |
tools/ (management scripts) |
tools/ |
setup.cfg, setup.py, pyproject.toml |
Root |
docs/wiki/02-backend-django.mddocs/wiki/04-task-engine.mddocs/wiki/05-authentication-rbac.mddocs/wiki/06-database-schema.mddocs/wiki/09-testing-guide.md(Python section)docs/wiki/11-api-reference.mddocs/wiki/12-configuration-reference.md
# .gitlab-ci.yml
stages:
- lint # flake8
- test # pytest (unit + functional)
- build # Docker image (forail-backend:tag)
- security # pip-audit, trivy
- publish # Push image to registry- Docker image:
ghcr.io/forail-platform/forail-backend:<version> - API documentation (auto-generated)
Repo: forail-platform/forail-frontend
| Source (current monorepo) | Destination in new repo |
|---|---|
src/ (React application) |
src/ |
public/ |
public/ |
index.html |
index.html |
package.json, package-lock.json |
Root |
vite.config.ts |
Root |
tailwind.config.ts |
Root |
tsconfig.json, tsconfig.*.json |
Root |
postcss.config.js |
Root |
.eslintrc.* |
Root |
docs/wiki/03-frontend-react.mddocs/wiki/09-testing-guide.md(Frontend section)
# .gitlab-ci.yml
stages:
- lint # tsc --noEmit, eslint
- test # vitest
- build # vite build → static bundle
- publish # Upload artifact or Docker image with nginx- Build folder (
dist/) — static files - Optional Docker image:
ghcr.io/forail-platform/forail-frontend:<version>(nginx + static files)
- API URL is configured via environment variable (
VITE_API_URL) - Frontend builds independently from the backend
- Proxy configuration in
vite.config.tsfor development
Repo: forail-platform/forail-devops
| Source (current monorepo) | Destination in new repo |
|---|---|
Dockerfile, Dockerfile.* |
docker/ |
docker-compose.yml |
Root |
nginx/ configuration |
nginx/ |
Vagrantfile |
vagrant/ |
| Deployment scripts | scripts/ |
| SSL/TLS configuration | ssl/ |
docs/wiki/01-architecture-overview.mddocs/wiki/07-docker-deployment.mddocs/wiki/08-ci-cd-pipeline.mddocs/wiki/10-contributing-guide.mddocs/ci-pipeline-reference.mddocs/startrun.mddocs/RELEASE_NOTES_*.mddocs/future_development_plan.md
forail-devops/
├── docker/
│ ├── Dockerfile.backend # Multi-stage for backend
│ ├── Dockerfile.frontend # Multi-stage for frontend (nginx)
│ └── Dockerfile.assistant # Ollama + RAG (future)
├── docker-compose.yml # Production stack
├── docker-compose.dev.yml # Development stack
├── nginx/
│ ├── nginx.conf
│ └── forail.conf
├── ssl/
│ └── letsencrypt.sh
├── scripts/
│ ├── backup.sh
│ ├── restore.sh
│ ├── health-check.sh
│ └── init.sh
├── vagrant/
│ └── Vagrantfile
├── docs/
│ └── (all deployment documentation)
├── .env.example
└── README.md
services:
postgres:
image: postgres:15
redis:
image: redis:7
forail-backend:
image: ghcr.io/forail-platform/forail-backend:${VERSION}
forail-frontend:
image: ghcr.io/forail-platform/forail-frontend:${VERSION}
forail-task:
image: ghcr.io/forail-platform/forail-backend:${VERSION} # same image, different entrypoint
nginx:
# reverse proxy → frontend + backend APIThe forail-devops repo is the "glue" that:
1. Pulls backend and frontend image versions
2. Defines how to deploy to the server
3. Contains docker-compose for production
4. Contains backup/restore scripts
5. Contains health check and monitoring configuration
Repo: forail-platform/forail-assistant
forail-assistant/
├── app/
│ ├── main.py # FastAPI/Django app
│ ├── ollama_client.py # Ollama LLM integration
│ ├── rag/
│ │ ├── indexer.py # ChromaDB document indexing
│ │ └── retriever.py # RAG retrieval
│ └── api/
│ └── assistant.py # /api/v2/assistant/ endpoint
├── documents/ # Documents for RAG indexing
├── Dockerfile
├── requirements.txt
├── docker-compose.yml # Ollama + ChromaDB + Assistant
└── docs/
└── chat_plan.md
- Exposes an API consumed by the frontend (
/api/v2/assistant/) - SSE streaming for real-time responses
- ChromaDB for vector search over documentation
- Ollama for LLM inference (local, no cloud dependency)
Repo: forail-platform/forail-mobile
forail-mobile/
├── android/
│ ├── app/src/main/kotlin/ # Kotlin + Jetpack Compose
│ └── build.gradle.kts
├── backend/ # Go API for mobile-specific features
│ ├── cmd/server/main.go
│ ├── internal/
│ │ ├── auth/ # JWT + biometric verification
│ │ ├── push/ # FCM push notifications
│ │ └── approval/ # Deployment approval flow
│ └── go.mod
├── docs/
│ └── mobile_plan.md
└── .github/workflows/ # Android build + Go build
- All repos use CalVer:
YYYY.MM.PATCH(e.g.,2026.03.1) - Git tags trigger the release pipeline
forail-devopsreferences versions from other repos
1. Developer pushes code to forail-backend or forail-frontend
2. That repo's CI:
- lint → test → build → security → publish Docker image
3. forail-devops is updated with the new version:
- Manual: update VERSION in .env or docker-compose.yml
- Automatic: webhook/trigger that updates the version
4. Deploy to server:
- git pull forail-devops
- docker compose pull
- docker compose up -d
┌──────────────┐ ┌───────────────┐ ┌──────────────┐
│ forail-backend│ │ forail-frontend│ │forail-assistant│
│ (Django) │ │ (React) │ │ (Ollama) │
└──────┬───────┘ └──────┬────────┘ └──────┬───────┘
│ publish │ publish │ publish
▼ ▼ ▼
┌─────────────────────────────────────────────────────────┐
│ Harbor Registry (ghcr.io) │
│ ghcr.io/forail-platform/forail-backend ghcr.io/forail-platform/forail-frontend forail-platform/... │
└─────────────────────────┬───────────────────────────────┘
│ pull
▼
┌───────────────────────┐
│ forail-devops │
│ docker-compose.yml │
│ nginx, ssl, scripts │
└───────────┬───────────┘
│ deploy
▼
┌───────────────────────┐
│ Production Server │
└───────────────────────┘
| Step | Action | Priority |
|---|---|---|
| 1 | Create forail-frontend repo, extract React code |
High |
| 2 | Create forail-backend repo, extract Django code |
High |
| 3 | Create forail-devops repo, define Docker Compose |
High |
| 4 | Set up CI/CD for each repo | High |
| 5 | Test end-to-end with separate images | High |
| 6 | Create forail-assistant repo |
Medium |
| 7 | Create forail-mobile repo |
Low |
- Use
git filter-branchorgit subtree splitto preserve history - Update all references and paths
- Verify that each repo independently passes CI
- GitLab CI for each repo
- Harbor registry publish for each repo
forail-devopsorchestration
- Per
chat_plan.mdandmobile_plan.mdtimelines
- Monorepo remains as archive — the current
awxrepo is kept in read-only mode as a reference - Documentation is split — each repo gets its relevant documentation
- Shared wiki —
forail-devopscontains the architectural overview and links to all repositories - Docker images are the only artifact — repos do not depend on each other directly, only via Docker images
- Environment variables — all inter-service configuration goes through env variables (12-factor app principle)