# bhumika2906/sams architecture

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

- Interactive diagram: https://gitdiagram.com/bhumika2906/sams
- Repository: https://github.com/bhumika2906/sams

## Overview

SAMS is an Expo mobile admission app backed by an Express API and MongoDB. Applicants register and verify accounts, complete and submit applications, respond to seat offers, pay admission fees, and receive a checklist and QR pass; faculty verify checklist items, while administrators manage rounds and allotment and management views statistics. The graph preserves these documented capabilities. Sampled route excerpts show parts of application, allotment, payment, and verification behavior; some other feature links are documented in the README rather than verified in source excerpts.

Main entry points: [`mobile/src/api/client.ts`](https://github.com/bhumika2906/sams/blob/main/mobile/src/api/client.ts) (API client), [`server/src/models`](https://github.com/bhumika2906/sams/tree/main/server/src/models) (Admission records), [`server/src/app.ts`](https://github.com/bhumika2906/sams/blob/main/server/src/app.ts) (Express API), [`server/src/services/allotment.service.ts`](https://github.com/bhumika2906/sams/blob/main/server/src/services/allotment.service.ts) (Merit allotment)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mobile["Mobile app"]
  node_auth_screens["Sign-in and registration<br/>[login.tsx]"]
  node_applicant_screens["Application and admission<br/>[application.tsx]"]
  node_admin_screens["Round and allotment tools<br/>[allotment.tsx]"]
  node_faculty_screens["Scan and checklist<br/>[checklist.tsx]"]
  node_management_screens["Management dashboard<br/>[index.tsx]"]
  node_auth_context["Session state<br/>[AuthContext.tsx]"]
  node_api_client["API client<br/>[client.ts]"]
  node_token_store["Token storage<br/>[token.ts]"]
end

subgraph group_api["API and access"]
  node_api_app["Express API<br/>[app.ts]"]
  node_auth_routes["Authentication<br/>[auth.routes.ts]"]
end

subgraph group_admission["Admission lifecycle"]
  node_application_routes["Application workflow"]
  node_round_routes["Rounds and allotment<br/>[round.routes.ts]"]
  node_allotment_service["Merit allotment"]
  node_data_models[("Admission records")]
end

subgraph group_verification["Verification and oversight"]
  node_payment_verify["Payment and verification"]
  node_management_routes["Management statistics"]
  node_notification_service["Notifications"]
end

subgraph group_domain["Shared domain"]
  node_shared_domain["Domain types and rules<br/>[enums.ts]"]
end

node_applicant(("Applicants"))
node_faculty(("Faculty verifiers"))
node_admin(("Administrators"))
node_management_actor(("Management"))
node_mongodb[("MongoDB")]
node_local_uploads[("Local upload storage")]

node_applicant -->|"starts session"| node_auth_screens
node_applicant -->|"manages application"| node_applicant_screens
node_admin -->|"manages rounds"| node_admin_screens
node_faculty -->|"verifies checklist"| node_faculty_screens
node_management_actor -->|"views statistics"| node_management_screens
node_auth_screens -->|"uses session"| node_auth_context
node_applicant_screens -->|"calls API"| node_api_client
node_admin_screens -->|"calls API"| node_api_client
node_faculty_screens -->|"calls API"| node_api_client
node_management_screens -->|"calls API"| node_api_client
node_auth_context -->|"sends auth requests"| node_api_client
node_auth_context -->|"persists session"| node_token_store
node_api_client -->|"reads bearer token"| node_token_store
node_api_client -->|"sends HTTP requests"| node_api_app
node_api_app -->|"mounts routes"| node_auth_routes
node_api_app -->|"mounts routes"| node_application_routes
node_api_app -->|"mounts routes"| node_round_routes
node_api_app -->|"mounts routes"| node_payment_verify
node_api_app -->|"mounts routes"| node_management_routes
node_auth_routes -->|"sends notifications"| node_notification_service
node_application_routes -->|"resolves progress"| node_allotment_service
node_round_routes -->|"runs allocation"| node_allotment_service
node_management_routes -->|"uses allocation"| node_allotment_service
node_application_routes -->|"reads and writes"| node_data_models
node_round_routes -->|"reads and writes"| node_data_models
node_payment_verify -->|"records payments"| node_data_models
node_auth_routes -->|"reads and writes users"| node_data_models
node_allotment_service -->|"updates allotments"| node_data_models
node_notification_service -->|"stores notifications"| node_data_models
node_data_models -->|"persists records"| node_mongodb
node_application_routes -->|"stores documents"| node_local_uploads
node_auth_routes -->|"uses shared contracts"| node_shared_domain
node_allotment_service -->|"uses admission states"| node_shared_domain
node_payment_verify -->|"uses verification states"| node_shared_domain

click node_auth_screens "https://github.com/bhumika2906/sams/blob/main/mobile/app/(auth)/login.tsx"
click node_applicant_screens "https://github.com/bhumika2906/sams/blob/main/mobile/app/(applicant)/application.tsx"
click node_admin_screens "https://github.com/bhumika2906/sams/blob/main/mobile/app/(admin)/allotment.tsx"
click node_faculty_screens "https://github.com/bhumika2906/sams/blob/main/mobile/app/(faculty)/checklist.tsx"
click node_management_screens "https://github.com/bhumika2906/sams/blob/main/mobile/app/(management)/index.tsx"
click node_auth_context "https://github.com/bhumika2906/sams/blob/main/mobile/src/context/AuthContext.tsx"
click node_api_client "https://github.com/bhumika2906/sams/blob/main/mobile/src/api/client.ts"
click node_token_store "https://github.com/bhumika2906/sams/blob/main/mobile/src/storage/token.ts"
click node_api_app "https://github.com/bhumika2906/sams/blob/main/server/src/app.ts"
click node_auth_routes "https://github.com/bhumika2906/sams/blob/main/server/src/routes/auth.routes.ts"
click node_application_routes "https://github.com/bhumika2906/sams/blob/main/server/src/routes/application.routes.ts"
click node_round_routes "https://github.com/bhumika2906/sams/blob/main/server/src/routes/round.routes.ts"
click node_allotment_service "https://github.com/bhumika2906/sams/blob/main/server/src/services/allotment.service.ts"
click node_payment_verify "https://github.com/bhumika2906/sams/blob/main/server/src/routes/payment-verify.routes.ts"
click node_management_routes "https://github.com/bhumika2906/sams/blob/main/server/src/routes/management.routes.ts"
click node_notification_service "https://github.com/bhumika2906/sams/blob/main/server/src/services/notification.service.ts"
click node_data_models "https://github.com/bhumika2906/sams/tree/main/server/src/models"
click node_shared_domain "https://github.com/bhumika2906/sams/blob/main/shared/src/enums.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_screens,node_applicant_screens,node_admin_screens,node_faculty_screens,node_management_screens,node_auth_context,node_api_client,node_token_store toneBlue
class node_api_app,node_auth_routes,node_mongodb,node_local_uploads toneAmber
class node_application_routes,node_round_routes,node_allotment_service,node_data_models toneMint
class node_payment_verify,node_management_routes,node_notification_service toneRose
class node_shared_domain,node_applicant,node_faculty,node_admin,node_management_actor toneIndigo
```

## Components

### Mobile app

- [Sign-in and registration](https://github.com/bhumika2906/sams/blob/main/mobile/app/(auth)/login.tsx): `mobile/app/(auth)/login.tsx`
- [Application and admission](https://github.com/bhumika2906/sams/blob/main/mobile/app/(applicant)/application.tsx): `mobile/app/(applicant)/application.tsx`
- [Round and allotment tools](https://github.com/bhumika2906/sams/blob/main/mobile/app/(admin)/allotment.tsx): `mobile/app/(admin)/allotment.tsx`
- [Scan and checklist](https://github.com/bhumika2906/sams/blob/main/mobile/app/(faculty)/checklist.tsx): `mobile/app/(faculty)/checklist.tsx`
- [Management dashboard](https://github.com/bhumika2906/sams/blob/main/mobile/app/(management)/index.tsx): `mobile/app/(management)/index.tsx`
- [Session state](https://github.com/bhumika2906/sams/blob/main/mobile/src/context/AuthContext.tsx): `mobile/src/context/AuthContext.tsx`
- [API client](https://github.com/bhumika2906/sams/blob/main/mobile/src/api/client.ts): `mobile/src/api/client.ts`
- [Token storage](https://github.com/bhumika2906/sams/blob/main/mobile/src/storage/token.ts): `mobile/src/storage/token.ts`

### API and access

- [Express API](https://github.com/bhumika2906/sams/blob/main/server/src/app.ts): `server/src/app.ts`
- [Authentication](https://github.com/bhumika2906/sams/blob/main/server/src/routes/auth.routes.ts): `server/src/routes/auth.routes.ts`

### Admission lifecycle

- [Application workflow](https://github.com/bhumika2906/sams/blob/main/server/src/routes/application.routes.ts): `server/src/routes/application.routes.ts`
- [Rounds and allotment](https://github.com/bhumika2906/sams/blob/main/server/src/routes/round.routes.ts): `server/src/routes/round.routes.ts`
- [Merit allotment](https://github.com/bhumika2906/sams/blob/main/server/src/services/allotment.service.ts): `server/src/services/allotment.service.ts`
- [Admission records](https://github.com/bhumika2906/sams/tree/main/server/src/models): `server/src/models`

### Verification and oversight

- [Payment and verification](https://github.com/bhumika2906/sams/blob/main/server/src/routes/payment-verify.routes.ts): `server/src/routes/payment-verify.routes.ts`
- [Management statistics](https://github.com/bhumika2906/sams/blob/main/server/src/routes/management.routes.ts): `server/src/routes/management.routes.ts`
- [Notifications](https://github.com/bhumika2906/sams/blob/main/server/src/services/notification.service.ts): `server/src/services/notification.service.ts`

### Shared domain

- [Domain types and rules](https://github.com/bhumika2906/sams/blob/main/shared/src/enums.ts): `shared/src/enums.ts`

### Other components

- **Applicants**
- **Faculty verifiers**
- **Administrators**
- **Management**
- **MongoDB**
- **Local upload storage**

## Connections

- Applicants → Sign-in and registration: starts session
- Applicants → Application and admission: manages application
- Administrators → Round and allotment tools: manages rounds
- Faculty verifiers → Scan and checklist: verifies checklist
- Management → Management dashboard: views statistics
- Sign-in and registration → Session state: uses session (evidence: `mobile/app/(auth)/login.tsx`)
- Application and admission → API client: calls API (evidence: `mobile/app/(applicant)/application.tsx`)
- Round and allotment tools → API client: calls API (evidence: `mobile/app/(admin)/allotment.tsx`)
- Scan and checklist → API client: calls API (evidence: `mobile/app/(faculty)/checklist.tsx`)
- Management dashboard → API client: calls API (evidence: `mobile/app/(management)/index.tsx`)
- Session state → API client: sends auth requests (evidence: `mobile/src/context/AuthContext.tsx`)
- Session state → Token storage: persists session (evidence: `mobile/src/context/AuthContext.tsx`)
- API client → Token storage: reads bearer token (evidence: `mobile/src/api/client.ts`)
- API client → Express API: sends HTTP requests
- Express API → Authentication: mounts routes (evidence: `server/src/app.ts`)
- Express API → Application workflow: mounts routes (evidence: `server/src/app.ts`)
- Express API → Rounds and allotment: mounts routes (evidence: `server/src/app.ts`)
- Express API → Payment and verification: mounts routes (evidence: `server/src/app.ts`)
- Express API → Management statistics: mounts routes (evidence: `server/src/app.ts`)
- Authentication → Notifications: sends notifications (evidence: `server/src/routes/auth.routes.ts`)
- Application workflow → Merit allotment: resolves progress (evidence: `server/src/routes/application.routes.ts`)
- Rounds and allotment → Merit allotment: runs allocation (evidence: `server/src/routes/round.routes.ts`)
- Management statistics → Merit allotment: uses allocation (evidence: `server/src/routes/management.routes.ts`)
- Application workflow → Admission records: reads and writes (evidence: `server/src/routes/application.routes.ts`)
- Rounds and allotment → Admission records: reads and writes (evidence: `server/src/routes/round.routes.ts`)
- Payment and verification → Admission records: records payments (evidence: `server/src/routes/payment-verify.routes.ts`)
- Authentication → Admission records: reads and writes users (evidence: `server/src/routes/auth.routes.ts`)
- Merit allotment → Admission records: updates allotments (evidence: `server/src/services/allotment.service.ts`)
- Notifications → Admission records: stores notifications (evidence: `server/src/services/notification.service.ts`)
- Admission records → MongoDB: persists records
- Application workflow → Local upload storage: stores documents
- Authentication → Domain types and rules: uses shared contracts (evidence: `server/src/routes/auth.routes.ts`)
- Merit allotment → Domain types and rules: uses admission states (evidence: `server/src/services/allotment.service.ts`)
- Payment and verification → Domain types and rules: uses verification states (evidence: `server/src/routes/payment-verify.routes.ts`)
