# reeyanto/rest-server architecture

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

- Interactive diagram: https://gitdiagram.com/reeyanto/rest-server
- Repository: https://github.com/reeyanto/rest-server

## Overview

This is a Laravel application with a student REST API as its clearest product workflow: an API client reaches the Laravel entry point, the API route dispatches to student CRUD logic, request data is validated, and student records are returned as JSON resources. The runtime also includes Laravel application configuration and a separate User identity model. Database migrations indicate persisted schema, but the excerpts do not show migration execution or the model’s database operations. The generic README documents local setup rather than additional product capabilities; connections below are limited to relationships visible in excerpts or the source index.

Main entry points: [`app/Http/Controllers/StudentController.php`](https://github.com/reeyanto/rest-server/blob/main/app/Http/Controllers/StudentController.php) (Student CRUD), [`bootstrap/app.php`](https://github.com/reeyanto/rest-server/blob/main/bootstrap/app.php) (Application bootstrap), [`public/index.php`](https://github.com/reeyanto/rest-server/blob/main/public/index.php) (HTTP entry), [`routes/api.php`](https://github.com/reeyanto/rest-server/blob/main/routes/api.php) (API routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Laravel runtime"]
  node_front_controller["HTTP entry<br/>[index.php]"]
  node_application_bootstrap["Application bootstrap<br/>[app.php]"]
  node_service_provider["App service provider"]
  node_api_routes["API routes<br/>[api.php]"]
end

subgraph group_student_api["Student API"]
  node_student_controller["Student CRUD"]
  node_base_controller["Base controller<br/>[Controller.php]"]
  node_student_request["Student validation<br/>[StudentRequest.php]"]
  node_student_resource["Student JSON resource"]
  node_student_collection_resource["Student collection resource"]
end

subgraph group_persistence["Data and identity"]
  node_student_model["Student model<br/>[Student.php]"]
  node_student_schema[("Student database schema")]
  node_user_model["User model<br/>[User.php]"]
  node_user_factory["User factory<br/>[UserFactory.php]"]
  node_database_seeder["Database seeder<br/>[DatabaseSeeder.php]"]
end

node_client(("API client"))

node_client -->|"sends request"| node_front_controller
node_front_controller -->|"loads application"| node_application_bootstrap
node_application_bootstrap -->|"registers routes"| node_api_routes
node_api_routes -->|"dispatches CRUD"| node_student_controller
node_student_controller -->|"extends"| node_base_controller
node_student_controller -->|"validates input"| node_student_request
node_student_controller -->|"reads and writes"| node_student_model
node_student_controller -->|"formats responses"| node_student_resource
node_student_model -.->|"uses schema"| node_student_schema
node_user_factory -->|"creates attributes for"| node_user_model
node_database_seeder -->|"creates user"| node_user_model
node_application_bootstrap -->|"loads provider"| node_service_provider

click node_front_controller "https://github.com/reeyanto/rest-server/blob/main/public/index.php"
click node_application_bootstrap "https://github.com/reeyanto/rest-server/blob/main/bootstrap/app.php"
click node_service_provider "https://github.com/reeyanto/rest-server/blob/main/app/Providers/AppServiceProvider.php"
click node_api_routes "https://github.com/reeyanto/rest-server/blob/main/routes/api.php"
click node_student_controller "https://github.com/reeyanto/rest-server/blob/main/app/Http/Controllers/StudentController.php"
click node_base_controller "https://github.com/reeyanto/rest-server/blob/main/app/Http/Controllers/Controller.php"
click node_student_request "https://github.com/reeyanto/rest-server/blob/main/app/Http/Requests/StudentRequest.php"
click node_student_resource "https://github.com/reeyanto/rest-server/blob/main/app/Http/Resources/StudentResource.php"
click node_student_collection_resource "https://github.com/reeyanto/rest-server/blob/main/app/Http/Resources/StudentCollectionResource.php"
click node_student_model "https://github.com/reeyanto/rest-server/blob/main/app/Models/Student.php"
click node_student_schema "https://github.com/reeyanto/rest-server/blob/main/database/migrations/2026_09_10_023934_create_students_table.php"
click node_user_model "https://github.com/reeyanto/rest-server/blob/main/app/Models/User.php"
click node_user_factory "https://github.com/reeyanto/rest-server/blob/main/database/factories/UserFactory.php"
click node_database_seeder "https://github.com/reeyanto/rest-server/blob/main/database/seeders/DatabaseSeeder.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_front_controller,node_application_bootstrap,node_service_provider,node_api_routes,node_client toneBlue
class node_student_controller,node_base_controller,node_student_request,node_student_resource,node_student_collection_resource toneAmber
class node_student_model,node_student_schema,node_user_model,node_user_factory,node_database_seeder toneMint
```

## Components

### Laravel runtime

- [HTTP entry](https://github.com/reeyanto/rest-server/blob/main/public/index.php): `public/index.php`
- [Application bootstrap](https://github.com/reeyanto/rest-server/blob/main/bootstrap/app.php): `bootstrap/app.php`
- [App service provider](https://github.com/reeyanto/rest-server/blob/main/app/Providers/AppServiceProvider.php): `app/Providers/AppServiceProvider.php`
- [API routes](https://github.com/reeyanto/rest-server/blob/main/routes/api.php): `routes/api.php`

### Student API

- [Student CRUD](https://github.com/reeyanto/rest-server/blob/main/app/Http/Controllers/StudentController.php): `app/Http/Controllers/StudentController.php`
- [Base controller](https://github.com/reeyanto/rest-server/blob/main/app/Http/Controllers/Controller.php): `app/Http/Controllers/Controller.php`
- [Student validation](https://github.com/reeyanto/rest-server/blob/main/app/Http/Requests/StudentRequest.php): `app/Http/Requests/StudentRequest.php`
- [Student JSON resource](https://github.com/reeyanto/rest-server/blob/main/app/Http/Resources/StudentResource.php): `app/Http/Resources/StudentResource.php`
- [Student collection resource](https://github.com/reeyanto/rest-server/blob/main/app/Http/Resources/StudentCollectionResource.php): `app/Http/Resources/StudentCollectionResource.php`

### Data and identity

- [Student model](https://github.com/reeyanto/rest-server/blob/main/app/Models/Student.php): `app/Models/Student.php`
- [Student database schema](https://github.com/reeyanto/rest-server/blob/main/database/migrations/2026_09_10_023934_create_students_table.php): `database/migrations/2026_09_10_023934_create_students_table.php`
- [User model](https://github.com/reeyanto/rest-server/blob/main/app/Models/User.php): `app/Models/User.php`
- [User factory](https://github.com/reeyanto/rest-server/blob/main/database/factories/UserFactory.php): `database/factories/UserFactory.php`
- [Database seeder](https://github.com/reeyanto/rest-server/blob/main/database/seeders/DatabaseSeeder.php): `database/seeders/DatabaseSeeder.php`

### Other components

- **API client**

## Connections

- API client → HTTP entry: sends request (evidence: `public/index.php`)
- HTTP entry → Application bootstrap: loads application (evidence: `public/index.php`)
- Application bootstrap → API routes: registers routes (evidence: `bootstrap/app.php`)
- API routes → Student CRUD: dispatches CRUD (evidence: `routes/api.php`)
- Student CRUD → Base controller: extends (evidence: `app/Http/Controllers/StudentController.php`)
- Student CRUD → Student validation: validates input (evidence: `app/Http/Controllers/StudentController.php`)
- Student CRUD → Student model: reads and writes (evidence: `app/Http/Controllers/StudentController.php`)
- Student CRUD → Student JSON resource: formats responses (evidence: `app/Http/Controllers/StudentController.php`)
- Student model → Student database schema: uses schema
- User factory → User model: creates attributes for (evidence: `database/factories/UserFactory.php`)
- Database seeder → User model: creates user (evidence: `database/seeders/DatabaseSeeder.php`)
- Application bootstrap → App service provider: loads provider
