# codebycola/online-exam architecture

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

- Interactive diagram: https://gitdiagram.com/codebycola/online-exam
- Repository: https://github.com/codebycola/online-exam

## Overview

The repository appears to be an exam application with a Next.js client and Laravel API. The visible runtime path supports HTTP request handling and session-based login, registration, logout, and identity lookup. Exam-related routes and domain models indicate an exam/attempt/answer domain, but the exam route implementation and client page behavior were not sampled, so their wiring and user-facing result flow are left unspecified.

Main entry points: [`server/app/Http/Controllers/Api/AuthController.php`](https://github.com/codebycola/online-exam/blob/main/server/app/Http/Controllers/Api/AuthController.php) (Auth controller), [`server/public/index.php`](https://github.com/codebycola/online-exam/blob/main/server/public/index.php) (Request entry), [`server/bootstrap/app.php`](https://github.com/codebycola/online-exam/blob/main/server/bootstrap/app.php) (App bootstrap), [`server/app/Models/User.php`](https://github.com/codebycola/online-exam/blob/main/server/app/Models/User.php) (User model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_web_page["App page<br/>[page.tsx]"]
end

subgraph group_runtime["Laravel API"]
  node_entry["Request entry<br/>[index.php]"]
  node_bootstrap["App bootstrap<br/>[app.php]"]
  node_api_routes["API routes<br/>[api.php]"]
end

subgraph group_identity["Identity"]
  node_auth_routes["Auth routes<br/>[auth.php]"]
  node_auth_controller["Auth controller<br/>[AuthController.php]"]
  node_login_request["Login validation<br/>[LoginRequest.php]"]
  node_register_request["Registration validation"]
  node_user_model["User model<br/>[User.php]"]
end

subgraph group_exam_domain["Exam domain"]
  node_exam_routes["Exam routes<br/>[exams.php]"]
  node_exam_model["Exam<br/>[Exam.php]"]
  node_question_model["Question<br/>[Question.php]"]
  node_option_model["Option<br/>[Option.php]"]
  node_attempt_model["Exam attempt<br/>[ExamAttempt.php]"]
  node_answer_model["Answer<br/>[Answer.php]"]
  node_activity_model["Activity log"]
end

node_visitor(("User"))
node_http_request(("HTTP request"))
node_database[("Database")]

node_visitor -->|"uses"| node_web_page
node_http_request -->|"enters"| node_entry
node_entry -->|"loads"| node_bootstrap
node_bootstrap -->|"routes API"| node_api_routes
node_auth_routes -->|"dispatches"| node_auth_controller
node_auth_controller -->|"validates login"| node_login_request
node_auth_controller -->|"validates registration"| node_register_request
node_auth_controller -->|"creates user"| node_user_model
node_user_model -->|"reads/writes"| node_database

click node_web_page "https://github.com/codebycola/online-exam/blob/main/client/src/app/page.tsx"
click node_entry "https://github.com/codebycola/online-exam/blob/main/server/public/index.php"
click node_bootstrap "https://github.com/codebycola/online-exam/blob/main/server/bootstrap/app.php"
click node_api_routes "https://github.com/codebycola/online-exam/blob/main/server/routes/api.php"
click node_auth_routes "https://github.com/codebycola/online-exam/blob/main/server/routes/api/auth.php"
click node_auth_controller "https://github.com/codebycola/online-exam/blob/main/server/app/Http/Controllers/Api/AuthController.php"
click node_login_request "https://github.com/codebycola/online-exam/blob/main/server/app/Http/Requests/LoginRequest.php"
click node_register_request "https://github.com/codebycola/online-exam/blob/main/server/app/Http/Requests/RegisterRequest.php"
click node_user_model "https://github.com/codebycola/online-exam/blob/main/server/app/Models/User.php"
click node_exam_routes "https://github.com/codebycola/online-exam/blob/main/server/routes/api/exams.php"
click node_exam_model "https://github.com/codebycola/online-exam/blob/main/server/app/Models/Exam.php"
click node_question_model "https://github.com/codebycola/online-exam/blob/main/server/app/Models/Question.php"
click node_option_model "https://github.com/codebycola/online-exam/blob/main/server/app/Models/Option.php"
click node_attempt_model "https://github.com/codebycola/online-exam/blob/main/server/app/Models/ExamAttempt.php"
click node_answer_model "https://github.com/codebycola/online-exam/blob/main/server/app/Models/Answer.php"
click node_activity_model "https://github.com/codebycola/online-exam/blob/main/server/app/Models/ExamActivityLog.php"

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_web_page,node_visitor toneBlue
class node_entry,node_bootstrap,node_api_routes,node_database toneAmber
class node_auth_routes,node_auth_controller,node_login_request,node_register_request,node_user_model,node_http_request toneMint
class node_exam_routes,node_exam_model,node_question_model,node_option_model,node_attempt_model,node_answer_model,node_activity_model toneRose
```

## Components

### Web client

- [App page](https://github.com/codebycola/online-exam/blob/main/client/src/app/page.tsx): `client/src/app/page.tsx`

### Laravel API

- [Request entry](https://github.com/codebycola/online-exam/blob/main/server/public/index.php): `server/public/index.php`
- [App bootstrap](https://github.com/codebycola/online-exam/blob/main/server/bootstrap/app.php): `server/bootstrap/app.php`
- [API routes](https://github.com/codebycola/online-exam/blob/main/server/routes/api.php): `server/routes/api.php`

### Identity

- [Auth routes](https://github.com/codebycola/online-exam/blob/main/server/routes/api/auth.php): `server/routes/api/auth.php`
- [Auth controller](https://github.com/codebycola/online-exam/blob/main/server/app/Http/Controllers/Api/AuthController.php): `server/app/Http/Controllers/Api/AuthController.php`
- [Login validation](https://github.com/codebycola/online-exam/blob/main/server/app/Http/Requests/LoginRequest.php): `server/app/Http/Requests/LoginRequest.php`
- [Registration validation](https://github.com/codebycola/online-exam/blob/main/server/app/Http/Requests/RegisterRequest.php): `server/app/Http/Requests/RegisterRequest.php`
- [User model](https://github.com/codebycola/online-exam/blob/main/server/app/Models/User.php): `server/app/Models/User.php`

### Exam domain

- [Exam routes](https://github.com/codebycola/online-exam/blob/main/server/routes/api/exams.php): `server/routes/api/exams.php`
- [Exam](https://github.com/codebycola/online-exam/blob/main/server/app/Models/Exam.php): `server/app/Models/Exam.php`
- [Question](https://github.com/codebycola/online-exam/blob/main/server/app/Models/Question.php): `server/app/Models/Question.php`
- [Option](https://github.com/codebycola/online-exam/blob/main/server/app/Models/Option.php): `server/app/Models/Option.php`
- [Exam attempt](https://github.com/codebycola/online-exam/blob/main/server/app/Models/ExamAttempt.php): `server/app/Models/ExamAttempt.php`
- [Answer](https://github.com/codebycola/online-exam/blob/main/server/app/Models/Answer.php): `server/app/Models/Answer.php`
- [Activity log](https://github.com/codebycola/online-exam/blob/main/server/app/Models/ExamActivityLog.php): `server/app/Models/ExamActivityLog.php`

### Other components

- **User**
- **HTTP request**
- **Database**

## Connections

- User → App page: uses
- HTTP request → Request entry: enters
- Request entry → App bootstrap: loads
- App bootstrap → API routes: routes API
- Auth routes → Auth controller: dispatches
- Auth controller → Login validation: validates login
- Auth controller → Registration validation: validates registration
- Auth controller → User model: creates user
- User model → Database: reads/writes
