# shathaobeidat/javascript-project architecture

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

- Interactive diagram: https://gitdiagram.com/shathaobeidat/javascript-project
- Repository: https://github.com/shathaobeidat/javascript-project

## Overview

Gradify is a browser-based instructor portal. Instructors sign up or log in, then manage courses, students, attendance and assignments or review course-filtered dashboard summaries. Page modules delegate data access and ownership checks to a shared API service, which talks to json-server; session and theme preferences are held in browser localStorage. The README documents the dashboard chart and other capabilities; unsampled page wiring is represented only where documented, so the graph focuses on evidenced calls and README relationships.

Main entry points: [`js/apiservice.js`](https://github.com/shathaobeidat/javascript-project/blob/main/js/apiservice.js) (API service), [`js/login.js`](https://github.com/shathaobeidat/javascript-project/blob/main/js/login.js) (Log in), [`js/dashboard.js`](https://github.com/shathaobeidat/javascript-project/blob/main/js/dashboard.js) (Dashboard), [`js/layout.js`](https://github.com/shathaobeidat/javascript-project/blob/main/js/layout.js) (Layout and session)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_auth["Instructor access"]
  node_signup["Sign up<br/>[signup.js]"]
  node_login["Log in<br/>[login.js]"]
end

subgraph group_workflows["Teaching workflows"]
  node_dashboard["Dashboard<br/>[dashboard.js]"]
  node_courses["Course management<br/>[addcourse.js]"]
  node_students["Student management<br/>[students.js]"]
  node_assignments["Assignments<br/>[tasks.js]"]
  node_attendance["Attendance<br/>[students.js]"]
end

subgraph group_shared["Shared browser services"]
  node_layout["Layout and session<br/>[layout.js]"]
  node_api["API service<br/>[apiservice.js]"]
end

subgraph group_external["External services"]
  node_browserstorage[("Browser localStorage")]
  node_jsonserver["json-server API"]
  node_data[("Mock data store<br/>[db.json]")]
  node_chartjs["Chart.js"]
end

node_instructor(("Instructor"))

node_instructor -->|"registers"| node_signup
node_instructor -->|"signs in"| node_login
node_signup -->|"registers account"| node_api
node_login -->|"authenticates"| node_api
node_login -->|"sets session"| node_layout
node_instructor -->|"reviews summaries"| node_dashboard
node_dashboard -->|"loads dashboard data"| node_api
node_dashboard -->|"renders chart"| node_chartjs
node_instructor -->|"manages courses"| node_courses
node_courses -->|"reads and writes"| node_api
node_instructor -->|"manages students"| node_students
node_students -->|"reads and writes"| node_api
node_instructor -->|"records attendance"| node_attendance
node_attendance -->|"records and calculates"| node_api
node_instructor -->|"publishes assignments"| node_assignments
node_assignments -->|"reads and writes"| node_api
node_layout -->|"stores session and theme"| node_browserstorage
node_api -->|"reads session"| node_layout
node_api -->|"sends REST requests"| node_jsonserver
node_jsonserver -->|"serves mock data"| node_data

click node_signup "https://github.com/shathaobeidat/javascript-project/blob/main/js/signup.js"
click node_login "https://github.com/shathaobeidat/javascript-project/blob/main/js/login.js"
click node_dashboard "https://github.com/shathaobeidat/javascript-project/blob/main/js/dashboard.js"
click node_courses "https://github.com/shathaobeidat/javascript-project/blob/main/js/addcourse.js"
click node_students "https://github.com/shathaobeidat/javascript-project/blob/main/js/students.js"
click node_assignments "https://github.com/shathaobeidat/javascript-project/blob/main/js/tasks.js"
click node_attendance "https://github.com/shathaobeidat/javascript-project/blob/main/js/students.js"
click node_layout "https://github.com/shathaobeidat/javascript-project/blob/main/js/layout.js"
click node_api "https://github.com/shathaobeidat/javascript-project/blob/main/js/apiservice.js"
click node_data "https://github.com/shathaobeidat/javascript-project/blob/main/json-package/db.json"

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_signup,node_login toneBlue
class node_dashboard,node_courses,node_students,node_assignments,node_attendance toneAmber
class node_layout,node_api toneMint
class node_browserstorage,node_jsonserver,node_data,node_chartjs toneRose
class node_instructor toneIndigo
```

## Components

### Instructor access

- [Sign up](https://github.com/shathaobeidat/javascript-project/blob/main/js/signup.js): `js/signup.js`
- [Log in](https://github.com/shathaobeidat/javascript-project/blob/main/js/login.js): `js/login.js`

### Teaching workflows

- [Dashboard](https://github.com/shathaobeidat/javascript-project/blob/main/js/dashboard.js): `js/dashboard.js`
- [Course management](https://github.com/shathaobeidat/javascript-project/blob/main/js/addcourse.js): `js/addcourse.js`
- [Student management](https://github.com/shathaobeidat/javascript-project/blob/main/js/students.js): `js/students.js`
- [Assignments](https://github.com/shathaobeidat/javascript-project/blob/main/js/tasks.js): `js/tasks.js`
- [Attendance](https://github.com/shathaobeidat/javascript-project/blob/main/js/students.js): `js/students.js`

### Shared browser services

- [Layout and session](https://github.com/shathaobeidat/javascript-project/blob/main/js/layout.js): `js/layout.js`
- [API service](https://github.com/shathaobeidat/javascript-project/blob/main/js/apiservice.js): `js/apiservice.js`

### External services

- **Browser localStorage**
- **json-server API**
- [Mock data store](https://github.com/shathaobeidat/javascript-project/blob/main/json-package/db.json): `json-package/db.json`
- **Chart.js**

### Other components

- **Instructor**

## Connections

- Instructor → Sign up: registers (evidence: `README.md`)
- Instructor → Log in: signs in (evidence: `README.md`)
- Sign up → API service: registers account (evidence: `js/signup.js`)
- Log in → API service: authenticates (evidence: `js/login.js`)
- Log in → Layout and session: sets session (evidence: `js/login.js`)
- Instructor → Dashboard: reviews summaries (evidence: `README.md`)
- Dashboard → API service: loads dashboard data (evidence: `js/dashboard.js`)
- Dashboard → Chart.js: renders chart (evidence: `README.md`)
- Instructor → Course management: manages courses (evidence: `README.md`)
- Course management → API service: reads and writes (evidence: `js/addcourse.js`)
- Instructor → Student management: manages students (evidence: `README.md`)
- Student management → API service: reads and writes (evidence: `js/students.js`)
- Instructor → Attendance: records attendance (evidence: `README.md`)
- Attendance → API service: records and calculates (evidence: `js/students.js`)
- Instructor → Assignments: publishes assignments (evidence: `README.md`)
- Assignments → API service: reads and writes (evidence: `js/tasks.js`)
- Layout and session → Browser localStorage: stores session and theme (evidence: `js/layout.js`)
- API service → Layout and session: reads session (evidence: `js/apiservice.js`)
- API service → json-server API: sends REST requests (evidence: `README.md`)
- json-server API → Mock data store: serves mock data (evidence: `README.md`)
