# bininfotech0/nmms architecture

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

- Interactive diagram: https://gitdiagram.com/bininfotech0/nmms
- Repository: https://github.com/bininfotech0/nmms

## Overview

NMMS is an NGO membership-management system with a staff admin portal and a self-service member portal. Members can register and authenticate, while staff manage applications and membership lifecycle; the system also supports KYC and documents, cards, payments and donations, events, referrals, notices, and reporting. The web app communicates with a NestJS API backed by Prisma/PostgreSQL. The README documents the product capabilities and stack; sampled source confirms application lifecycle, member registration, staff authentication, and event operations. Other domain internals are represented at subsystem level where source excerpts were unavailable.

Main entry points: [`apps/api/src/app.module.ts`](https://github.com/bininfotech0/nmms/blob/main/apps/api/src/app.module.ts) (NestJS API), [`apps/api/src/member-auth/member-auth.service.ts`](https://github.com/bininfotech0/nmms/blob/main/apps/api/src/member-auth/member-auth.service.ts) (Member registration), [`apps/api/src/applications/applications.service.ts`](https://github.com/bininfotech0/nmms/blob/main/apps/api/src/applications/applications.service.ts) (Applications lifecycle), [`apps/web/src/App.tsx`](https://github.com/bininfotech0/nmms/blob/main/apps/web/src/App.tsx) (Web application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web portals"]
  node_webapp["Web application<br/>[App.tsx]"]
  node_admin["Staff portal<br/>[Applications.tsx]"]
  node_memberportal["Member portal"]
  node_webclient["API clients<br/>[api-client.ts]"]
end

subgraph group_identity["Identity and membership"]
  node_staffauth["Staff authentication<br/>[auth.controller.ts]"]
  node_memberauth["Member registration"]
  node_members["Member records<br/>[members.service.ts]"]
  node_applications["Applications lifecycle"]
end

subgraph group_operations["Member services"]
  node_kycdocs["KYC and documents"]
  node_cards["Membership cards"]
  node_payments["Payments"]
  node_donations["Donations"]
  node_events["Events<br/>[events.service.ts]"]
  node_referrals["Referrals"]
  node_engagement["Notices and reports"]
end

subgraph group_platform["API and data"]
  node_api["NestJS API<br/>[app.module.ts]"]
  node_prisma["Prisma access<br/>[prisma.service.ts]"]
  node_database[("PostgreSQL")]
  node_shared["Shared schemas<br/>[member.ts]"]
  node_gateway["Payment gateway"]
end

node_staff(("Staff user"))
node_member(("Member"))

node_staff -->|"uses"| node_webapp
node_member -->|"uses"| node_webapp
node_webapp -->|"serves"| node_admin
node_webapp -->|"serves"| node_memberportal
node_admin -.->|"uses"| node_webclient
node_memberportal -.->|"uses"| node_webclient
node_webclient -->|"requests"| node_api
node_api -->|"provides"| node_staffauth
node_api -->|"provides"| node_memberauth
node_api -->|"provides"| node_members
node_api -->|"provides"| node_applications
node_api -->|"provides"| node_kycdocs
node_api -->|"provides"| node_cards
node_api -->|"provides"| node_payments
node_api -->|"provides"| node_donations
node_api -->|"provides"| node_events
node_api -->|"provides"| node_referrals
node_api -->|"provides"| node_engagement
node_memberauth -->|"reads and writes"| node_prisma
node_memberauth -->|"creates records"| node_members
node_memberauth -->|"uses types"| node_shared
node_applications -->|"authorizes history"| node_members
node_applications -->|"reads and updates"| node_prisma
node_applications -->|"uses types"| node_shared
node_events -.->|"persists data"| node_prisma
node_payments -.->|"uses"| node_gateway
node_prisma -->|"connects"| node_database

click node_webapp "https://github.com/bininfotech0/nmms/blob/main/apps/web/src/App.tsx"
click node_admin "https://github.com/bininfotech0/nmms/blob/main/apps/web/src/pages/admin/Applications.tsx"
click node_memberportal "https://github.com/bininfotech0/nmms/blob/main/apps/web/src/pages/member/MemberDashboard.tsx"
click node_webclient "https://github.com/bininfotech0/nmms/blob/main/apps/web/src/lib/api-client.ts"
click node_staffauth "https://github.com/bininfotech0/nmms/blob/main/apps/api/src/auth/auth.controller.ts"
click node_memberauth "https://github.com/bininfotech0/nmms/blob/main/apps/api/src/member-auth/member-auth.service.ts"
click node_members "https://github.com/bininfotech0/nmms/blob/main/apps/api/src/members/members.service.ts"
click node_applications "https://github.com/bininfotech0/nmms/blob/main/apps/api/src/applications/applications.service.ts"
click node_kycdocs "https://github.com/bininfotech0/nmms/tree/main/apps/api/src/kyc"
click node_cards "https://github.com/bininfotech0/nmms/tree/main/apps/api/src/card"
click node_payments "https://github.com/bininfotech0/nmms/tree/main/apps/api/src/payments"
click node_donations "https://github.com/bininfotech0/nmms/tree/main/apps/api/src/donations"
click node_events "https://github.com/bininfotech0/nmms/blob/main/apps/api/src/events/events.service.ts"
click node_referrals "https://github.com/bininfotech0/nmms/tree/main/apps/api/src/referrals"
click node_engagement "https://github.com/bininfotech0/nmms/tree/main/apps/api/src/notices"
click node_api "https://github.com/bininfotech0/nmms/blob/main/apps/api/src/app.module.ts"
click node_prisma "https://github.com/bininfotech0/nmms/blob/main/apps/api/src/prisma/prisma.service.ts"
click node_shared "https://github.com/bininfotech0/nmms/blob/main/packages/shared/src/schemas/member.ts"
click node_gateway "https://github.com/bininfotech0/nmms/blob/main/apps/api/src/payments/gateway/payment-gateway.service.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_webapp,node_admin,node_memberportal,node_webclient,node_staff toneBlue
class node_staffauth,node_memberauth,node_members,node_applications toneAmber
class node_kycdocs,node_cards,node_payments,node_donations,node_events,node_referrals,node_engagement toneMint
class node_api,node_prisma,node_database,node_shared,node_gateway toneRose
class node_member toneIndigo
```

## Components

### Web portals

- [Web application](https://github.com/bininfotech0/nmms/blob/main/apps/web/src/App.tsx): `apps/web/src/App.tsx`
- [Staff portal](https://github.com/bininfotech0/nmms/blob/main/apps/web/src/pages/admin/Applications.tsx): `apps/web/src/pages/admin/Applications.tsx`
- [Member portal](https://github.com/bininfotech0/nmms/blob/main/apps/web/src/pages/member/MemberDashboard.tsx): `apps/web/src/pages/member/MemberDashboard.tsx`
- [API clients](https://github.com/bininfotech0/nmms/blob/main/apps/web/src/lib/api-client.ts): `apps/web/src/lib/api-client.ts`

### Identity and membership

- [Staff authentication](https://github.com/bininfotech0/nmms/blob/main/apps/api/src/auth/auth.controller.ts): `apps/api/src/auth/auth.controller.ts`
- [Member registration](https://github.com/bininfotech0/nmms/blob/main/apps/api/src/member-auth/member-auth.service.ts): `apps/api/src/member-auth/member-auth.service.ts`
- [Member records](https://github.com/bininfotech0/nmms/blob/main/apps/api/src/members/members.service.ts): `apps/api/src/members/members.service.ts`
- [Applications lifecycle](https://github.com/bininfotech0/nmms/blob/main/apps/api/src/applications/applications.service.ts): `apps/api/src/applications/applications.service.ts`

### Member services

- [KYC and documents](https://github.com/bininfotech0/nmms/tree/main/apps/api/src/kyc): `apps/api/src/kyc`
- [Membership cards](https://github.com/bininfotech0/nmms/tree/main/apps/api/src/card): `apps/api/src/card`
- [Payments](https://github.com/bininfotech0/nmms/tree/main/apps/api/src/payments): `apps/api/src/payments`
- [Donations](https://github.com/bininfotech0/nmms/tree/main/apps/api/src/donations): `apps/api/src/donations`
- [Events](https://github.com/bininfotech0/nmms/blob/main/apps/api/src/events/events.service.ts): `apps/api/src/events/events.service.ts`
- [Referrals](https://github.com/bininfotech0/nmms/tree/main/apps/api/src/referrals): `apps/api/src/referrals`
- [Notices and reports](https://github.com/bininfotech0/nmms/tree/main/apps/api/src/notices): `apps/api/src/notices`

### API and data

- [NestJS API](https://github.com/bininfotech0/nmms/blob/main/apps/api/src/app.module.ts): `apps/api/src/app.module.ts`
- [Prisma access](https://github.com/bininfotech0/nmms/blob/main/apps/api/src/prisma/prisma.service.ts): `apps/api/src/prisma/prisma.service.ts`
- **PostgreSQL**
- [Shared schemas](https://github.com/bininfotech0/nmms/blob/main/packages/shared/src/schemas/member.ts): `packages/shared/src/schemas/member.ts`
- [Payment gateway](https://github.com/bininfotech0/nmms/blob/main/apps/api/src/payments/gateway/payment-gateway.service.ts): `apps/api/src/payments/gateway/payment-gateway.service.ts`

### Other components

- **Staff user**
- **Member**

## Connections

- Staff user → Web application: uses (evidence: `README.md`)
- Member → Web application: uses (evidence: `README.md`)
- Web application → Staff portal: serves (evidence: `apps/web/src/App.tsx`)
- Web application → Member portal: serves (evidence: `apps/web/src/App.tsx`)
- Staff portal → API clients: uses
- Member portal → API clients: uses
- API clients → NestJS API: requests (evidence: `README.md`)
- NestJS API → Staff authentication: provides (evidence: `README.md`)
- NestJS API → Member registration: provides (evidence: `README.md`)
- NestJS API → Member records: provides (evidence: `README.md`)
- NestJS API → Applications lifecycle: provides (evidence: `README.md`)
- NestJS API → KYC and documents: provides (evidence: `README.md`)
- NestJS API → Membership cards: provides (evidence: `README.md`)
- NestJS API → Payments: provides (evidence: `README.md`)
- NestJS API → Donations: provides (evidence: `README.md`)
- NestJS API → Events: provides (evidence: `README.md`)
- NestJS API → Referrals: provides (evidence: `README.md`)
- NestJS API → Notices and reports: provides (evidence: `README.md`)
- Member registration → Prisma access: reads and writes (evidence: `apps/api/src/member-auth/member-auth.service.ts`)
- Member registration → Member records: creates records (evidence: `apps/api/src/member-auth/member-auth.service.ts`)
- Member registration → Shared schemas: uses types (evidence: `apps/api/src/member-auth/member-auth.service.ts`)
- Applications lifecycle → Member records: authorizes history (evidence: `apps/api/src/applications/applications.service.ts`)
- Applications lifecycle → Prisma access: reads and updates (evidence: `apps/api/src/applications/applications.service.ts`)
- Applications lifecycle → Shared schemas: uses types (evidence: `apps/api/src/applications/applications.service.ts`)
- Events → Prisma access: persists data
- Payments → Payment gateway: uses
- Prisma access → PostgreSQL: connects (evidence: `README.md`)
