# donfreddy/payskool architecture

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

- Interactive diagram: https://gitdiagram.com/donfreddy/payskool
- Repository: https://github.com/donfreddy/payskool

## Overview

PAYSKOOL is a school-fee management and collection platform with a parent-facing payment experience, school administration tools, a marketing site, and a global platform-admin interface. The visible parent workflow is selecting a child, reviewing balances and installments, then opening a payment flow or viewing receipts. School workflows cover student and fee administration, cash collection, payments, receipts, reporting, notifications, and settings. The school app’s listed data adapters are mocks, and the sampled API exposes only a hello endpoint; the intended production backend and persistence flows are therefore not established by the inspected source.

Main entry points: [`apps/parent/src/App.tsx`](https://github.com/donfreddy/payskool/blob/main/apps/parent/src/App.tsx) (Parent app), [`apps/api/src/app.controller.ts`](https://github.com/donfreddy/payskool/blob/main/apps/api/src/app.controller.ts) (REST / GraphQL API), [`apps/parent/src/components/InstallmentsTimeline.tsx`](https://github.com/donfreddy/payskool/blob/main/apps/parent/src/components/InstallmentsTimeline.tsx) (Installments), [`packages/api-client/src/client.ts`](https://github.com/donfreddy/payskool/blob/main/packages/api-client/src/client.ts) (Typed API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_parent["Parent experience"]
  node_parent_app["Parent app<br/>[App.tsx]"]
  node_student_context["Active student"]
  node_payment_flow["Payment flow"]
  node_installments["Installments"]
  node_parent_receipts["Receipts view<br/>[ReceiptsView.tsx]"]
  node_parent_students["Children view<br/>[StudentsView.tsx]"]
  node_parent_support["Support view<br/>[SupportView.tsx]"]
end

subgraph group_school["School operations"]
  node_school_dashboard["School dashboard<br/>[page.tsx]"]
  node_student_admin["Student admin"]
  node_student_import["Student import"]
  node_fee_admin["Fee schedules"]
  node_cashier["Cashier"]
  node_payments["Online payments"]
  node_receipts["School receipts"]
  node_transactions["Transaction ledger"]
  node_reports["Collection reports"]
  node_notifications["Notifications"]
  node_school_settings["School settings"]
  node_members["School members"]
end

subgraph group_platform["Platform services"]
  node_platform_admin["Platform admin<br/>[page.tsx]"]
  node_api["REST / GraphQL API<br/>[app.controller.ts]"]
  node_database[("Prisma database package<br/>[client.ts]")]
  node_api_client["Typed API client<br/>[client.ts]"]
  node_shared["Shared types and validators<br/>[auth.ts]"]
end

subgraph group_public["Public presence"]
  node_marketing["Marketing website<br/>[page.tsx]"]
end

node_parent_actor(("Parent"))
node_school_actor(("School staff"))

node_parent_actor -->|"uses"| node_parent_app
node_parent_app -->|"reads student"| node_student_context
node_parent_app -->|"renders"| node_installments
node_installments -->|"requests payment"| node_parent_app
node_parent_app -->|"opens"| node_payment_flow
node_parent_app -->|"renders"| node_parent_receipts
node_parent_app -->|"renders"| node_parent_students
node_parent_app -->|"renders"| node_parent_support
node_school_actor -->|"uses"| node_school_dashboard
node_school_actor -->|"manages students"| node_student_admin
node_school_actor -->|"imports students"| node_student_import
node_school_actor -->|"manages fees"| node_fee_admin
node_school_actor -->|"records cash"| node_cashier
node_school_actor -->|"manages payments"| node_payments
node_school_actor -->|"manages receipts"| node_receipts
node_school_actor -->|"reviews transactions"| node_transactions
node_school_actor -->|"reviews collections"| node_reports
node_school_actor -->|"configures alerts"| node_notifications
node_school_actor -->|"configures school"| node_school_settings
node_school_actor -->|"manages members"| node_members
node_platform_admin -->|"administers platform"| node_school_actor
node_parent_actor -.->|"visits"| node_marketing
node_school_actor -.->|"uses services"| node_api
node_api -.->|"persists data"| node_database
node_parent_app -.->|"calls backend"| node_api_client
node_api_client -.->|"sends requests"| node_api
node_api -.->|"uses schemas"| node_shared

click node_parent_app "https://github.com/donfreddy/payskool/blob/main/apps/parent/src/App.tsx"
click node_student_context "https://github.com/donfreddy/payskool/blob/main/apps/parent/src/contexts/ActiveStudentContext.tsx"
click node_payment_flow "https://github.com/donfreddy/payskool/blob/main/apps/parent/src/components/PaymentFlowModal.tsx"
click node_installments "https://github.com/donfreddy/payskool/blob/main/apps/parent/src/components/InstallmentsTimeline.tsx"
click node_parent_receipts "https://github.com/donfreddy/payskool/blob/main/apps/parent/src/views/ReceiptsView.tsx"
click node_parent_students "https://github.com/donfreddy/payskool/blob/main/apps/parent/src/views/StudentsView.tsx"
click node_parent_support "https://github.com/donfreddy/payskool/blob/main/apps/parent/src/views/SupportView.tsx"
click node_school_dashboard "https://github.com/donfreddy/payskool/blob/main/apps/school/src/app/(dashboard)/%5BschoolId%5D/dashboard/page.tsx"
click node_student_admin "https://github.com/donfreddy/payskool/tree/main/apps/school/src/features/students"
click node_student_import "https://github.com/donfreddy/payskool/tree/main/apps/school/src/features/students/import"
click node_fee_admin "https://github.com/donfreddy/payskool/tree/main/apps/school/src/features/fees"
click node_cashier "https://github.com/donfreddy/payskool/tree/main/apps/school/src/features/cashier"
click node_payments "https://github.com/donfreddy/payskool/tree/main/apps/school/src/features/payments"
click node_receipts "https://github.com/donfreddy/payskool/tree/main/apps/school/src/features/receipts"
click node_transactions "https://github.com/donfreddy/payskool/tree/main/apps/school/src/features/transactions"
click node_reports "https://github.com/donfreddy/payskool/tree/main/apps/school/src/features/reports"
click node_notifications "https://github.com/donfreddy/payskool/tree/main/apps/school/src/features/notifications"
click node_school_settings "https://github.com/donfreddy/payskool/tree/main/apps/school/src/features/settings"
click node_members "https://github.com/donfreddy/payskool/tree/main/apps/school/src/features/members"
click node_platform_admin "https://github.com/donfreddy/payskool/blob/main/apps/platform/src/app/page.tsx"
click node_api "https://github.com/donfreddy/payskool/blob/main/apps/api/src/app.controller.ts"
click node_database "https://github.com/donfreddy/payskool/blob/main/packages/db/src/client.ts"
click node_api_client "https://github.com/donfreddy/payskool/blob/main/packages/api-client/src/client.ts"
click node_shared "https://github.com/donfreddy/payskool/blob/main/packages/shared/src/validators/auth.ts"
click node_marketing "https://github.com/donfreddy/payskool/blob/main/apps/marketing/src/app/%5Blocale%5D/page.tsx"

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_parent_app,node_student_context,node_payment_flow,node_installments,node_parent_receipts,node_parent_students,node_parent_support toneBlue
class node_school_dashboard,node_student_admin,node_student_import,node_fee_admin,node_cashier,node_payments,node_receipts,node_transactions,node_reports,node_notifications,node_school_settings,node_members toneAmber
class node_platform_admin,node_api,node_database,node_api_client,node_shared toneMint
class node_marketing toneRose
class node_parent_actor,node_school_actor toneIndigo
```

## Components

### Parent experience

- [Parent app](https://github.com/donfreddy/payskool/blob/main/apps/parent/src/App.tsx): `apps/parent/src/App.tsx`
- [Active student](https://github.com/donfreddy/payskool/blob/main/apps/parent/src/contexts/ActiveStudentContext.tsx): `apps/parent/src/contexts/ActiveStudentContext.tsx`
- [Payment flow](https://github.com/donfreddy/payskool/blob/main/apps/parent/src/components/PaymentFlowModal.tsx): `apps/parent/src/components/PaymentFlowModal.tsx`
- [Installments](https://github.com/donfreddy/payskool/blob/main/apps/parent/src/components/InstallmentsTimeline.tsx): `apps/parent/src/components/InstallmentsTimeline.tsx`
- [Receipts view](https://github.com/donfreddy/payskool/blob/main/apps/parent/src/views/ReceiptsView.tsx): `apps/parent/src/views/ReceiptsView.tsx`
- [Children view](https://github.com/donfreddy/payskool/blob/main/apps/parent/src/views/StudentsView.tsx): `apps/parent/src/views/StudentsView.tsx`
- [Support view](https://github.com/donfreddy/payskool/blob/main/apps/parent/src/views/SupportView.tsx): `apps/parent/src/views/SupportView.tsx`

### School operations

- [School dashboard](https://github.com/donfreddy/payskool/blob/main/apps/school/src/app/(dashboard)/%5BschoolId%5D/dashboard/page.tsx): `apps/school/src/app/(dashboard)/[schoolId]/dashboard/page.tsx`
- [Student admin](https://github.com/donfreddy/payskool/tree/main/apps/school/src/features/students): `apps/school/src/features/students`
- [Student import](https://github.com/donfreddy/payskool/tree/main/apps/school/src/features/students/import): `apps/school/src/features/students/import`
- [Fee schedules](https://github.com/donfreddy/payskool/tree/main/apps/school/src/features/fees): `apps/school/src/features/fees`
- [Cashier](https://github.com/donfreddy/payskool/tree/main/apps/school/src/features/cashier): `apps/school/src/features/cashier`
- [Online payments](https://github.com/donfreddy/payskool/tree/main/apps/school/src/features/payments): `apps/school/src/features/payments`
- [School receipts](https://github.com/donfreddy/payskool/tree/main/apps/school/src/features/receipts): `apps/school/src/features/receipts`
- [Transaction ledger](https://github.com/donfreddy/payskool/tree/main/apps/school/src/features/transactions): `apps/school/src/features/transactions`
- [Collection reports](https://github.com/donfreddy/payskool/tree/main/apps/school/src/features/reports): `apps/school/src/features/reports`
- [Notifications](https://github.com/donfreddy/payskool/tree/main/apps/school/src/features/notifications): `apps/school/src/features/notifications`
- [School settings](https://github.com/donfreddy/payskool/tree/main/apps/school/src/features/settings): `apps/school/src/features/settings`
- [School members](https://github.com/donfreddy/payskool/tree/main/apps/school/src/features/members): `apps/school/src/features/members`

### Platform services

- [Platform admin](https://github.com/donfreddy/payskool/blob/main/apps/platform/src/app/page.tsx): `apps/platform/src/app/page.tsx`
- [REST / GraphQL API](https://github.com/donfreddy/payskool/blob/main/apps/api/src/app.controller.ts): `apps/api/src/app.controller.ts`
- [Prisma database package](https://github.com/donfreddy/payskool/blob/main/packages/db/src/client.ts): `packages/db/src/client.ts`
- [Typed API client](https://github.com/donfreddy/payskool/blob/main/packages/api-client/src/client.ts): `packages/api-client/src/client.ts`
- [Shared types and validators](https://github.com/donfreddy/payskool/blob/main/packages/shared/src/validators/auth.ts): `packages/shared/src/validators/auth.ts`

### Public presence

- [Marketing website](https://github.com/donfreddy/payskool/blob/main/apps/marketing/src/app/%5Blocale%5D/page.tsx): `apps/marketing/src/app/[locale]/page.tsx`

### Other components

- **Parent**
- **School staff**

## Connections

- Parent → Parent app: uses (evidence: `README.md`)
- Parent app → Active student: reads student (evidence: `apps/parent/src/App.tsx`)
- Parent app → Installments: renders (evidence: `apps/parent/src/App.tsx`)
- Installments → Parent app: requests payment (evidence: `apps/parent/src/components/InstallmentsTimeline.tsx`)
- Parent app → Payment flow: opens (evidence: `apps/parent/src/App.tsx`)
- Parent app → Receipts view: renders (evidence: `apps/parent/src/App.tsx`)
- Parent app → Children view: renders (evidence: `apps/parent/src/App.tsx`)
- Parent app → Support view: renders (evidence: `apps/parent/src/App.tsx`)
- School staff → School dashboard: uses (evidence: `README.md`)
- School staff → Student admin: manages students (evidence: `README.md`)
- School staff → Student import: imports students (evidence: `README.md`)
- School staff → Fee schedules: manages fees (evidence: `README.md`)
- School staff → Cashier: records cash (evidence: `README.md`)
- School staff → Online payments: manages payments (evidence: `README.md`)
- School staff → School receipts: manages receipts (evidence: `README.md`)
- School staff → Transaction ledger: reviews transactions (evidence: `README.md`)
- School staff → Collection reports: reviews collections (evidence: `README.md`)
- School staff → Notifications: configures alerts (evidence: `README.md`)
- School staff → School settings: configures school (evidence: `README.md`)
- School staff → School members: manages members (evidence: `README.md`)
- Platform admin → School staff: administers platform (evidence: `README.md`)
- Parent → Marketing website: visits
- School staff → REST / GraphQL API: uses services
- REST / GraphQL API → Prisma database package: persists data
- Parent app → Typed API client: calls backend
- Typed API client → REST / GraphQL API: sends requests
- REST / GraphQL API → Shared types and validators: uses schemas
