# munazzem/munazem architecture

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

- Interactive diagram: https://gitdiagram.com/munazzem/munazem
- Repository: https://github.com/munazzem/munazem

## Overview

Monazem is an educational-center management SaaS, with backend services, a web dashboard, and a parent-facing mobile app. The main workflow is staff sign-in and role/tenant authorization, followed by managing students, groups, lessons and attendance, then financial records, reports, and parent updates. Centers, exams, cards, notebooks, and platform administration are additional product branches. The source index and excerpts support selected backend routes and service calls; frontend-to-backend links and several unsampled subsystem internals are therefore shown as unverified, not asserted as observed calls.

Main entry points: [`backend/src/app.controller.ts`](https://github.com/munazzem/munazem/blob/main/backend/src/app.controller.ts) (API server), [`backend/src/database/models`](https://github.com/munazzem/munazem/tree/main/backend/src/database/models) (MongoDB models), [`backend/src/middlewares`](https://github.com/munazzem/munazem/tree/main/backend/src/middlewares) (Request guards), [`app/src`](https://github.com/munazzem/munazem/tree/main/app/src) (Parent app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["User applications"]
  node_web["Web dashboard"]
  node_mobile["Parent app"]
  node_parent["Parent services"]
end

subgraph group_access["Access control"]
  node_auth["Authentication"]
  node_guards["Request guards"]
  node_users["Users and roles"]
end

subgraph group_education["Learning operations"]
  node_students["Student records"]
  node_groups["Groups and cycles"]
  node_sessions["Lessons and attendance"]
  node_attendance["Attendance"]
  node_exams["Exams and grades"]
end

subgraph group_business["Center business"]
  node_centers["Centers and branches"]
  node_payments["Payments and subscriptions"]
  node_notebooks["Notebook sales"]
  node_reports["Reports"]
end

subgraph group_platform["Platform services"]
  node_backend["API server<br/>[app.controller.ts]"]
  node_database[("MongoDB models")]
  node_notifications["Notifications"]
  node_admin["Administration"]
  node_cache[("Cache<br/>[cache.service.ts]")]
end

node_staff(("Center staff"))
node_parents(("Parents"))

node_staff -.->|"uses"| node_web
node_parents -.->|"uses"| node_mobile
node_web -.->|"requests API"| node_backend
node_mobile -.->|"requests API"| node_backend
node_backend -->|"routes to"| node_auth
node_backend -->|"routes to"| node_users
node_backend -->|"routes to"| node_students
node_backend -->|"routes to"| node_groups
node_backend -->|"routes to"| node_sessions
node_backend -->|"routes to"| node_attendance
node_backend -->|"routes to"| node_payments
node_backend -->|"routes to"| node_centers
node_backend -->|"routes to"| node_exams
node_backend -->|"routes to"| node_reports
node_backend -.->|"routes to"| node_notebooks
node_backend -.->|"routes to"| node_parent
node_backend -.->|"routes to"| node_admin
node_auth -.->|"uses"| node_guards
node_guards -->|"checks access"| node_cache
node_guards -->|"checks account"| node_users
node_guards -->|"reads user"| node_database
node_sessions -->|"calls"| node_attendance
node_attendance -->|"exports PDF"| node_reports
node_centers -.->|"routes from"| node_backend
node_centers -.->|"persists records"| node_database
node_payments -.->|"persists transactions"| node_database
node_students -.->|"persists records"| node_database
node_parent -.->|"reads family data"| node_database
node_admin -.->|"manages tenants"| node_database
node_admin -->|"triggers reports"| node_reports
node_mobile -.->|"uses services"| node_parent
node_notifications -.->|"sends updates"| node_parents

click node_web "https://github.com/munazzem/munazem/tree/main/frontend/src/app"
click node_mobile "https://github.com/munazzem/munazem/tree/main/app/src"
click node_backend "https://github.com/munazzem/munazem/blob/main/backend/src/app.controller.ts"
click node_auth "https://github.com/munazzem/munazem/tree/main/backend/src/modules/authentication"
click node_guards "https://github.com/munazzem/munazem/tree/main/backend/src/middlewares"
click node_users "https://github.com/munazzem/munazem/tree/main/backend/src/modules/users"
click node_students "https://github.com/munazzem/munazem/tree/main/backend/src/modules/students"
click node_groups "https://github.com/munazzem/munazem/tree/main/backend/src/modules/groups"
click node_sessions "https://github.com/munazzem/munazem/tree/main/backend/src/modules/sessions"
click node_attendance "https://github.com/munazzem/munazem/tree/main/backend/src/modules/attendance"
click node_exams "https://github.com/munazzem/munazem/tree/main/backend/src/modules/exams"
click node_centers "https://github.com/munazzem/munazem/tree/main/backend/src/modules/centers"
click node_payments "https://github.com/munazzem/munazem/tree/main/backend/src/modules/payments"
click node_notebooks "https://github.com/munazzem/munazem/tree/main/backend/src/modules/notebooks"
click node_reports "https://github.com/munazzem/munazem/tree/main/backend/src/modules/reports"
click node_parent "https://github.com/munazzem/munazem/tree/main/backend/src/modules/parent"
click node_database "https://github.com/munazzem/munazem/tree/main/backend/src/database/models"
click node_notifications "https://github.com/munazzem/munazem/tree/main/backend/src/infrastructure/queues"
click node_admin "https://github.com/munazzem/munazem/tree/main/backend/src/modules/admin"
click node_cache "https://github.com/munazzem/munazem/blob/main/backend/src/infrastructure/cache/cache.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_web,node_mobile,node_parent toneBlue
class node_auth,node_guards,node_users toneAmber
class node_students,node_groups,node_sessions,node_attendance,node_exams toneMint
class node_centers,node_payments,node_notebooks,node_reports toneRose
class node_backend,node_database,node_notifications,node_admin,node_cache,node_staff,node_parents toneIndigo
```

## Components

### User applications

- [Web dashboard](https://github.com/munazzem/munazem/tree/main/frontend/src/app): `frontend/src/app`
- [Parent app](https://github.com/munazzem/munazem/tree/main/app/src): `app/src`
- [Parent services](https://github.com/munazzem/munazem/tree/main/backend/src/modules/parent): `backend/src/modules/parent`

### Access control

- [Authentication](https://github.com/munazzem/munazem/tree/main/backend/src/modules/authentication): `backend/src/modules/authentication`
- [Request guards](https://github.com/munazzem/munazem/tree/main/backend/src/middlewares): `backend/src/middlewares`
- [Users and roles](https://github.com/munazzem/munazem/tree/main/backend/src/modules/users): `backend/src/modules/users`

### Learning operations

- [Student records](https://github.com/munazzem/munazem/tree/main/backend/src/modules/students): `backend/src/modules/students`
- [Groups and cycles](https://github.com/munazzem/munazem/tree/main/backend/src/modules/groups): `backend/src/modules/groups`
- [Lessons and attendance](https://github.com/munazzem/munazem/tree/main/backend/src/modules/sessions): `backend/src/modules/sessions`
- [Attendance](https://github.com/munazzem/munazem/tree/main/backend/src/modules/attendance): `backend/src/modules/attendance`
- [Exams and grades](https://github.com/munazzem/munazem/tree/main/backend/src/modules/exams): `backend/src/modules/exams`

### Center business

- [Centers and branches](https://github.com/munazzem/munazem/tree/main/backend/src/modules/centers): `backend/src/modules/centers`
- [Payments and subscriptions](https://github.com/munazzem/munazem/tree/main/backend/src/modules/payments): `backend/src/modules/payments`
- [Notebook sales](https://github.com/munazzem/munazem/tree/main/backend/src/modules/notebooks): `backend/src/modules/notebooks`
- [Reports](https://github.com/munazzem/munazem/tree/main/backend/src/modules/reports): `backend/src/modules/reports`

### Platform services

- [API server](https://github.com/munazzem/munazem/blob/main/backend/src/app.controller.ts): `backend/src/app.controller.ts`
- [MongoDB models](https://github.com/munazzem/munazem/tree/main/backend/src/database/models): `backend/src/database/models`
- [Notifications](https://github.com/munazzem/munazem/tree/main/backend/src/infrastructure/queues): `backend/src/infrastructure/queues`
- [Administration](https://github.com/munazzem/munazem/tree/main/backend/src/modules/admin): `backend/src/modules/admin`
- [Cache](https://github.com/munazzem/munazem/blob/main/backend/src/infrastructure/cache/cache.service.ts): `backend/src/infrastructure/cache/cache.service.ts`

### Other components

- **Center staff**
- **Parents**

## Connections

- Center staff → Web dashboard: uses
- Parents → Parent app: uses
- Web dashboard → API server: requests API
- Parent app → API server: requests API
- API server → Authentication: routes to (evidence: `backend/src/app.controller.ts`)
- API server → Users and roles: routes to (evidence: `backend/src/app.controller.ts`)
- API server → Student records: routes to (evidence: `backend/src/app.controller.ts`)
- API server → Groups and cycles: routes to (evidence: `backend/src/app.controller.ts`)
- API server → Lessons and attendance: routes to (evidence: `backend/src/app.controller.ts`)
- API server → Attendance: routes to (evidence: `backend/src/app.controller.ts`)
- API server → Payments and subscriptions: routes to (evidence: `backend/src/app.controller.ts`)
- API server → Centers and branches: routes to (evidence: `backend/src/app.controller.ts`)
- API server → Exams and grades: routes to (evidence: `backend/src/app.controller.ts`)
- API server → Reports: routes to (evidence: `backend/src/app.controller.ts`)
- API server → Notebook sales: routes to (evidence: `backend/src/app.controller.ts`)
- API server → Parent services: routes to (evidence: `backend/src/app.controller.ts`)
- API server → Administration: routes to (evidence: `backend/src/app.controller.ts`)
- Authentication → Request guards: uses (evidence: `backend/src/modules/authentication/auth.controller.ts`)
- Request guards → Cache: checks access (evidence: `backend/src/middlewares/auth.middleware.ts`)
- Request guards → Users and roles: checks account (evidence: `backend/src/middlewares/auth.middleware.ts`)
- Request guards → MongoDB models: reads user (evidence: `backend/src/middlewares/auth.middleware.ts`)
- Lessons and attendance → Attendance: calls (evidence: `backend/src/modules/sessions/sessions.service.ts`)
- Attendance → Reports: exports PDF (evidence: `backend/src/modules/attendance/attendance.controller.ts`)
- Centers and branches → API server: routes from (evidence: `backend/src/app.controller.ts`)
- Centers and branches → MongoDB models: persists records
- Payments and subscriptions → MongoDB models: persists transactions
- Student records → MongoDB models: persists records
- Parent services → MongoDB models: reads family data (evidence: `backend/src/modules/parent/parent-auth.service.ts`)
- Administration → MongoDB models: manages tenants (evidence: `backend/src/modules/admin/admin.controller.ts`)
- Administration → Reports: triggers reports (evidence: `backend/src/modules/admin/admin.controller.ts`)
- Parent app → Parent services: uses services
- Notifications → Parents: sends updates
