# kottana-chakri/studentrepo_frontend architecture

> Architecture diagram of the GitHub repository kottana-chakri/studentrepo_frontend, 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/kottana-chakri/studentrepo_frontend
- Repository: https://github.com/kottana-chakri/studentrepo_frontend

## Overview

This is a React student API tester. A user logs in, then uses the dashboard to list, look up, add, update, or delete students; add and update forms also load course choices. The UI components call a shared Axios client for student and course requests, while login uses a separate fetch request. The excerpts show these calls and configured endpoints; the backend implementation and persistence are outside this repository.

Main entry points: [`src/api.js`](https://github.com/kottana-chakri/studentrepo_frontend/blob/main/src/api.js) (API client), [`src/App.jsx`](https://github.com/kottana-chakri/studentrepo_frontend/blob/main/src/App.jsx) (Dashboard), [`src/components/Login.jsx`](https://github.com/kottana-chakri/studentrepo_frontend/blob/main/src/components/Login.jsx) (Login form), [`src/main.jsx`](https://github.com/kottana-chakri/studentrepo_frontend/blob/main/src/main.jsx) (React entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application shell"]
  node_entry["React entry<br/>[main.jsx]"]
  node_app["Dashboard<br/>[App.jsx]"]
end

subgraph group_auth["Authentication"]
  node_login["Login form<br/>[Login.jsx]"]
  node_token[("Browser token storage")]
end

subgraph group_student["Student operations"]
  node_list["List students<br/>[GetAllStudents.jsx]"]
  node_lookup["Find student<br/>[GetStudentById.jsx]"]
  node_add["Add student<br/>[AddStudent.jsx]"]
  node_update["Update student<br/>[UpdateStudent.jsx]"]
  node_delete["Delete student<br/>[DeleteStudent.jsx]"]
end

subgraph group_integration["API integration"]
  node_api["API client<br/>[api.js]"]
  node_config["API configuration<br/>[config.js]"]
end

node_user(("User"))
node_authservice{{"Authentication API"}}
node_studentservice{{"Student API"}}
node_courseservice{{"Course API"}}

node_user -->|"opens app"| node_entry
node_entry -->|"renders"| node_app
node_app -->|"shows when logged out"| node_login
node_app -->|"renders when logged in"| node_list
node_app -->|"renders when logged in"| node_lookup
node_app -->|"renders when logged in"| node_add
node_app -->|"renders when logged in"| node_update
node_app -->|"renders when logged in"| node_delete
node_login -->|"posts credentials"| node_authservice
node_login -->|"stores token"| node_token
node_app -->|"removes token"| node_token
node_list -->|"requests students"| node_api
node_lookup -->|"requests student"| node_api
node_add -->|"submits student; loads courses"| node_api
node_update -->|"submits student; loads courses"| node_api
node_delete -->|"checks and deletes student"| node_api
node_api -->|"sends CRUD requests"| node_studentservice
node_api -->|"fetches courses"| node_courseservice
node_api -->|"reads endpoint settings"| node_config
node_login -->|"reads login endpoint"| node_config
node_api -->|"reads bearer token"| node_token

click node_entry "https://github.com/kottana-chakri/studentrepo_frontend/blob/main/src/main.jsx"
click node_app "https://github.com/kottana-chakri/studentrepo_frontend/blob/main/src/App.jsx"
click node_login "https://github.com/kottana-chakri/studentrepo_frontend/blob/main/src/components/Login.jsx"
click node_list "https://github.com/kottana-chakri/studentrepo_frontend/blob/main/src/components/GetAllStudents.jsx"
click node_lookup "https://github.com/kottana-chakri/studentrepo_frontend/blob/main/src/components/GetStudentById.jsx"
click node_add "https://github.com/kottana-chakri/studentrepo_frontend/blob/main/src/components/AddStudent.jsx"
click node_update "https://github.com/kottana-chakri/studentrepo_frontend/blob/main/src/components/UpdateStudent.jsx"
click node_delete "https://github.com/kottana-chakri/studentrepo_frontend/blob/main/src/components/DeleteStudent.jsx"
click node_api "https://github.com/kottana-chakri/studentrepo_frontend/blob/main/src/api.js"
click node_config "https://github.com/kottana-chakri/studentrepo_frontend/blob/main/src/config.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_entry,node_app,node_user toneBlue
class node_login,node_token toneAmber
class node_list,node_lookup,node_add,node_update,node_delete,node_authservice,node_studentservice,node_courseservice toneMint
class node_api,node_config toneRose
```

## Components

### Application shell

- [React entry](https://github.com/kottana-chakri/studentrepo_frontend/blob/main/src/main.jsx): `src/main.jsx`
- [Dashboard](https://github.com/kottana-chakri/studentrepo_frontend/blob/main/src/App.jsx): `src/App.jsx`

### Authentication

- [Login form](https://github.com/kottana-chakri/studentrepo_frontend/blob/main/src/components/Login.jsx): `src/components/Login.jsx`
- **Browser token storage**

### Student operations

- [List students](https://github.com/kottana-chakri/studentrepo_frontend/blob/main/src/components/GetAllStudents.jsx): `src/components/GetAllStudents.jsx`
- [Find student](https://github.com/kottana-chakri/studentrepo_frontend/blob/main/src/components/GetStudentById.jsx): `src/components/GetStudentById.jsx`
- [Add student](https://github.com/kottana-chakri/studentrepo_frontend/blob/main/src/components/AddStudent.jsx): `src/components/AddStudent.jsx`
- [Update student](https://github.com/kottana-chakri/studentrepo_frontend/blob/main/src/components/UpdateStudent.jsx): `src/components/UpdateStudent.jsx`
- [Delete student](https://github.com/kottana-chakri/studentrepo_frontend/blob/main/src/components/DeleteStudent.jsx): `src/components/DeleteStudent.jsx`

### API integration

- [API client](https://github.com/kottana-chakri/studentrepo_frontend/blob/main/src/api.js): `src/api.js`
- [API configuration](https://github.com/kottana-chakri/studentrepo_frontend/blob/main/src/config.js): `src/config.js`

### Other components

- **User**
- **Authentication API**
- **Student API**
- **Course API**

## Connections

- User → React entry: opens app (evidence: `src/main.jsx`)
- React entry → Dashboard: renders (evidence: `src/main.jsx`)
- Dashboard → Login form: shows when logged out (evidence: `src/App.jsx`)
- Dashboard → List students: renders when logged in (evidence: `src/App.jsx`)
- Dashboard → Find student: renders when logged in (evidence: `src/App.jsx`)
- Dashboard → Add student: renders when logged in (evidence: `src/App.jsx`)
- Dashboard → Update student: renders when logged in (evidence: `src/App.jsx`)
- Dashboard → Delete student: renders when logged in (evidence: `src/App.jsx`)
- Login form → Authentication API: posts credentials (evidence: `src/components/Login.jsx`)
- Login form → Browser token storage: stores token (evidence: `src/components/Login.jsx`)
- Dashboard → Browser token storage: removes token (evidence: `src/App.jsx`)
- List students → API client: requests students (evidence: `src/components/GetAllStudents.jsx`)
- Find student → API client: requests student (evidence: `src/components/GetStudentById.jsx`)
- Add student → API client: submits student; loads courses (evidence: `src/components/AddStudent.jsx`)
- Update student → API client: submits student; loads courses (evidence: `src/components/UpdateStudent.jsx`)
- Delete student → API client: checks and deletes student (evidence: `src/components/DeleteStudent.jsx`)
- API client → Student API: sends CRUD requests (evidence: `src/api.js`)
- API client → Course API: fetches courses (evidence: `src/api.js`)
- API client → API configuration: reads endpoint settings (evidence: `src/api.js`)
- Login form → API configuration: reads login endpoint (evidence: `src/components/Login.jsx`)
- API client → Browser token storage: reads bearer token (evidence: `src/api.js`)
