Developer
These pages are for maintainers and contributors. They explain WG Free Mesh internals, module boundaries, and collaboration rules.
If you only want to deploy and use the system, start with Guide and Usage. Read this section before changing the backend, frontend, client, database schema, MQTT protocol, or MCP capabilities.
Reading Order
- Architecture: understand the main processes and components.
- Project Structure: understand source directories, runtime data, and ownership boundaries.
- Backend: understand where business rules live.
- Database: understand SQLAlchemy, Alembic, and snapshots.
- Frontend: understand why the frontend does not duplicate backend rules.
- Client: understand
wfm-agentandwfmctl. - Events: understand SSE event boundaries.
- MQTT Protocol: understand the control channel between backend, EMQX, and clients.
- API Contract: understand response shape, errors, and download tokens.
- Collaboration: read this before making broad changes.
By Task
| Task | Start with | Then check |
|---|---|---|
| Add a console page | Frontend | Backend, API Reference, Realtime Reference |
| Add or change a backend API | API Contract | Backend, Errors, MCP Reference |
| Change database fields or tables | Database | Data Model, Snapshots |
| Change dynamic client control | Client | MQTT Protocol, MQTT Messages, Client Lifecycle |
| Change mesh generation or AllowedIPs | Backend | Quick Mesh Reference, Data Model |
| Change WireGuard / AmneziaWG parameters | Client | Protocols, MQTT Messages |
| Change MCP capabilities | API Contract | MCP Reference, Security |
| Change deployment or environment variables | Architecture | Environment, Docker Deploy, Reverse Proxy |
Before Changing Code
The core rule is simple: the backend and database are the source of truth. The frontend displays and calls. The client executes local actions.
Update documentation when changing:
- API paths, request fields, response fields, or error codes.
- Database tables, migrations, or snapshot content.
- MQTT topics, payloads, ACKs, or online state rules.
- MCP resources, tools, permissions, or audit behavior.
- Docker, environment variables, reverse proxy, or deployment layout.
- Client commands, install behavior, or local file layout.
