Documentation
Explore the core architectural principles, contribution guidelines, and system design of ClubCRM.
ClubCRM
ClubCRM is a devcontainer-first monorepo for a club management platform with:
- Next.js web app
- FastAPI API
- PostgreSQL for relational data
- MongoDB for document-style form submissions
- Redis for caching and short-lived data
- Kafka as the intended async event boundary, with current publishers still scaffolded
Current implementation status:
apps/webnow provides a UI-first MVP:/sends authorized users to/dashboard, authenticated-but-unprovisioned users to/not-provisioned, and everyone else to/login; admin pages live undersrc/app/(app), protected system pages live undersrc/app/system, public entry points live undersrc/app/(public), and auth proxy handlers live at/api/auth/loginand/auth/callback- the frontend currently includes dashboard, profile, audit, club and member directory/detail pages, club and member creation and update flows, roster assignment plus event and announcement management from club detail, public join-request submission plus club-level join-request review, a
/loginroute that hands off to backend-owned auth, and a dedicated/system/healthdiagnostics route apps/apinow includes bootstrap, config, infrastructure, module, and test layers, with live routes for system health, backend-owned auth, audit logs, dashboard summaries, clubs, members, memberships, announcements, events, and join-request flows- the admin route group now checks the backend session before rendering and serves a role-aware shell for organization admins and club managers
- the repo also includes a public
/demo/failoverroute plus a companion monitoring stack underapps/monitor-apiandapps/monitor-webfor the networking demo, kept intentionally outside the main ClubCRM app pair - the local data and app stack is wired up through the repository devcontainer
Current networking-demo deployment as of April 18, 2026:
- replacement cluster control-plane nodes:
Server1->100.122.118.85,Server2->
100.67.65.5, Server3 -> 100.99.187.90
- monitoring host VM:
DemoControlPlaneServer->192.168.139.213 - shared ingress hosts:
clubcrm.local,kubero.local
Development Environment
All development is expected to happen inside the repository devcontainer.
The Compose stack loads defaults from .env.example. If you need to override any local settings, create a root .env before opening the devcontainer:
cp .env.example .envIf you do not create .env, the checked-in example values are used automatically. Then open the repository in the devcontainer. The devcontainer uses:
infra/docker-compose.yml.devcontainer/docker-compose.devcontainer.yml.devcontainer/docker-compose.ports.ymlgenerated during startup
The repository enforces LF line endings for devcontainer and workflow files so the same checkout works on macOS and Windows hosts. Devcontainer startup no longer depends on host-specific wrapper scripts, so you should not need any host-side normalization step just to open the environment.
When the devcontainer starts, it:
- generates
.devcontainer/docker-compose.ports.ymlwith the first available host port for each required service - mounts the repository at
/workspace - starts the
workspace,web,api,postgres,mongodb,redis, andkafkaservices - runs the devcontainer
postCreateCommand(python3 ./scripts/bootstrap.py) - bootstraps dependencies with
pnpm bootstrap, which prefersuvfor API Python packages and falls back to the virtualenv'spipwhenuvis unavailable - exposes localhost TCP proxies inside the attached
workspacecontainer so editor-driven forwarding from127.0.0.1reaches the siblingweb,api, and data services
To keep local I/O fast on bind-mounted workspaces, the devcontainer persists the PNPM store, workspace
node_modules, web node_modules, web .next, and the API virtualenv in Docker volumes. The api
and web services also wait for their dependencies to report healthy before they start.
Available services:
workspacewebapipostgresmongodbrediskafka
Forwarded ports:
3000or the next available port for web8000or the next available port for api5432or the next available port for postgres27017or the next available port for mongodb6379or the next available port for redis9092or the next available port for kafka
If a default host port is already in use, the devcontainer remaps that service to the next free port such as 3001. The resolved host-port bindings are written to .devcontainer/docker-compose.ports.yml during startup.
The web and api development servers are already started by the devcontainer Compose stack. Use the root scripts below only when you intentionally restart a service from the workspace terminal, run checks manually, or debug outside the default process.
The repository now tracks a minimal VS Code workspace setting and Tailwind CSS custom-data file so Tailwind v4 directives used in `apps/web/src/app/globals.css` do not show false "unknown at rule" diagnostics in editors that use the VS Code CSS language service.
Quality Checks
From inside the devcontainer workspace:
Bootstrap dependencies and install Git hooks again if needed:
pnpm bootstrapThe root pnpm scripts are the cross-platform contract. They resolve the right Python launcher and virtualenv paths for the current OS, so prefer them over calling .venv/bin/... or app runtimes directly.
They also do not require a separate host-side uv install just to bootstrap the API environment.
Run all configured Git hooks manually:
pnpm precommit:allRun repository checks locally:
pnpm verifyFor backend-only sanity checks, pnpm check:api currently bytecode-compiles apps/api/src. Use
pnpm lint:api and pnpm format:api:check for Ruff-based lint and formatting checks.
Manual app entrypoints:
pnpm dev:web
pnpm dev:api
pnpm devThese commands are for manual restart or debugging from the devcontainer terminal. They are not required for the normal first-run workflow because the devcontainer already starts the app services.
In the current devcontainer workflow, the web development server uses next dev --webpack to avoid a Tailwind/Turbopack workspace resolution issue during local startup. Production builds still use next build.
The API development server now limits reload watching to apps/api/src, runs Alembic migrations before startup, and forces polling so Windows-hosted devcontainers and WSL-backed file mounts stay more reliable during startup and code reloads.
Git Workflow
Use Git with a simple default: one logical change per branch and one focused pull request per branch.
- Create a new branch for each feature, bug fix, non-trivial refactor, docs or workflow update, or cross-app API contract change.
- Keep unrelated work out of the same branch, even inside this monorepo.
- If a change touches both
apps/webandapps/apibut is still one coherent feature or contract update, keep it in one branch and one pull request. - If you are changing setup, ports, service assumptions, repo structure, or the diagnostics and health-check flow, isolate that work in its own branch and update docs in the same pull request.
Commits are checkpoints inside a branch. Prefer a few small, descriptive commits over one large mixed-purpose commit.
- Separate refactors from behavior changes when practical.
- Keep commit messages specific to the actual change.
- Group related documentation updates with the behavior or workflow change they explain unless the docs work is large enough to stand on its own.
Before opening a pull request, run the narrowest relevant checks from the repository root and include a short verification summary in the pull request description.
Docs
AGENTS.mdfor repo-wide agent and contributor guardrailsdocs/README.mdfor a categorized map of the project documentationapps/web/README.mdfor frontend-specific runtime and environment notesapps/api/README.mdfor backend structure and route notesdocs/contributing.mdfor contribution workflow and code standardsdocs/architecture.mdfor system structure and local environment rulesdocs/schema.mdfor data modeling notesdocs/decisions.mdfor architecture decisionsdocs/guides/module-implementation-flow.mdfor step-by-step guidance on growing a module or feature slicedocs/guides/live-site-testing.mdfor manual smoke testing on the live production sitedocs/guides/postgresql-implementation-flow.mdfor relational system-of-record implementation guidancedocs/guides/mongodb-implementation-flow.mdfor document-store implementation guidancedocs/guides/redis-implementation-flow.mdfor caching and short-lived data implementation guidancedocs/guides/kafka-implementation-flow.mdfor async event publication implementation guidancedocs/plans/team-execution-plan.mdfor scope and ownership guidancedocs/plans/networking-team-execution-plan.mdfor the companion networking workstreamdocs/deployment/ssh-docker-deploy.mdfor the current SSH-based VM deployment pathdocs/deployment/companion-monitoring-stack.mdfor the companion monitoring stack architecture and data flowdocs/deployment/current-longhorn-implementation.mdfor the current Longhorn implementation, live-cluster status, and broken piecesdocs/deployment/monitoring-stack.mdfor the separate networking-demo monitoring stackdocs/deployment/k3s-kubero-longhorn.mdfor the networking-final cluster rolloutdocs/analysis/current-project-structure-analysis.mdfor a detailed review of the repo's current shapedocs/plans/anddocs/proposals/for historical course-planning context