# mohmmdmahdiashouri/lmsplatform architecture

> Architecture diagram of the GitHub repository mohmmdmahdiashouri/lmsplatform, 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/mohmmdmahdiashouri/lmsplatform
- Repository: https://github.com/mohmmdmahdiashouri/lmsplatform

## Overview

LMSPlatform is an in-progress LMS monolith; the supplied implementation is concentrated in identity: authentication, session management, authorization, and school creation. The principal user workflow is sign-up/sign-in through the frontend, API request handling, and backend authentication endpoints; backend CQRS handlers and persistence implement the domain operations. Other README-listed LMS domains are planned, but no implementation paths for them appear in this tree. Edges are limited to relationships visible in excerpts, the SOURCE INDEX, or documented in the README; unsampled wiring is not assumed.

Main entry points: [`frontend/src/features/authentication/services/auth.service.ts`](https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/frontend/src/features/authentication/services/auth.service.ts) (Auth service), [`backend/src/modules/identity/authentication/presentation/controllers/authentication.controller.ts`](https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/backend/src/modules/identity/authentication/presentation/controllers/authentication.controller.ts) (Authentication routes), [`frontend/src/shared/features/api-client/lib/http-client.ts`](https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/frontend/src/shared/features/api-client/lib/http-client.ts) (API client), [`frontend/src/app/(public)/auth/page.tsx`](https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/frontend/src/app/(public)/auth/page.tsx) (Auth screens)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend Experience"]
  node_auth_ui["Auth screens<br/>[page.tsx]"]
  node_auth_hooks["Auth hooks<br/>[useAuth.ts]"]
  node_auth_service["Auth service<br/>[auth.service.ts]"]
end

subgraph group_auth["Authentication"]
  node_auth_controller["Authentication routes"]
  node_session_controller["Session routes"]
  node_verify_controller["Verification routes"]
  node_auth_commands["Auth commands"]
  node_auth_queries["Auth queries"]
  node_auth_service_backend["Session service"]
  node_verification_service["Verification service"]
  node_session_repo["Session cache"]
  node_session_db[("Session records")]
  node_email_jobs["Verification email"]
end

subgraph group_identity["Identity Management"]
  node_authorization["Role authorization"]
  node_school_controller["School routes"]
  node_school_handler["Create school"]
  node_school_store[("School persistence")]
end

subgraph group_platform["Shared Backend Services"]
  node_backend_entry["Backend entry<br/>[main.ts]"]
  node_app_module["Application modules<br/>[app.module.ts]"]
  node_outbox["Outbox processing"]
  node_email_sender["SMTP sender"]
end

subgraph group_api["API Client"]
  node_api_client["API client<br/>[http-client.ts]"]
  node_axios["Browser transport<br/>[axios-client.ts]"]
  node_fetch["Server transport<br/>[fetch-client.ts]"]
  node_auth_store["Token store<br/>[auth-store.ts]"]
end

node_user(("LMS user"))

node_user -->|"uses"| node_auth_ui
node_auth_ui -.->|"uses"| node_auth_hooks
node_auth_hooks -->|"calls"| node_auth_service
node_auth_service -->|"sends requests"| node_api_client
node_api_client -->|"dispatches CSR"| node_axios
node_api_client -->|"dispatches SSR"| node_fetch
node_axios -->|"reads token"| node_auth_store
node_auth_service -->|"calls HTTP routes"| node_auth_controller
node_backend_entry -->|"starts"| node_app_module
node_auth_controller -->|"dispatches commands"| node_auth_commands
node_auth_controller -->|"dispatches queries"| node_auth_queries
node_auth_service_backend -->|"uses repository"| node_session_repo
node_session_repo -->|"reads and writes"| node_session_db
node_school_controller -->|"dispatches command"| node_school_handler
node_school_handler -.->|"uses repository"| node_school_store
node_email_jobs -.->|"sends email"| node_email_sender

