# madevi810/madevi-app architecture

> Architecture diagram of the GitHub repository madevi810/madevi-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/madevi810/madevi-app
- Repository: https://github.com/madevi810/madevi-app

## Overview

Madevi is a web platform for knowledge articles, learning, community participation, online services, and administration. A representative user workflow is browsing an article in the web app, with API routes handling article requests and ArticleService implementing article operations. Other major product areas include exams, social features, shopping, and interactive tools. The graph reflects the supplied source excerpts and SOURCE INDEX; many feature directories are represented, but their internal calls were not sampled, so uncertain links are omitted.

Main entry points: [`src/services/article.ts`](https://github.com/madevi810/madevi-app/blob/main/src/services/article.ts) (Article service), [`src/app/api/v1/jasa/pcb/route.ts`](https://github.com/madevi810/madevi-app/blob/main/src/app/api/v1/jasa/pcb/route.ts) (Service ordering API), [`src/components/article-page-client.tsx`](https://github.com/madevi810/madevi-app/blob/main/src/components/article-page-client.tsx) (Article reader), [`src/app/api/v1/articles/route.ts`](https://github.com/madevi810/madevi-app/blob/main/src/app/api/v1/articles/route.ts) (Article API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_knowledge["Knowledge and learning"]
  node_article_ui["Article reader"]
  node_article_api["Article API<br/>[route.ts]"]
  node_article_service["Article service<br/>[article.ts]"]
  node_article_extras["Reading tools"]
  node_learning["Learning paths and exams"]
  node_foundation["Foundation records"]
end

subgraph group_community["Community and participation"]
  node_social["Social and messaging"]
  node_groups["Groups and discussion"]
  node_line["Community activities"]
end

subgraph group_commerce["Services and commerce"]
  node_shop["Shopping and bundles"]
  node_jasa_api["Service ordering API<br/>[route.ts]"]
  node_jasa_service["Service order logic<br/>[jasa.ts]"]
  node_payments["Payments<br/>[payment.ts]"]
  node_tools["Utilities and tools"]
  node_circuit_model["Circuit simulator<br/>[circuit-model.ts]"]
end

subgraph group_governance["Administration and safety"]
  node_moderation["Moderation<br/>[moderation.ts]"]
  node_security["Security controls<br/>[security.ts]"]
  node_owner["Owner administration"]
end

subgraph group_platform["Platform runtime"]
  node_accounts["Account services<br/>[accounts.ts]"]
  node_auth_http["Request authentication<br/>[http.ts]"]
  node_sessions["Session management<br/>[session.ts]"]
  node_db_client["Database client<br/>[client.ts]"]
  node_database[("PostgreSQL")]
  node_api_response["API responses<br/>[response.ts]"]
  node_logger["Server logging<br/>[logger.ts]"]
  node_worker["Circuit solver worker"]
end

node_visitor(("Visitor or member"))

node_visitor -->|"browses"| node_article_ui
node_article_ui -->|"submits corrections"| node_article_api
node_article_api -->|"authenticates requests"| node_auth_http
node_article_api -->|"calls article operations"| node_article_service
node_article_service -->|"uses moderation"| node_moderation
node_article_service -->|"updates search projection"| node_article_service
node_article_ui -->|"renders reading tools"| node_article_extras
node_auth_http -->|"authenticates sessions"| node_sessions
node_sessions -->|"gets database pool"| node_db_client
node_db_client -->|"opens pool connection"| node_database
node_api_response -->|"logs internal errors"| node_logger
node_jasa_api -->|"checks authentication"| node_auth_http
node_jasa_api -->|"creates PCB orders"| node_jasa_service
node_jasa_api -->|"checks action limits"| node_security
node_worker -->|"uses circuit model"| node_circuit_model

click node_article_ui "https://github.com/madevi810/madevi-app/blob/main/src/components/article-page-client.tsx"
click node_article_api "https://github.com/madevi810/madevi-app/blob/main/src/app/api/v1/articles/route.ts"
click node_article_service "https://github.com/madevi810/madevi-app/blob/main/src/services/article.ts"
click node_article_extras "https://github.com/madevi810/madevi-app/tree/main/src/components"
click node_learning "https://github.com/madevi810/madevi-app/tree/main/src/app/api/v1/learning-paths"
click node_foundation "https://github.com/madevi810/madevi-app/tree/main/src/app/api/v1/foundation"
click node_social "https://github.com/madevi810/madevi-app/tree/main/src/app/api/v1/social"
click node_groups "https://github.com/madevi810/madevi-app/tree/main/src/app/api/v1/groups"
click node_line "https://github.com/madevi810/madevi-app/tree/main/src/app/api/v1/line"
click node_shop "https://github.com/madevi810/madevi-app/tree/main/src/app/api/v1/ebelanja"
click node_jasa_api "https://github.com/madevi810/madevi-app/blob/main/src/app/api/v1/jasa/pcb/route.ts"
click node_jasa_service "https://github.com/madevi810/madevi-app/blob/main/src/services/jasa.ts"
click node_payments "https://github.com/madevi810/madevi-app/blob/main/src/services/payment.ts"
click node_tools "https://github.com/madevi810/madevi-app/tree/main/src/app/api/v1/utilities"
click node_circuit_model "https://github.com/madevi810/madevi-app/blob/main/src/lib/emulator/circuit-model.ts"
click node_moderation "https://github.com/madevi810/madevi-app/blob/main/src/services/moderation.ts"
click node_security "https://github.com/madevi810/madevi-app/blob/main/src/services/security.ts"
click node_owner "https://github.com/madevi810/madevi-app/tree/main/src/app/api/v1/owner"
click node_accounts "https://github.com/madevi810/madevi-app/blob/main/src/services/accounts.ts"
click node_auth_http "https://github.com/madevi810/madevi-app/blob/main/src/auth/http.ts"
click node_sessions "https://github.com/madevi810/madevi-app/blob/main/src/auth/session.ts"
click node_db_client "https://github.com/madevi810/madevi-app/blob/main/src/db/client.ts"
click node_api_response "https://github.com/madevi810/madevi-app/blob/main/src/api/response.ts"
click node_logger "https://github.com/madevi810/madevi-app/blob/main/src/server/logger.ts"
click node_worker "https://github.com/madevi810/madevi-app/blob/main/src/workers/circuit-solver.worker.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_article_ui,node_article_api,node_article_service,node_article_extras,node_learning,node_foundation toneBlue
class node_social,node_groups,node_line toneAmber
class node_shop,node_jasa_api,node_jasa_service,node_payments,node_tools,node_circuit_model toneMint
class node_moderation,node_security,node_owner toneRose
class node_accounts,node_auth_http,node_sessions,node_db_client,node_database,node_api_response,node_logger,node_worker,node_visitor toneIndigo
```

## Components

### Knowledge and learning

- [Article reader](https://github.com/madevi810/madevi-app/blob/main/src/components/article-page-client.tsx): `src/components/article-page-client.tsx`
- [Article API](https://github.com/madevi810/madevi-app/blob/main/src/app/api/v1/articles/route.ts): `src/app/api/v1/articles/route.ts`
- [Article service](https://github.com/madevi810/madevi-app/blob/main/src/services/article.ts): `src/services/article.ts`
- [Reading tools](https://github.com/madevi810/madevi-app/tree/main/src/components): `src/components`
- [Learning paths and exams](https://github.com/madevi810/madevi-app/tree/main/src/app/api/v1/learning-paths): `src/app/api/v1/learning-paths`
- [Foundation records](https://github.com/madevi810/madevi-app/tree/main/src/app/api/v1/foundation): `src/app/api/v1/foundation`

### Community and participation

- [Social and messaging](https://github.com/madevi810/madevi-app/tree/main/src/app/api/v1/social): `src/app/api/v1/social`
- [Groups and discussion](https://github.com/madevi810/madevi-app/tree/main/src/app/api/v1/groups): `src/app/api/v1/groups`
- [Community activities](https://github.com/madevi810/madevi-app/tree/main/src/app/api/v1/line): `src/app/api/v1/line`

### Services and commerce

- [Shopping and bundles](https://github.com/madevi810/madevi-app/tree/main/src/app/api/v1/ebelanja): `src/app/api/v1/ebelanja`
- [Service ordering API](https://github.com/madevi810/madevi-app/blob/main/src/app/api/v1/jasa/pcb/route.ts): `src/app/api/v1/jasa/pcb/route.ts`
- [Service order logic](https://github.com/madevi810/madevi-app/blob/main/src/services/jasa.ts): `src/services/jasa.ts`
- [Payments](https://github.com/madevi810/madevi-app/blob/main/src/services/payment.ts): `src/services/payment.ts`
- [Utilities and tools](https://github.com/madevi810/madevi-app/tree/main/src/app/api/v1/utilities): `src/app/api/v1/utilities`
- [Circuit simulator](https://github.com/madevi810/madevi-app/blob/main/src/lib/emulator/circuit-model.ts): `src/lib/emulator/circuit-model.ts`

### Administration and safety

- [Moderation](https://github.com/madevi810/madevi-app/blob/main/src/services/moderation.ts): `src/services/moderation.ts`
- [Security controls](https://github.com/madevi810/madevi-app/blob/main/src/services/security.ts): `src/services/security.ts`
- [Owner administration](https://github.com/madevi810/madevi-app/tree/main/src/app/api/v1/owner): `src/app/api/v1/owner`

### Platform runtime

- [Account services](https://github.com/madevi810/madevi-app/blob/main/src/services/accounts.ts): `src/services/accounts.ts`
- [Request authentication](https://github.com/madevi810/madevi-app/blob/main/src/auth/http.ts): `src/auth/http.ts`
- [Session management](https://github.com/madevi810/madevi-app/blob/main/src/auth/session.ts): `src/auth/session.ts`
- [Database client](https://github.com/madevi810/madevi-app/blob/main/src/db/client.ts): `src/db/client.ts`
- **PostgreSQL**
- [API responses](https://github.com/madevi810/madevi-app/blob/main/src/api/response.ts): `src/api/response.ts`
- [Server logging](https://github.com/madevi810/madevi-app/blob/main/src/server/logger.ts): `src/server/logger.ts`
- [Circuit solver worker](https://github.com/madevi810/madevi-app/blob/main/src/workers/circuit-solver.worker.ts): `src/workers/circuit-solver.worker.ts`

### Other components

- **Visitor or member**

## Connections

- Visitor or member → Article reader: browses (evidence: `src/components/article-page-client.tsx`)
- Article reader → Article API: submits corrections (evidence: `src/components/article-page-client.tsx`)
- Article API → Request authentication: authenticates requests (evidence: `src/app/api/v1/articles/route.ts`)
- Article API → Article service: calls article operations (evidence: `src/app/api/v1/articles/route.ts`)
- Article service → Moderation: uses moderation (evidence: `src/services/article.ts`)
- Article service → Article service: updates search projection (evidence: `src/services/article.ts`)
- Article reader → Reading tools: renders reading tools (evidence: `src/components/article-page-client.tsx`)
- Request authentication → Session management: authenticates sessions (evidence: `src/auth/http.ts`)
- Session management → Database client: gets database pool (evidence: `src/auth/session.ts`)
- Database client → PostgreSQL: opens pool connection (evidence: `src/db/client.ts`)
- API responses → Server logging: logs internal errors (evidence: `src/api/response.ts`)
- Service ordering API → Request authentication: checks authentication (evidence: `src/app/api/v1/jasa/pcb/route.ts`)
- Service ordering API → Service order logic: creates PCB orders (evidence: `src/app/api/v1/jasa/pcb/route.ts`)
- Service ordering API → Security controls: checks action limits (evidence: `src/app/api/v1/jasa/pcb/route.ts`)
- Circuit solver worker → Circuit simulator: uses circuit model (evidence: `src/workers/circuit-solver.worker.ts`)
