This directory contains Mermaid diagrams documenting the PRAHO platform architecture.
File: diagrams/system-overview.mmd
Purpose: High-level view of all services, databases, and external integrations.
Shows:
- Portal service (customer-facing, SQLite sessions only)
- Platform service (business logic, PostgreSQL)
- External integrations (Virtualmin, Stripe, ANAF, ROTLD)
- Network boundaries and data flows
View online: Copy the diagram content and paste into Mermaid Live Editor
File: diagrams/data-flow.mmd
Purpose: Sequence diagram showing Portal ↔ Platform communication patterns.
Shows:
- Customer authentication flow (login, session creation)
- Data retrieval via HMAC-signed API requests
- Security isolation (Portal cannot access PostgreSQL directly)
- Session storage in Portal's SQLite vs business data in Platform's PostgreSQL
Use case: Understanding how the two services communicate securely.
File: diagrams/deployment.mmd
Purpose: Docker network topology and container layout.
Shows:
- Docker network segmentation (
platform-networkvsapi-network) - Service exposure (Nginx reverse proxy, SSL termination)
- Database isolation (PostgreSQL only accessible from platform-network)
- External API access patterns
Use case: Setting up production deployment or understanding security boundaries.
File: diagrams/app-dependencies.mmd
Purpose: Inter-app dependency graph showing how the 17 platform apps relate to each other.
Shows:
- Four dependency tiers: Foundation, Core Business, Specialized, Leaf
- Import relationships between apps (A → B means A depends on B)
- Hub apps (common, audit, settings) omitted for clarity — they connect to everything
Use case: Understanding coupling between apps, planning refactoring scope, or evaluating microservices extraction candidates.
File: diagrams/entity-relationships.mmd
Purpose: Database ER diagram showing core entities, key fields, and cardinality.
Shows:
- ~20 core entities grouped by domain (auth, business, catalog, orders, billing, hosting, domains, support, audit)
- Primary keys, foreign keys, status fields, and monetary fields
- Relationship cardinality (one-to-one, one-to-many, optional)
- PK strategy (UUID vs auto-increment) and monetary storage (cents as BigInteger)
Use case: Understanding the data model, writing queries, or planning schema migrations.
- Go to mermaid.live
- Copy the contents of any
.mmdfile - Paste into the editor
- View/export the rendered diagram
Install the Mermaid Preview extension.
Open any .mmd file and click the preview icon.
GitHub natively renders Mermaid diagrams in markdown. Create a .md file with:
```mermaid [paste diagram content here] ```
Install Mermaid CLI:
npm install -g @mermaid-js/mermaid-cliRender to PNG:
mmdc -i diagrams/system-overview.mmd -o diagrams/system-overview.pngGenerate PNG images locally using mermaid.ink API (PNGs are gitignored):
cd docs/architecture/diagrams
# Regenerate all diagrams
for diagram in *.mmd; do
name="${diagram%.mmd}"
encoded=$(cat "$diagram" | base64 -w0)
curl -s "https://mermaid.ink/img/${encoded}" -o "${name}.png"
echo "Generated ${name}.png"
doneRun this whenever you update the .mmd source files.
When to update these diagrams:
- Adding a new service or external integration
- Changing network topology or Docker setup
- Modifying service communication patterns
- Updating security boundaries or authentication flows
Versioning:
These diagrams track the architecture version in docs/ARCHITECTURE.md. Current: v1.2.0 (Feb 2026).
Contributing:
- Edit the
.mmdfile directly - Test rendering in mermaid.live
- Update the diagram comment header with the change date
- Include diagram updates in your PR description
- ARCHITECTURE.md - Detailed written architecture guide
- DEPLOYMENT.md - Production deployment instructions
- ADRs - Architecture decision records