# rumankl/jhee-passa architecture

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

- Interactive diagram: https://gitdiagram.com/rumankl/jhee-passa
- Repository: https://github.com/rumankl/jhee-passa

## Overview

Jhee Passa is a monthly-savings portal for members and administrators. The main member workflow is registration or sign-in, viewing the dashboard, and submitting a deposit; a scheduled endpoint checks monthly deposits and issues penalties. Separate dashboard areas support loan applications and reviews, member administration, notifications, and reference information. The sampled code shows Firebase authentication, Firestore, and Storage access; several dashboard pages are present in the tree but their implementation was not sampled.

Main entry points: [`src/contexts/AuthContext.tsx`](https://github.com/rumankl/jhee-passa/blob/main/src/contexts/AuthContext.tsx) (Auth and roles), [`src/app/login/page.tsx`](https://github.com/rumankl/jhee-passa/blob/main/src/app/login/page.tsx) (Sign-in / registration), [`src/app/dashboard/loans/page.tsx`](https://github.com/rumankl/jhee-passa/blob/main/src/app/dashboard/loans/page.tsx) (Loan applications), [`src/components/Sidebar.tsx`](https://github.com/rumankl/jhee-passa/blob/main/src/components/Sidebar.tsx) (Dashboard navigation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and navigation"]
  node_landing["Landing page<br/>[page.tsx]"]
  node_login["Sign-in / registration<br/>[page.tsx]"]
  node_auth["Auth and roles<br/>[AuthContext.tsx]"]
  node_sidebar["Dashboard navigation<br/>[Sidebar.tsx]"]
end

subgraph group_savings["Savings and penalties"]
  node_dashboard["Dashboard<br/>[page.tsx]"]
  node_depositapi["Deposit endpoint<br/>[route.ts]"]
  node_cron["Monthly penalty check<br/>[route.ts]"]
  node_penalties["Penalty view<br/>[page.tsx]"]
end

subgraph group_lending["Loans"]
  node_loans["Loan applications<br/>[page.tsx]"]
end

subgraph group_admin["Administration and member tools"]
  node_members["Member administration<br/>[page.tsx]"]
  node_notifications["Notifications<br/>[page.tsx]"]
  node_profile["Profile<br/>[page.tsx]"]
  node_profit["Profit view<br/>[page.tsx]"]
  node_wiki["Savings wiki<br/>[page.tsx]"]
end

node_visitor(("Visitor / member / admin"))
node_firebase["Firebase client<br/>[firebase.ts]"]
node_firebaseadmin["Firebase Admin<br/>[firebaseAdmin.ts]"]
node_firestore[("Firestore")]
node_storage[("Firebase Storage")]
node_scheduled(("Scheduler"))

node_visitor -->|"opens"| node_landing
node_landing -->|"links to"| node_login
node_visitor -->|"registers or signs in"| node_login
node_login -->|"authenticates"| node_firebase
node_login -->|"writes user"| node_firestore
node_auth -->|"tracks auth"| node_firebase
node_auth -->|"reads user profile"| node_firestore
node_sidebar -->|"reads identity"| node_auth
node_sidebar -->|"subscribes to notifications"| node_firestore
node_sidebar -->|"signs out to"| node_login
node_visitor -->|"opens"| node_dashboard
node_dashboard -->|"reads user"| node_auth
node_dashboard -->|"submits deposit"| node_depositapi
node_depositapi -->|"verifies token"| node_firebaseadmin
node_depositapi -->|"records deposit"| node_firestore
node_scheduled -.->|"triggers"| node_cron
node_cron -->|"uses"| node_firebaseadmin
node_cron -->|"reads deposits and members; writes penalties"| node_firestore
node_visitor -->|"applies or reviews"| node_loans
node_loans -->|"reads user"| node_auth
node_loans -->|"reads and updates loans"| node_firestore
node_loans -->|"uploads loan documents"| node_storage
node_visitor -->|"administers members"| node_members
node_members -->|"checks role"| node_auth
node_members -->|"reads and updates users; writes notifications"| node_firestore
node_visitor -->|"views or manages messages"| node_notifications
node_notifications -->|"reads user"| node_auth
node_notifications -->|"reads and updates notifications"| node_firestore
node_visitor -->|"views penalties"| node_penalties
node_visitor -->|"opens"| node_profile
node_visitor -->|"opens"| node_profit
node_visitor -->|"opens"| node_wiki
node_visitor -.->|"uses client services"| node_firebase

click node_landing "https://github.com/rumankl/jhee-passa/blob/main/src/app/page.tsx"
click node_login "https://github.com/rumankl/jhee-passa/blob/main/src/app/login/page.tsx"
click node_auth "https://github.com/rumankl/jhee-passa/blob/main/src/contexts/AuthContext.tsx"
click node_sidebar "https://github.com/rumankl/jhee-passa/blob/main/src/components/Sidebar.tsx"
click node_dashboard "https://github.com/rumankl/jhee-passa/blob/main/src/app/dashboard/page.tsx"
click node_depositapi "https://github.com/rumankl/jhee-passa/blob/main/src/app/api/deposits/route.ts"
click node_cron "https://github.com/rumankl/jhee-passa/blob/main/src/app/api/penalties/cron/route.ts"
click node_penalties "https://github.com/rumankl/jhee-passa/blob/main/src/app/dashboard/penalties/page.tsx"
click node_loans "https://github.com/rumankl/jhee-passa/blob/main/src/app/dashboard/loans/page.tsx"
click node_members "https://github.com/rumankl/jhee-passa/blob/main/src/app/dashboard/members/page.tsx"
click node_notifications "https://github.com/rumankl/jhee-passa/blob/main/src/app/dashboard/notifications/page.tsx"
click node_profile "https://github.com/rumankl/jhee-passa/blob/main/src/app/dashboard/profile/page.tsx"
click node_profit "https://github.com/rumankl/jhee-passa/blob/main/src/app/dashboard/profit/page.tsx"
click node_wiki "https://github.com/rumankl/jhee-passa/blob/main/src/app/dashboard/wiki/page.tsx"
click node_firebase "https://github.com/rumankl/jhee-passa/blob/main/src/lib/firebase.ts"
click node_firebaseadmin "https://github.com/rumankl/jhee-passa/blob/main/src/lib/firebaseAdmin.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_landing,node_login,node_auth,node_sidebar,node_firebase toneBlue
class node_dashboard,node_depositapi,node_cron,node_penalties,node_firestore,node_storage toneAmber
class node_loans toneMint
class node_members,node_notifications,node_profile,node_profit,node_wiki,node_scheduled toneRose
class node_visitor toneIndigo
class node_firebaseadmin toneTeal
```

## Components

### Access and navigation

- [Landing page](https://github.com/rumankl/jhee-passa/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Sign-in / registration](https://github.com/rumankl/jhee-passa/blob/main/src/app/login/page.tsx): `src/app/login/page.tsx`
- [Auth and roles](https://github.com/rumankl/jhee-passa/blob/main/src/contexts/AuthContext.tsx): `src/contexts/AuthContext.tsx`
- [Dashboard navigation](https://github.com/rumankl/jhee-passa/blob/main/src/components/Sidebar.tsx): `src/components/Sidebar.tsx`

### Savings and penalties

- [Dashboard](https://github.com/rumankl/jhee-passa/blob/main/src/app/dashboard/page.tsx): `src/app/dashboard/page.tsx`
- [Deposit endpoint](https://github.com/rumankl/jhee-passa/blob/main/src/app/api/deposits/route.ts): `src/app/api/deposits/route.ts`
- [Monthly penalty check](https://github.com/rumankl/jhee-passa/blob/main/src/app/api/penalties/cron/route.ts): `src/app/api/penalties/cron/route.ts`
- [Penalty view](https://github.com/rumankl/jhee-passa/blob/main/src/app/dashboard/penalties/page.tsx): `src/app/dashboard/penalties/page.tsx`

### Loans

- [Loan applications](https://github.com/rumankl/jhee-passa/blob/main/src/app/dashboard/loans/page.tsx): `src/app/dashboard/loans/page.tsx`

### Administration and member tools

- [Member administration](https://github.com/rumankl/jhee-passa/blob/main/src/app/dashboard/members/page.tsx): `src/app/dashboard/members/page.tsx`
- [Notifications](https://github.com/rumankl/jhee-passa/blob/main/src/app/dashboard/notifications/page.tsx): `src/app/dashboard/notifications/page.tsx`
- [Profile](https://github.com/rumankl/jhee-passa/blob/main/src/app/dashboard/profile/page.tsx): `src/app/dashboard/profile/page.tsx`
- [Profit view](https://github.com/rumankl/jhee-passa/blob/main/src/app/dashboard/profit/page.tsx): `src/app/dashboard/profit/page.tsx`
- [Savings wiki](https://github.com/rumankl/jhee-passa/blob/main/src/app/dashboard/wiki/page.tsx): `src/app/dashboard/wiki/page.tsx`

### Other components

- **Visitor / member / admin**
- [Firebase client](https://github.com/rumankl/jhee-passa/blob/main/src/lib/firebase.ts): `src/lib/firebase.ts`
- [Firebase Admin](https://github.com/rumankl/jhee-passa/blob/main/src/lib/firebaseAdmin.ts): `src/lib/firebaseAdmin.ts`
- **Firestore**
- **Firebase Storage**
- **Scheduler**

## Connections

- Visitor / member / admin → Landing page: opens
- Landing page → Sign-in / registration: links to
- Visitor / member / admin → Sign-in / registration: registers or signs in
- Sign-in / registration → Firebase client: authenticates
- Sign-in / registration → Firestore: writes user
- Auth and roles → Firebase client: tracks auth
- Auth and roles → Firestore: reads user profile
- Dashboard navigation → Auth and roles: reads identity
- Dashboard navigation → Firestore: subscribes to notifications
- Dashboard navigation → Sign-in / registration: signs out to
- Visitor / member / admin → Dashboard: opens
- Dashboard → Auth and roles: reads user
- Dashboard → Deposit endpoint: submits deposit
- Deposit endpoint → Firebase Admin: verifies token
- Deposit endpoint → Firestore: records deposit
- Scheduler → Monthly penalty check: triggers
- Monthly penalty check → Firebase Admin: uses
- Monthly penalty check → Firestore: reads deposits and members; writes penalties
- Visitor / member / admin → Loan applications: applies or reviews
- Loan applications → Auth and roles: reads user
- Loan applications → Firestore: reads and updates loans
- Loan applications → Firebase Storage: uploads loan documents
- Visitor / member / admin → Member administration: administers members
- Member administration → Auth and roles: checks role
- Member administration → Firestore: reads and updates users; writes notifications
- Visitor / member / admin → Notifications: views or manages messages
- Notifications → Auth and roles: reads user
- Notifications → Firestore: reads and updates notifications
- Visitor / member / admin → Penalty view: views penalties
- Visitor / member / admin → Profile: opens
- Visitor / member / admin → Profit view: opens
- Visitor / member / admin → Savings wiki: opens
- Visitor / member / admin → Firebase client: uses client services
