How douglasymlai/test works
Project type and purpose
• This is a monorepo full-stack web application (“MCP Hub”) composed of:
• A Python FastAPI backend (REST API + business logic + database migrations + tests)
• A TypeScript/React frontend (Refine + Vite + Shadcn UI + Playwright tests)
• A PostgreSQL database (via Supabase for realtime, auth, storage)
• Docker-Compose orchestration for local development
File structure
• Top-level services:
• /backend – FastAPI app with app/api, app/core, crud.py, models.py, Alembic migrations, scripts & tests
• /frontend – React/Refine UI with generated OpenAPI client, components, routes, theme, tests
• /supabase – Supabase config for local Postgres + realtime/auth/storage
• docker-compose.yml + overrides – orchestrate “backend”, “frontend”, “supabase” profiles
• /scripts – CI/CD, build, deploy, client-generation, test helpers
• Key patterns: layered backend (API → core → DB), auto-generated client SDK, containerized services
README for additional insights
• Tech stack confirms FastAPI + SQLModel + Pydantic + PostgreSQL + Supabase
• Frontend uses Refine + Vite + React + Shadcn UI + Playwright
• Auth: StackAuth + Supabase
• Local dev: Docker Compose profiles for backend, frontend, Supabase
a. Main components
• Browser (User’s UI)
• Frontend Container (React/Refine app)
• API Gateway / Backend Container (FastAPI app)
• PostgreSQL Database (hosted by Supabase)
• Supabase Real-time & Auth service
• External Auth provider (StackAuth, if separate)
• CI/CD & Deployment (Dokploy) – optional, for end-to-end flow
b. Relationships & interactions
1. User ↔ Browser – interacts with frontend UI
2. Browser → Frontend – HTTP(S) requests; fetch UI assets via Nginx or Vite dev server
3. Frontend → Backend API – REST calls (CRUD, auth) using generated OpenAPI client
4. Backend → Database – SQLModel ORM queries to PostgreSQL
5. Backend ↔ Supabase – realtime subscriptions, file storage, auth management
6. Backend → External Auth (StackAuth) – user login/registration flows
7. CI/CD pipelines → Deployment – Docker images → Dokploy
c. Architectural patterns & design principles
• Layered backend:
– API layer (app/api/routes)
– Core services (app/core, crud.py, models.py)
– Data layer (PostgreSQL + Alembic migrations)
• Client SDK generation: openapi-ts to keep frontend types in sync
• Containerization: each service in its own Dockerfile + Docker Compose profiles
• Supabase for offloading realtime and auth/storage concerns
d. Technologies & frameworks
• FastAPI, SQLModel, Pydantic, Alembic (backend)
• React + Refine + Vite + TypeScript + Shadcn UI (frontend)
• PostgreSQL, Supabase (DB & realtime + auth + storage)
• Docker Compose, Dockerfiles (orchestration & containers)
• Playwright, Pytest (testing)
• Dokploy (deployment)