# yazvip/mutasihub architecture

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

- Interactive diagram: https://gitdiagram.com/yazvip/mutasihub
- Repository: https://github.com/yazvip/mutasihub

## Overview

MutasiHub aggregates read-only DANA and BCA account mutations for business payment monitoring and reconciliation. Members register or sign in, connect their own accounts, then inspect mutations and optionally use API keys, notifications, or Enterprise callbacks; admins manage members, plans, provider operations, settings, and email. The README describes backend capabilities whose implementations were not sampled; those relationships are cited to the README rather than inferred from filenames. The source excerpts and index support the frontend API calls and selected page-to-client dependencies.

Main entry points: [`frontend/lib/api.ts`](https://github.com/yazvip/mutasihub/blob/main/frontend/lib/api.ts) (HTTP API client), [`backend/internal/http/server.go`](https://github.com/yazvip/mutasihub/blob/main/backend/internal/http/server.go) (HTTP server and routes), [`backend/internal/db/db.go`](https://github.com/yazvip/mutasihub/blob/main/backend/internal/db/db.go) (MySQL and migrations), [`frontend/app/page.tsx`](https://github.com/yazvip/mutasihub/blob/main/frontend/app/page.tsx) (Landing and pricing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_landing["Landing and pricing<br/>[page.tsx]"]
  node_authshell["Auth presentation<br/>[auth-shell.tsx]"]
  node_apihelper["HTTP API client<br/>[api.ts]"]
  node_brandsettings["Brand settings<br/>[settings.tsx]"]
  node_format["Plan and mutation formatting<br/>[format.ts]"]
end

subgraph group_identity["Identity and accounts"]
  node_authpages["Login and registration<br/>[page.tsx]"]
  node_server["HTTP server and routes<br/>[server.go]"]
  node_authhandlers["Authentication handlers<br/>[auth_handlers.go]"]
  node_authcore["Auth and MFA<br/>[auth.go]"]
  node_main["Backend startup<br/>[main.go]"]
end

subgraph group_operations["Mutation operations"]
  node_memberaccounts["Connected accounts<br/>[page.tsx]"]
  node_dashboard["Member dashboard<br/>[page.tsx]"]
  node_memberapi["Keys and callbacks<br/>[page.tsx]"]
  node_playground["Account inquiry<br/>[page.tsx]"]
  node_memberhandlers["Member handlers<br/>[member_handlers.go]"]
  node_inquiry["Inquiry handlers"]
  node_webhooks["Provider webhooks<br/>[webhooks.go]"]
  node_sync["Mutation polling<br/>[sync.go]"]
  node_callback["Enterprise callbacks<br/>[callback.go]"]
  node_connecta["Connecta client<br/>[client.go]"]
end

subgraph group_management["Platform management"]
  node_subscription["Plans and billing<br/>[page.tsx]"]
  node_adminhandlers["Admin handlers<br/>[admin_handlers.go]"]
  node_database[("MySQL and migrations<br/>[db.go]")]
  node_mail["Email delivery<br/>[mailketing.go]"]
end

node_visitor(("Member or admin"))
node_connectaservice{{"Connecta service"}}
node_businessclient(("Business integration"))

node_visitor -->|"browses"| node_landing
node_visitor -->|"signs in"| node_authpages
node_landing -->|"loads plans"| node_apihelper
node_landing -->|"reads brand"| node_brandsettings
node_authpages -->|"renders"| node_authshell
node_authpages -->|"requests auth"| node_apihelper
node_memberaccounts -->|"manages accounts"| node_apihelper
node_memberaccounts -->|"loads plans"| node_apihelper
node_dashboard -->|"loads dashboard"| node_apihelper
node_memberapi -->|"manages keys"| node_apihelper
node_subscription -->|"manages subscription"| node_apihelper
node_playground -->|"submits inquiry"| node_apihelper
node_apihelper -->|"calls endpoints"| node_server
node_server -->|"routes auth"| node_authhandlers
node_server -->|"routes member"| node_memberhandlers
node_server -->|"routes admin"| node_adminhandlers
node_server -->|"routes inquiry"| node_inquiry
node_server -->|"routes callbacks"| node_webhooks
node_authhandlers -->|"uses"| node_authcore
node_memberhandlers -->|"reads and writes"| node_database
node_adminhandlers -->|"manages records"| node_database
node_adminhandlers -.->|"configures email"| node_mail
node_inquiry -.->|"requests inquiry"| node_connecta
node_sync -->|"polls mutations"| node_connecta
node_connecta -->|"calls provider"| node_connectaservice
node_connectaservice -->|"sends events"| node_webhooks
node_webhooks -.->|"records events"| node_database
node_sync -.->|"stores mutations"| node_database
node_callback -->|"notifies mutations"| node_businessclient
node_main -->|"starts"| node_server
node_subscription -->|"requests billing"| node_apihelper
node_brandsettings -->|"loads settings"| node_apihelper

click node_landing "https://github.com/yazvip/mutasihub/blob/main/frontend/app/page.tsx"
click node_authpages "https://github.com/yazvip/mutasihub/blob/main/frontend/app/login/page.tsx"
click node_authshell "https://github.com/yazvip/mutasihub/blob/main/frontend/components/auth-shell.tsx"
click node_memberaccounts "https://github.com/yazvip/mutasihub/blob/main/frontend/app/member/accounts/page.tsx"
click node_dashboard "https://github.com/yazvip/mutasihub/blob/main/frontend/app/member/dashboard/page.tsx"
click node_memberapi "https://github.com/yazvip/mutasihub/blob/main/frontend/app/member/api/page.tsx"
click node_subscription "https://github.com/yazvip/mutasihub/blob/main/frontend/app/member/subscription/page.tsx"
click node_playground "https://github.com/yazvip/mutasihub/blob/main/frontend/app/member/playground/page.tsx"
click node_apihelper "https://github.com/yazvip/mutasihub/blob/main/frontend/lib/api.ts"
click node_brandsettings "https://github.com/yazvip/mutasihub/blob/main/frontend/lib/settings.tsx"
click node_format "https://github.com/yazvip/mutasihub/blob/main/frontend/lib/format.ts"
click node_server "https://github.com/yazvip/mutasihub/blob/main/backend/internal/http/server.go"
click node_authhandlers "https://github.com/yazvip/mutasihub/blob/main/backend/internal/http/auth_handlers.go"
click node_memberhandlers "https://github.com/yazvip/mutasihub/blob/main/backend/internal/http/member_handlers.go"
click node_adminhandlers "https://github.com/yazvip/mutasihub/blob/main/backend/internal/http/admin_handlers.go"
click node_inquiry "https://github.com/yazvip/mutasihub/blob/main/backend/internal/http/inquiry_handlers.go"
click node_webhooks "https://github.com/yazvip/mutasihub/blob/main/backend/internal/http/webhooks.go"
click node_sync "https://github.com/yazvip/mutasihub/blob/main/backend/internal/sync/sync.go"
click node_callback "https://github.com/yazvip/mutasihub/blob/main/backend/internal/sync/callback.go"
click node_connecta "https://github.com/yazvip/mutasihub/blob/main/backend/internal/connecta/client.go"
click node_authcore "https://github.com/yazvip/mutasihub/blob/main/backend/internal/auth/auth.go"
click node_database "https://github.com/yazvip/mutasihub/blob/main/backend/internal/db/db.go"
click node_mail "https://github.com/yazvip/mutasihub/blob/main/backend/internal/mail/mailketing.go"
click node_main "https://github.com/yazvip/mutasihub/blob/main/backend/cmd/server/main.go"

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_landing,node_authshell,node_apihelper,node_brandsettings,node_format toneBlue
class node_authpages,node_server,node_authhandlers,node_authcore,node_main toneAmber
class node_memberaccounts,node_dashboard,node_memberapi,node_playground,node_memberhandlers,node_inquiry,node_webhooks,node_sync,node_callback,node_connecta toneMint
class node_subscription,node_adminhandlers,node_database,node_mail toneRose
class node_visitor,node_connectaservice,node_businessclient toneIndigo
```

## Components

### Web experience

- [Landing and pricing](https://github.com/yazvip/mutasihub/blob/main/frontend/app/page.tsx): `frontend/app/page.tsx`
- [Auth presentation](https://github.com/yazvip/mutasihub/blob/main/frontend/components/auth-shell.tsx): `frontend/components/auth-shell.tsx`
- [HTTP API client](https://github.com/yazvip/mutasihub/blob/main/frontend/lib/api.ts): `frontend/lib/api.ts`
- [Brand settings](https://github.com/yazvip/mutasihub/blob/main/frontend/lib/settings.tsx): `frontend/lib/settings.tsx`
- [Plan and mutation formatting](https://github.com/yazvip/mutasihub/blob/main/frontend/lib/format.ts): `frontend/lib/format.ts`

### Identity and accounts

- [Login and registration](https://github.com/yazvip/mutasihub/blob/main/frontend/app/login/page.tsx): `frontend/app/login/page.tsx`
- [HTTP server and routes](https://github.com/yazvip/mutasihub/blob/main/backend/internal/http/server.go): `backend/internal/http/server.go`
- [Authentication handlers](https://github.com/yazvip/mutasihub/blob/main/backend/internal/http/auth_handlers.go): `backend/internal/http/auth_handlers.go`
- [Auth and MFA](https://github.com/yazvip/mutasihub/blob/main/backend/internal/auth/auth.go): `backend/internal/auth/auth.go`
- [Backend startup](https://github.com/yazvip/mutasihub/blob/main/backend/cmd/server/main.go): `backend/cmd/server/main.go`

### Mutation operations

- [Connected accounts](https://github.com/yazvip/mutasihub/blob/main/frontend/app/member/accounts/page.tsx): `frontend/app/member/accounts/page.tsx`
- [Member dashboard](https://github.com/yazvip/mutasihub/blob/main/frontend/app/member/dashboard/page.tsx): `frontend/app/member/dashboard/page.tsx`
- [Keys and callbacks](https://github.com/yazvip/mutasihub/blob/main/frontend/app/member/api/page.tsx): `frontend/app/member/api/page.tsx`
- [Account inquiry](https://github.com/yazvip/mutasihub/blob/main/frontend/app/member/playground/page.tsx): `frontend/app/member/playground/page.tsx`
- [Member handlers](https://github.com/yazvip/mutasihub/blob/main/backend/internal/http/member_handlers.go): `backend/internal/http/member_handlers.go`
- [Inquiry handlers](https://github.com/yazvip/mutasihub/blob/main/backend/internal/http/inquiry_handlers.go): `backend/internal/http/inquiry_handlers.go`
- [Provider webhooks](https://github.com/yazvip/mutasihub/blob/main/backend/internal/http/webhooks.go): `backend/internal/http/webhooks.go`
- [Mutation polling](https://github.com/yazvip/mutasihub/blob/main/backend/internal/sync/sync.go): `backend/internal/sync/sync.go`
- [Enterprise callbacks](https://github.com/yazvip/mutasihub/blob/main/backend/internal/sync/callback.go): `backend/internal/sync/callback.go`
- [Connecta client](https://github.com/yazvip/mutasihub/blob/main/backend/internal/connecta/client.go): `backend/internal/connecta/client.go`

### Platform management

- [Plans and billing](https://github.com/yazvip/mutasihub/blob/main/frontend/app/member/subscription/page.tsx): `frontend/app/member/subscription/page.tsx`
- [Admin handlers](https://github.com/yazvip/mutasihub/blob/main/backend/internal/http/admin_handlers.go): `backend/internal/http/admin_handlers.go`
- [MySQL and migrations](https://github.com/yazvip/mutasihub/blob/main/backend/internal/db/db.go): `backend/internal/db/db.go`
- [Email delivery](https://github.com/yazvip/mutasihub/blob/main/backend/internal/mail/mailketing.go): `backend/internal/mail/mailketing.go`

### Other components

- **Member or admin**
- **Connecta service**
- **Business integration**

## Connections

- Member or admin → Landing and pricing: browses (evidence: `README.md`)
- Member or admin → Login and registration: signs in (evidence: `README.md`)
- Landing and pricing → HTTP API client: loads plans (evidence: `frontend/app/page.tsx`)
- Landing and pricing → Brand settings: reads brand (evidence: `frontend/app/page.tsx`)
- Login and registration → Auth presentation: renders (evidence: `frontend/app/login/page.tsx`)
- Login and registration → HTTP API client: requests auth (evidence: `frontend/app/login/page.tsx`)
- Connected accounts → HTTP API client: manages accounts (evidence: `frontend/app/member/accounts/page.tsx`)
- Connected accounts → HTTP API client: loads plans (evidence: `frontend/app/member/accounts/page.tsx`)
- Member dashboard → HTTP API client: loads dashboard (evidence: `frontend/app/member/dashboard/page.tsx`)
- Keys and callbacks → HTTP API client: manages keys (evidence: `frontend/app/member/api/page.tsx`)
- Plans and billing → HTTP API client: manages subscription (evidence: `frontend/app/member/subscription/page.tsx`)
- Account inquiry → HTTP API client: submits inquiry (evidence: `frontend/app/member/playground/page.tsx`)
- HTTP API client → HTTP server and routes: calls endpoints (evidence: `README.md`)
- HTTP server and routes → Authentication handlers: routes auth (evidence: `README.md`)
- HTTP server and routes → Member handlers: routes member (evidence: `README.md`)
- HTTP server and routes → Admin handlers: routes admin (evidence: `README.md`)
- HTTP server and routes → Inquiry handlers: routes inquiry (evidence: `README.md`)
- HTTP server and routes → Provider webhooks: routes callbacks (evidence: `README.md`)
- Authentication handlers → Auth and MFA: uses (evidence: `README.md`)
- Member handlers → MySQL and migrations: reads and writes (evidence: `README.md`)
- Admin handlers → MySQL and migrations: manages records (evidence: `README.md`)
- Admin handlers → Email delivery: configures email
- Inquiry handlers → Connecta client: requests inquiry
- Mutation polling → Connecta client: polls mutations (evidence: `README.md`)
- Connecta client → Connecta service: calls provider (evidence: `README.md`)
- Connecta service → Provider webhooks: sends events (evidence: `README.md`)
- Provider webhooks → MySQL and migrations: records events
- Mutation polling → MySQL and migrations: stores mutations
- Enterprise callbacks → Business integration: notifies mutations (evidence: `README.md`)
- Backend startup → HTTP server and routes: starts (evidence: `README.md`)
- Plans and billing → HTTP API client: requests billing (evidence: `frontend/app/member/subscription/page.tsx`)
- Brand settings → HTTP API client: loads settings (evidence: `frontend/lib/settings.tsx`)