click node_auth_ui "https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/frontend/src/app/(public)/auth/page.tsx"
click node_auth_hooks "https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/frontend/src/features/authentication/hooks/useAuth.ts"
click node_auth_service "https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/frontend/src/features/authentication/services/auth.service.ts"
click node_api_client "https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/frontend/src/shared/features/api-client/lib/http-client.ts"
click node_axios "https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/frontend/src/shared/features/api-client/lib/axios-client.ts"
click node_fetch "https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/frontend/src/shared/features/api-client/lib/fetch-client.ts"
click node_auth_store "https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/frontend/src/shared/features/api-client/lib/auth-store.ts"
click node_backend_entry "https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/backend/src/main.ts"
click node_app_module "https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/backend/src/app.module.ts"
click node_auth_controller "https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/backend/src/modules/identity/authentication/presentation/controllers/authentication.controller.ts"
click node_session_controller "https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/backend/src/modules/identity/authentication/presentation/controllers/session.controller.ts"
click node_verify_controller "https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/backend/src/modules/identity/authentication/presentation/controllers/verification.controller.ts"
click node_auth_commands "https://github.com/mohmmdmahdiashouri/lmsplatform/tree/develop/backend/src/modules/identity/authentication/application/commands"
click node_auth_queries "https://github.com/mohmmdmahdiashouri/lmsplatform/tree/develop/backend/src/modules/identity/authentication/application/queries"
click node_auth_service_backend "https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/backend/src/modules/identity/authentication/application/services/authentication.service.ts"
click node_verification_service "https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/backend/src/modules/identity/authentication/application/services/verification-token.service.ts"
click node_session_repo "https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/backend/src/modules/identity/authentication/infrastructure/persistence/cached-session.repository.ts"
click node_session_db "https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/backend/src/modules/identity/authentication/infrastructure/persistence/prisma-session.repository.ts"
click node_email_jobs "https://github.com/mohmmdmahdiashouri/lmsplatform/tree/develop/backend/src/modules/identity/authentication/infrastructure/email"
click node_authorization "https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/backend/src/modules/identity/authorization/application/services/authorization.service.ts"
click node_school_controller "https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/backend/src/modules/identity/school-management/presentation/controllers/school.controller.ts"
click node_school_handler "https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/backend/src/modules/identity/school-management/application/commands/create-school.handler.ts"
click node_school_store "https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/backend/src/modules/identity/school-management/infrastructure/persistence/prisma-school.repository.ts"
click node_outbox "https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/backend/src/shared/common/infrastructure/outbox-processor.service.ts"
click node_email_sender "https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/backend/src/shared/email/smtp-email.sender.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_auth_ui,node_auth_hooks,node_auth_service,node_user toneBlue
class node_auth_controller,node_session_controller,node_verify_controller,node_auth_commands,node_auth_queries,node_auth_service_backend,node_verification_service,node_session_repo,node_session_db,node_email_jobs toneAmber
class node_authorization,node_school_controller,node_school_handler,node_school_store toneMint
class node_backend_entry,node_app_module,node_outbox,node_email_sender toneRose
class node_api_client,node_axios,node_fetch,node_auth_store toneIndigo
```

## Components

### Frontend Experience

- [Auth screens](https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/frontend/src/app/(public)/auth/page.tsx): `frontend/src/app/(public)/auth/page.tsx`
- [Auth hooks](https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/frontend/src/features/authentication/hooks/useAuth.ts): `frontend/src/features/authentication/hooks/useAuth.ts`
- [Auth service](https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/frontend/src/features/authentication/services/auth.service.ts): `frontend/src/features/authentication/services/auth.service.ts`

### Authentication

- [Authentication routes](https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/backend/src/modules/identity/authentication/presentation/controllers/authentication.controller.ts): `backend/src/modules/identity/authentication/presentation/controllers/authentication.controller.ts`
- [Session routes](https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/backend/src/modules/identity/authentication/presentation/controllers/session.controller.ts): `backend/src/modules/identity/authentication/presentation/controllers/session.controller.ts`
- [Verification routes](https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/backend/src/modules/identity/authentication/presentation/controllers/verification.controller.ts): `backend/src/modules/identity/authentication/presentation/controllers/verification.controller.ts`
- [Auth commands](https://github.com/mohmmdmahdiashouri/lmsplatform/tree/develop/backend/src/modules/identity/authentication/application/commands): `backend/src/modules/identity/authentication/application/commands`
- [Auth queries](https://github.com/mohmmdmahdiashouri/lmsplatform/tree/develop/backend/src/modules/identity/authentication/application/queries): `backend/src/modules/identity/authentication/application/queries`
- [Session service](https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/backend/src/modules/identity/authentication/application/services/authentication.service.ts): `backend/src/modules/identity/authentication/application/services/authentication.service.ts`
- [Verification service](https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/backend/src/modules/identity/authentication/application/services/verification-token.service.ts): `backend/src/modules/identity/authentication/application/services/verification-token.service.ts`
- [Session cache](https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/backend/src/modules/identity/authentication/infrastructure/persistence/cached-session.repository.ts): `backend/src/modules/identity/authentication/infrastructure/persistence/cached-session.repository.ts`
- [Session records](https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/backend/src/modules/identity/authentication/infrastructure/persistence/prisma-session.repository.ts): `backend/src/modules/identity/authentication/infrastructure/persistence/prisma-session.repository.ts`
- [Verification email](https://github.com/mohmmdmahdiashouri/lmsplatform/tree/develop/backend/src/modules/identity/authentication/infrastructure/email): `backend/src/modules/identity/authentication/infrastructure/email`

### Identity Management

- [Role authorization](https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/backend/src/modules/identity/authorization/application/services/authorization.service.ts): `backend/src/modules/identity/authorization/application/services/authorization.service.ts`
- [School routes](https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/backend/src/modules/identity/school-management/presentation/controllers/school.controller.ts): `backend/src/modules/identity/school-management/presentation/controllers/school.controller.ts`
- [Create school](https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/backend/src/modules/identity/school-management/application/commands/create-school.handler.ts): `backend/src/modules/identity/school-management/application/commands/create-school.handler.ts`
- [School persistence](https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/backend/src/modules/identity/school-management/infrastructure/persistence/prisma-school.repository.ts): `backend/src/modules/identity/school-management/infrastructure/persistence/prisma-school.repository.ts`

### Shared Backend Services

- [Backend entry](https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/backend/src/main.ts): `backend/src/main.ts`
- [Application modules](https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/backend/src/app.module.ts): `backend/src/app.module.ts`
- [Outbox processing](https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/backend/src/shared/common/infrastructure/outbox-processor.service.ts): `backend/src/shared/common/infrastructure/outbox-processor.service.ts`
- [SMTP sender](https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/backend/src/shared/email/smtp-email.sender.ts): `backend/src/shared/email/smtp-email.sender.ts`

### API Client

- [API client](https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/frontend/src/shared/features/api-client/lib/http-client.ts): `frontend/src/shared/features/api-client/lib/http-client.ts`
- [Browser transport](https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/frontend/src/shared/features/api-client/lib/axios-client.ts): `frontend/src/shared/features/api-client/lib/axios-client.ts`
- [Server transport](https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/frontend/src/shared/features/api-client/lib/fetch-client.ts): `frontend/src/shared/features/api-client/lib/fetch-client.ts`
- [Token store](https://github.com/mohmmdmahdiashouri/lmsplatform/blob/develop/frontend/src/shared/features/api-client/lib/auth-store.ts): `frontend/src/shared/features/api-client/lib/auth-store.ts`

### Other components

- **LMS user**

## Connections

- LMS user → Auth screens: uses
- Auth screens → Auth hooks: uses
- Auth hooks → Auth service: calls (evidence: `frontend/src/features/authentication/hooks/useAuth.ts`)
- Auth service → API client: sends requests (evidence: `frontend/src/features/authentication/services/auth.service.ts`)
- API client → Browser transport: dispatches CSR (evidence: `frontend/src/shared/features/api-client/lib/http-client.ts`)
- API client → Server transport: dispatches SSR (evidence: `frontend/src/shared/features/api-client/lib/http-client.ts`)
- Browser transport → Token store: reads token (evidence: `frontend/src/shared/features/api-client/lib/axios-client.ts`)
- Auth service → Authentication routes: calls HTTP routes (evidence: `frontend/src/features/authentication/services/auth.service.ts`)
- Backend entry → Application modules: starts (evidence: `backend/src/main.ts`)
- Authentication routes → Auth commands: dispatches commands (evidence: `backend/src/modules/identity/authentication/presentation/controllers/authentication.controller.ts`)
- Authentication routes → Auth queries: dispatches queries (evidence: `backend/src/modules/identity/authentication/presentation/controllers/authentication.controller.ts`)
- Session service → Session cache: uses repository (evidence: `backend/src/modules/identity/authentication/application/services/authentication.service.ts`)
- Session cache → Session records: reads and writes (evidence: `backend/src/modules/identity/authentication/infrastructure/persistence/cached-session.repository.ts`)
- School routes → Create school: dispatches command (evidence: `backend/src/modules/identity/school-management/presentation/controllers/school.controller.ts`)
- Create school → School persistence: uses repository
- Verification email → SMTP sender: sends email
