# ahtisham-1/fee-ease-react architecture

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

- Interactive diagram: https://gitdiagram.com/ahtisham-1/fee-ease-react
- Repository: https://github.com/ahtisham-1/fee-ease-react

## Overview

FeeEase manages school fee collection for administrators and parents. The principal workflow loads school records into the React portal, where administrators enroll students, assign class fees, and promote students; parents review obligations, pay fees, and inspect payment history. The frontend calls FastAPI through shared HTTP services, while route handlers use SQLModel sessions and domain models for persistence; the UI also computes financial summaries and FIFO fee allocation. The README documents dynamic transport pricing and role-based views. Routes and several UI details were not excerpted, so some subsystem links are documented or dashed rather than inferred from imports.

Main entry points: [`frontend/src/App.tsx`](https://github.com/ahtisham-1/fee-ease-react/blob/main/frontend/src/App.tsx) (Admin Portal), [`backend/app/main.py`](https://github.com/ahtisham-1/fee-ease-react/blob/main/backend/app/main.py) (FastAPI Application), [`backend/app/database.py`](https://github.com/ahtisham-1/fee-ease-react/blob/main/backend/app/database.py) (Database Session), [`frontend/src/services/apiClient.ts`](https://github.com/ahtisham-1/fee-ease-react/blob/main/frontend/src/services/apiClient.ts) (HTTP Client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_portal["Role Portals"]
  node_admin["Admin Portal<br/>[App.tsx]"]
  node_parent["Parent Portal<br/>[App.tsx]"]
  node_enrollment["Student Enrollment"]
  node_roster["Class Roster"]
  node_feeassign["Fee Assignment"]
  node_promotion["Class Promotion"]
  node_collections["Collections Summary"]
  node_adminhistory["Admin Payment History"]
  node_parentfees["Fee Review<br/>[FeeDetail.tsx]"]
  node_payform["Fee Payment<br/>[PayFeesForm.tsx]"]
  node_parenthistory["Payment History<br/>[PaymentHistory.tsx]"]
  node_selector["Student Selector"]
end

subgraph group_frontend["UI Services"]
  node_calculation["Fee Calculations<br/>[feeCalculator.ts]"]
  node_client["HTTP Client<br/>[apiClient.ts]"]
  node_studentsvc["Student Service<br/>[studentApi.ts]"]
  node_parentsvc["Parent Service<br/>[parentApi.ts]"]
  node_feesvc["Fee Service<br/>[feeApi.ts]"]
  node_paymentsvc["Payment Service<br/>[paymentApi.ts]"]
end

subgraph group_api["Backend API"]
  node_backend["FastAPI Application<br/>[main.py]"]
  node_auth["Authentication<br/>[auth.py]"]
  node_studentroute["Student Routes<br/>[students.py]"]
  node_parentroute["Parent Routes<br/>[parents.py]"]
  node_feeroute["Fee Routes<br/>[fees.py]"]
  node_paymentroute["Payment Routes<br/>[payments.py]"]
  node_security["Token Security<br/>[security.py]"]
end

subgraph group_domain["Domain and Storage"]
  node_database["Database Session<br/>[database.py]"]
  node_students[("Student Records<br/>[student.py]")]
  node_parents[("Parent Records<br/>[parent.py]")]
  node_fees[("Fee Obligations<br/>[fee.py]")]
  node_payments[("Payment Records<br/>[payment.py]")]
  node_users[("User Records<br/>[user.py]")]
end

node_admin -->|"loads and updates"| node_studentsvc
node_admin -->|"loads and updates"| node_parentsvc
node_admin -->|"loads and assigns"| node_feesvc
node_admin -->|"loads payments"| node_paymentsvc
node_admin -->|"summarizes balances"| node_calculation
node_admin -->|"renders"| node_enrollment
node_admin -->|"renders"| node_roster
node_admin -->|"renders"| node_feeassign
node_admin -->|"renders"| node_promotion
node_admin -->|"renders"| node_collections
node_admin -->|"renders"| node_adminhistory
node_parent -.->|"renders"| node_parentfees
node_parent -.->|"renders"| node_selector
node_parent -.->|"renders"| node_payform
node_parent -.->|"renders"| node_parenthistory
node_payform -.->|"submits payment"| node_paymentsvc
node_studentsvc -->|"requests through"| node_client
node_parentsvc -->|"requests through"| node_client
node_feesvc -->|"requests through"| node_client
node_paymentsvc -->|"requests through"| node_client
node_client -.->|"HTTP requests"| node_backend
node_backend -->|"creates tables"| node_database
node_backend -->|"registers routes"| node_studentroute
node_backend -->|"registers routes"| node_parentroute
node_backend -->|"registers routes"| node_feeroute
node_backend -->|"registers routes"| node_paymentroute
node_backend -->|"registers routes"| node_auth
node_studentroute -->|"uses sessions"| node_database
node_parentroute -->|"uses sessions"| node_database
node_feeroute -->|"uses sessions"| node_database
node_paymentroute -->|"uses sessions"| node_database
node_auth -->|"uses sessions"| node_database
node_studentroute -->|"reads and writes"| node_students
node_parentroute -->|"reads and writes"| node_parents
node_feeroute -->|"reads and writes"| node_fees
node_paymentroute -->|"reads and writes"| node_payments
node_auth -->|"authenticates users"| node_users
node_studentroute -->|"checks access"| node_security
node_parentroute -->|"checks access"| node_security
node_feeroute -->|"checks access"| node_security
node_paymentroute -->|"checks access"| node_security
node_auth -->|"uses token tools"| node_security
node_students -->|"relates obligations"| node_fees
node_students -->|"relates guardian"| node_parents
node_parents -->|"relates children"| node_students
node_calculation -.->|"allocates FIFO"| node_fees

click node_admin "https://github.com/ahtisham-1/fee-ease-react/blob/main/frontend/src/App.tsx"
click node_parent "https://github.com/ahtisham-1/fee-ease-react/blob/main/frontend/src/App.tsx"
click node_enrollment "https://github.com/ahtisham-1/fee-ease-react/blob/main/frontend/src/components/admin/AdminAddStudentForm.tsx"
click node_roster "https://github.com/ahtisham-1/fee-ease-react/blob/main/frontend/src/components/admin/AdminClassRoster.tsx"
click node_feeassign "https://github.com/ahtisham-1/fee-ease-react/blob/main/frontend/src/components/admin/AdminAssignFeesForm.tsx"
click node_promotion "https://github.com/ahtisham-1/fee-ease-react/blob/main/frontend/src/components/admin/AdminPromoteClass.tsx"
click node_collections "https://github.com/ahtisham-1/fee-ease-react/blob/main/frontend/src/components/admin/AdminCollectionsSummary.tsx"
click node_adminhistory "https://github.com/ahtisham-1/fee-ease-react/blob/main/frontend/src/components/admin/AdminPaymentHistory.tsx"
click node_parentfees "https://github.com/ahtisham-1/fee-ease-react/blob/main/frontend/src/components/parent/FeeDetail.tsx"
click node_payform "https://github.com/ahtisham-1/fee-ease-react/blob/main/frontend/src/components/parent/PayFeesForm.tsx"
click node_parenthistory "https://github.com/ahtisham-1/fee-ease-react/blob/main/frontend/src/components/parent/PaymentHistory.tsx"
click node_selector "https://github.com/ahtisham-1/fee-ease-react/blob/main/frontend/src/components/parent/ParentStudentSelector.tsx"
click node_calculation "https://github.com/ahtisham-1/fee-ease-react/blob/main/frontend/src/utils/feeCalculator.ts"
click node_client "https://github.com/ahtisham-1/fee-ease-react/blob/main/frontend/src/services/apiClient.ts"
click node_studentsvc "https://github.com/ahtisham-1/fee-ease-react/blob/main/frontend/src/services/studentApi.ts"
click node_parentsvc "https://github.com/ahtisham-1/fee-ease-react/blob/main/frontend/src/services/parentApi.ts"
click node_feesvc "https://github.com/ahtisham-1/fee-ease-react/blob/main/frontend/src/services/feeApi.ts"
click node_paymentsvc "https://github.com/ahtisham-1/fee-ease-react/blob/main/frontend/src/services/paymentApi.ts"
click node_backend "https://github.com/ahtisham-1/fee-ease-react/blob/main/backend/app/main.py"
click node_auth "https://github.com/ahtisham-1/fee-ease-react/blob/main/backend/app/routes/auth.py"
click node_studentroute "https://github.com/ahtisham-1/fee-ease-react/blob/main/backend/app/routes/students.py"
click node_parentroute "https://github.com/ahtisham-1/fee-ease-react/blob/main/backend/app/routes/parents.py"
click node_feeroute "https://github.com/ahtisham-1/fee-ease-react/blob/main/backend/app/routes/fees.py"
click node_paymentroute "https://github.com/ahtisham-1/fee-ease-react/blob/main/backend/app/routes/payments.py"
click node_security "https://github.com/ahtisham-1/fee-ease-react/blob/main/backend/app/security.py"
click node_database "https://github.com/ahtisham-1/fee-ease-react/blob/main/backend/app/database.py"
click node_students "https://github.com/ahtisham-1/fee-ease-react/blob/main/backend/app/models/student.py"
click node_parents "https://github.com/ahtisham-1/fee-ease-react/blob/main/backend/app/models/parent.py"
click node_fees "https://github.com/ahtisham-1/fee-ease-react/blob/main/backend/app/models/fee.py"
click node_payments "https://github.com/ahtisham-1/fee-ease-react/blob/main/backend/app/models/payment.py"
click node_users "https://github.com/ahtisham-1/fee-ease-react/blob/main/backend/app/models/user.py"

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_admin,node_parent,node_enrollment,node_roster,node_feeassign,node_promotion,node_collections,node_adminhistory,node_parentfees,node_payform,node_parenthistory,node_selector toneBlue
class node_calculation,node_client,node_studentsvc,node_parentsvc,node_feesvc,node_paymentsvc toneAmber
class node_backend,node_auth,node_studentroute,node_parentroute,node_feeroute,node_paymentroute,node_security toneMint
class node_database,node_students,node_parents,node_fees,node_payments,node_users toneRose
```

## Components

### Role Portals

- [Admin Portal](https://github.com/ahtisham-1/fee-ease-react/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Parent Portal](https://github.com/ahtisham-1/fee-ease-react/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Student Enrollment](https://github.com/ahtisham-1/fee-ease-react/blob/main/frontend/src/components/admin/AdminAddStudentForm.tsx): `frontend/src/components/admin/AdminAddStudentForm.tsx`
- [Class Roster](https://github.com/ahtisham-1/fee-ease-react/blob/main/frontend/src/components/admin/AdminClassRoster.tsx): `frontend/src/components/admin/AdminClassRoster.tsx`
- [Fee Assignment](https://github.com/ahtisham-1/fee-ease-react/blob/main/frontend/src/components/admin/AdminAssignFeesForm.tsx): `frontend/src/components/admin/AdminAssignFeesForm.tsx`
- [Class Promotion](https://github.com/ahtisham-1/fee-ease-react/blob/main/frontend/src/components/admin/AdminPromoteClass.tsx): `frontend/src/components/admin/AdminPromoteClass.tsx`
- [Collections Summary](https://github.com/ahtisham-1/fee-ease-react/blob/main/frontend/src/components/admin/AdminCollectionsSummary.tsx): `frontend/src/components/admin/AdminCollectionsSummary.tsx`
- [Admin Payment History](https://github.com/ahtisham-1/fee-ease-react/blob/main/frontend/src/components/admin/AdminPaymentHistory.tsx): `frontend/src/components/admin/AdminPaymentHistory.tsx`
- [Fee Review](https://github.com/ahtisham-1/fee-ease-react/blob/main/frontend/src/components/parent/FeeDetail.tsx): `frontend/src/components/parent/FeeDetail.tsx`
- [Fee Payment](https://github.com/ahtisham-1/fee-ease-react/blob/main/frontend/src/components/parent/PayFeesForm.tsx): `frontend/src/components/parent/PayFeesForm.tsx`
- [Payment History](https://github.com/ahtisham-1/fee-ease-react/blob/main/frontend/src/components/parent/PaymentHistory.tsx): `frontend/src/components/parent/PaymentHistory.tsx`
- [Student Selector](https://github.com/ahtisham-1/fee-ease-react/blob/main/frontend/src/components/parent/ParentStudentSelector.tsx): `frontend/src/components/parent/ParentStudentSelector.tsx`

### UI Services

- [Fee Calculations](https://github.com/ahtisham-1/fee-ease-react/blob/main/frontend/src/utils/feeCalculator.ts): `frontend/src/utils/feeCalculator.ts`
- [HTTP Client](https://github.com/ahtisham-1/fee-ease-react/blob/main/frontend/src/services/apiClient.ts): `frontend/src/services/apiClient.ts`
- [Student Service](https://github.com/ahtisham-1/fee-ease-react/blob/main/frontend/src/services/studentApi.ts): `frontend/src/services/studentApi.ts`
- [Parent Service](https://github.com/ahtisham-1/fee-ease-react/blob/main/frontend/src/services/parentApi.ts): `frontend/src/services/parentApi.ts`
- [Fee Service](https://github.com/ahtisham-1/fee-ease-react/blob/main/frontend/src/services/feeApi.ts): `frontend/src/services/feeApi.ts`
- [Payment Service](https://github.com/ahtisham-1/fee-ease-react/blob/main/frontend/src/services/paymentApi.ts): `frontend/src/services/paymentApi.ts`

### Backend API

- [FastAPI Application](https://github.com/ahtisham-1/fee-ease-react/blob/main/backend/app/main.py): `backend/app/main.py`
- [Authentication](https://github.com/ahtisham-1/fee-ease-react/blob/main/backend/app/routes/auth.py): `backend/app/routes/auth.py`
- [Student Routes](https://github.com/ahtisham-1/fee-ease-react/blob/main/backend/app/routes/students.py): `backend/app/routes/students.py`
- [Parent Routes](https://github.com/ahtisham-1/fee-ease-react/blob/main/backend/app/routes/parents.py): `backend/app/routes/parents.py`
- [Fee Routes](https://github.com/ahtisham-1/fee-ease-react/blob/main/backend/app/routes/fees.py): `backend/app/routes/fees.py`
- [Payment Routes](https://github.com/ahtisham-1/fee-ease-react/blob/main/backend/app/routes/payments.py): `backend/app/routes/payments.py`
- [Token Security](https://github.com/ahtisham-1/fee-ease-react/blob/main/backend/app/security.py): `backend/app/security.py`

### Domain and Storage

- [Database Session](https://github.com/ahtisham-1/fee-ease-react/blob/main/backend/app/database.py): `backend/app/database.py`
- [Student Records](https://github.com/ahtisham-1/fee-ease-react/blob/main/backend/app/models/student.py): `backend/app/models/student.py`
- [Parent Records](https://github.com/ahtisham-1/fee-ease-react/blob/main/backend/app/models/parent.py): `backend/app/models/parent.py`
- [Fee Obligations](https://github.com/ahtisham-1/fee-ease-react/blob/main/backend/app/models/fee.py): `backend/app/models/fee.py`
- [Payment Records](https://github.com/ahtisham-1/fee-ease-react/blob/main/backend/app/models/payment.py): `backend/app/models/payment.py`
- [User Records](https://github.com/ahtisham-1/fee-ease-react/blob/main/backend/app/models/user.py): `backend/app/models/user.py`

## Connections

- Admin Portal → Student Service: loads and updates (evidence: `frontend/src/App.tsx`)
- Admin Portal → Parent Service: loads and updates (evidence: `frontend/src/App.tsx`)
- Admin Portal → Fee Service: loads and assigns (evidence: `frontend/src/App.tsx`)
- Admin Portal → Payment Service: loads payments (evidence: `frontend/src/App.tsx`)
- Admin Portal → Fee Calculations: summarizes balances (evidence: `frontend/src/App.tsx`)
- Admin Portal → Student Enrollment: renders (evidence: `frontend/src/App.tsx`)
- Admin Portal → Class Roster: renders (evidence: `frontend/src/App.tsx`)
- Admin Portal → Fee Assignment: renders (evidence: `frontend/src/App.tsx`)
- Admin Portal → Class Promotion: renders (evidence: `frontend/src/App.tsx`)
- Admin Portal → Collections Summary: renders (evidence: `frontend/src/App.tsx`)
- Admin Portal → Admin Payment History: renders (evidence: `frontend/src/App.tsx`)
- Parent Portal → Fee Review: renders (evidence: `frontend/src/App.tsx`)
- Parent Portal → Student Selector: renders (evidence: `frontend/src/App.tsx`)
- Parent Portal → Fee Payment: renders (evidence: `frontend/src/App.tsx`)
- Parent Portal → Payment History: renders (evidence: `frontend/src/App.tsx`)
- Fee Payment → Payment Service: submits payment
- Student Service → HTTP Client: requests through (evidence: `frontend/src/services/studentApi.ts`)
- Parent Service → HTTP Client: requests through (evidence: `frontend/src/services/parentApi.ts`)
- Fee Service → HTTP Client: requests through (evidence: `frontend/src/services/feeApi.ts`)
- Payment Service → HTTP Client: requests through (evidence: `frontend/src/services/paymentApi.ts`)
- HTTP Client → FastAPI Application: HTTP requests
- FastAPI Application → Database Session: creates tables (evidence: `backend/app/main.py`)
- FastAPI Application → Student Routes: registers routes (evidence: `backend/app/main.py`)
- FastAPI Application → Parent Routes: registers routes (evidence: `backend/app/main.py`)
- FastAPI Application → Fee Routes: registers routes (evidence: `backend/app/main.py`)
- FastAPI Application → Payment Routes: registers routes (evidence: `backend/app/main.py`)
- FastAPI Application → Authentication: registers routes (evidence: `backend/app/main.py`)
- Student Routes → Database Session: uses sessions (evidence: `backend/app/routes/students.py`)
- Parent Routes → Database Session: uses sessions (evidence: `backend/app/routes/parents.py`)
- Fee Routes → Database Session: uses sessions (evidence: `backend/app/routes/fees.py`)
- Payment Routes → Database Session: uses sessions (evidence: `backend/app/routes/payments.py`)
- Authentication → Database Session: uses sessions (evidence: `backend/app/routes/auth.py`)
- Student Routes → Student Records: reads and writes (evidence: `backend/app/routes/students.py`)
- Parent Routes → Parent Records: reads and writes (evidence: `backend/app/routes/parents.py`)
- Fee Routes → Fee Obligations: reads and writes (evidence: `backend/app/routes/fees.py`)
- Payment Routes → Payment Records: reads and writes (evidence: `backend/app/routes/payments.py`)
- Authentication → User Records: authenticates users (evidence: `backend/app/routes/auth.py`)
- Student Routes → Token Security: checks access (evidence: `backend/app/routes/students.py`)
- Parent Routes → Token Security: checks access (evidence: `backend/app/routes/parents.py`)
- Fee Routes → Token Security: checks access (evidence: `backend/app/routes/fees.py`)
- Payment Routes → Token Security: checks access (evidence: `backend/app/routes/payments.py`)
- Authentication → Token Security: uses token tools (evidence: `backend/app/routes/auth.py`)
- Student Records → Fee Obligations: relates obligations (evidence: `backend/app/models/student.py`)
- Student Records → Parent Records: relates guardian (evidence: `backend/app/models/student.py`)
- Parent Records → Student Records: relates children (evidence: `backend/app/models/parent.py`)
- Fee Calculations → Fee Obligations: allocates FIFO
