# shashipandey100192/final_backend architecture

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

- Interactive diagram: https://gitdiagram.com/shashipandey100192/final_backend
- Repository: https://github.com/shashipandey100192/final_backend

## Overview

This is an Express backend for student admissions and user records. The main workflow starts at the HTTP server, dispatches through the router, optionally checks JWT cookies, performs student or user model operations, and returns JSON. The router also handles registration, login, record lookup, and student listing; helper controllers implement student read, update, and delete. Source excerpts show these relationships, but the README is empty and the database connection module is imported without an evident invocation in the router.

Main entry points: [`approuting/common/aapcommon.js`](https://github.com/shashipandey100192/final_backend/blob/master/approuting/common/aapcommon.js) (API router), [`models/studentAdmission.js`](https://github.com/shashipandey100192/final_backend/blob/master/models/studentAdmission.js) (Student records), [`server.js`](https://github.com/shashipandey100192/final_backend/blob/master/server.js) (Express server), [`controls/apicontrols.js`](https://github.com/shashipandey100192/final_backend/blob/master/controls/apicontrols.js) (Student CRUD)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["HTTP entry"]
  node_server["Express server<br/>[server.js]"]
end

subgraph group_api["API and access"]
  node_router["API router<br/>[aapcommon.js]"]
  node_auth["JWT verification<br/>[middleware.js]"]
end

subgraph group_records["Record operations"]
  node_registration["Student registration<br/>[aapcommon.js]"]
  node_login["Student login<br/>[aapcommon.js]"]
  node_student_lookup["Student listing<br/>[aapcommon.js]"]
  node_student_management["Student CRUD<br/>[apicontrols.js]"]
  node_recovery["Account lookup<br/>[aapcommon.js]"]
end

subgraph group_persistence["Data models"]
  node_student_model[("Student records")]
  node_user_model[("User records<br/>[userModel.js]")]
  node_db_connection["MongoDB connection<br/>[dbconnection.js]"]
end

node_client(("API client"))

node_client -->|"sends requests"| node_server
node_server -->|"mounts routes"| node_router
node_router -->|"guards routes"| node_auth
node_router -->|"dispatches"| node_registration
node_router -->|"dispatches"| node_login
node_router -->|"dispatches"| node_student_lookup
node_router -->|"dispatches"| node_student_management
node_router -->|"dispatches"| node_recovery
node_registration -->|"reads and writes"| node_student_model
node_login -->|"reads"| node_student_model
node_student_lookup -->|"reads"| node_student_model
node_student_management -->|"reads and writes"| node_student_model
node_recovery -->|"reads"| node_student_model
node_router -->|"reads and writes"| node_user_model
node_router -->|"imports"| node_db_connection

click node_server "https://github.com/shashipandey100192/final_backend/blob/master/server.js"
click node_router "https://github.com/shashipandey100192/final_backend/blob/master/approuting/common/aapcommon.js"
click node_auth "https://github.com/shashipandey100192/final_backend/blob/master/middle/middleware.js"
click node_registration "https://github.com/shashipandey100192/final_backend/blob/master/approuting/common/aapcommon.js"
click node_login "https://github.com/shashipandey100192/final_backend/blob/master/approuting/common/aapcommon.js"
click node_student_lookup "https://github.com/shashipandey100192/final_backend/blob/master/approuting/common/aapcommon.js"
click node_student_management "https://github.com/shashipandey100192/final_backend/blob/master/controls/apicontrols.js"
click node_recovery "https://github.com/shashipandey100192/final_backend/blob/master/approuting/common/aapcommon.js"
click node_student_model "https://github.com/shashipandey100192/final_backend/blob/master/models/studentAdmission.js"
click node_user_model "https://github.com/shashipandey100192/final_backend/blob/master/models/userModel.js"
click node_db_connection "https://github.com/shashipandey100192/final_backend/blob/master/appconnection/dbconnection.js"

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_server,node_client toneBlue
class node_router,node_auth toneAmber
class node_registration,node_login,node_student_lookup,node_student_management,node_recovery toneMint
class node_student_model,node_user_model,node_db_connection toneRose
```

## Components

### HTTP entry

- [Express server](https://github.com/shashipandey100192/final_backend/blob/master/server.js): `server.js`

### API and access

- [API router](https://github.com/shashipandey100192/final_backend/blob/master/approuting/common/aapcommon.js): `approuting/common/aapcommon.js`
- [JWT verification](https://github.com/shashipandey100192/final_backend/blob/master/middle/middleware.js): `middle/middleware.js`

### Record operations

- [Student registration](https://github.com/shashipandey100192/final_backend/blob/master/approuting/common/aapcommon.js): `approuting/common/aapcommon.js`
- [Student login](https://github.com/shashipandey100192/final_backend/blob/master/approuting/common/aapcommon.js): `approuting/common/aapcommon.js`
- [Student listing](https://github.com/shashipandey100192/final_backend/blob/master/approuting/common/aapcommon.js): `approuting/common/aapcommon.js`
- [Student CRUD](https://github.com/shashipandey100192/final_backend/blob/master/controls/apicontrols.js): `controls/apicontrols.js`
- [Account lookup](https://github.com/shashipandey100192/final_backend/blob/master/approuting/common/aapcommon.js): `approuting/common/aapcommon.js`

### Data models

- [Student records](https://github.com/shashipandey100192/final_backend/blob/master/models/studentAdmission.js): `models/studentAdmission.js`
- [User records](https://github.com/shashipandey100192/final_backend/blob/master/models/userModel.js): `models/userModel.js`
- [MongoDB connection](https://github.com/shashipandey100192/final_backend/blob/master/appconnection/dbconnection.js): `appconnection/dbconnection.js`

### Other components

- **API client**

## Connections

- API client → Express server: sends requests (evidence: `server.js`)
- Express server → API router: mounts routes (evidence: `server.js`)
- API router → JWT verification: guards routes (evidence: `approuting/common/aapcommon.js`)
- API router → Student registration: dispatches (evidence: `approuting/common/aapcommon.js`)
- API router → Student login: dispatches (evidence: `approuting/common/aapcommon.js`)
- API router → Student listing: dispatches (evidence: `approuting/common/aapcommon.js`)
- API router → Student CRUD: dispatches (evidence: `approuting/common/aapcommon.js`)
- API router → Account lookup: dispatches (evidence: `approuting/common/aapcommon.js`)
- Student registration → Student records: reads and writes (evidence: `approuting/common/aapcommon.js`)
- Student login → Student records: reads (evidence: `approuting/common/aapcommon.js`)
- Student listing → Student records: reads (evidence: `approuting/common/aapcommon.js`)
- Student CRUD → Student records: reads and writes (evidence: `controls/apicontrols.js`)
- Account lookup → Student records: reads (evidence: `approuting/common/aapcommon.js`)
- API router → User records: reads and writes (evidence: `approuting/common/aapcommon.js`)
- API router → MongoDB connection: imports (evidence: `approuting/common/aapcommon.js`)
