# sansdev-malang/sansdev architecture

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

- Interactive diagram: https://gitdiagram.com/sansdev-malang/sansdev
- Repository: https://github.com/sansdev-malang/sansdev

## Overview

This is a Laravel web application with a substantial attendance-management surface in its routes, controllers, models, and admin views. The principal workflow is an authenticated user or administrator managing shifts and assigning them to employees over date ranges, with attendance logs and machine configuration as adjacent areas. Authentication, profile management, role middleware, and attendance persistence form supporting layers. The README is the generic Laravel README, so product capabilities are inferred from the repository tree; unsampled controller behavior and integrations are not asserted.

Main entry points: [`routes/web.php`](https://github.com/sansdev-malang/sansdev/blob/main/routes/web.php) (Web routes), [`app/Models/User.php`](https://github.com/sansdev-malang/sansdev/blob/main/app/Models/User.php) (User account model), [`app/Models/AttendanceShift.php`](https://github.com/sansdev-malang/sansdev/blob/main/app/Models/AttendanceShift.php) (Shift model), [`app/Http/Controllers/AttendanceRosterController.php`](https://github.com/sansdev-malang/sansdev/blob/main/app/Http/Controllers/AttendanceRosterController.php) (Roster management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web entry"]
  node_web_routes["Web routes<br/>[web.php]"]
  node_auth_routes["Auth routes<br/>[auth.php]"]
  node_role_guard["Role guard<br/>[CheckRole.php]"]
end

subgraph group_attendance["Attendance operations"]
  node_shift_controller["Shift management"]
  node_roster_controller["Roster management"]
  node_log_controller["Attendance logs"]
  node_machine_controller["Machine management"]
  node_admin_views["Admin attendance views"]
  node_shift_view["Shift view<br/>[index.blade.php]"]
  node_roster_view["Roster view<br/>[index.blade.php]"]
  node_log_view["Today log view<br/>[today.blade.php]"]
  node_machine_view["Machine view<br/>[index.blade.php]"]
end

subgraph group_identity["Identity and access"]
  node_login_controller["Login sessions"]
  node_register_controller["Registration"]
  node_profile_controller["Profile management"]
  node_login_request["Login validation<br/>[LoginRequest.php]"]
  node_profile_request["Profile validation"]
  node_auth_views["Authentication views"]
  node_profile_view["Profile view<br/>[edit.blade.php]"]
end

subgraph group_domain["Domain data"]
  node_user_model["User account model<br/>[User.php]"]
  node_shift_model["Shift model"]
  node_shift_detail_model["Shift details"]
  node_roster_model["Roster records"]
  node_log_model["Attendance records<br/>[AttendanceLog.php]"]
  node_machine_model["Machine records"]
  node_database[("Application database")]
end

node_user(("User"))

node_user -->|"opens"| node_web_routes
node_web_routes -->|"routes requests"| node_shift_controller
node_web_routes -->|"routes requests"| node_roster_controller
node_web_routes -->|"routes requests"| node_log_controller
node_web_routes -->|"routes requests"| node_machine_controller
node_web_routes -->|"loads routes"| node_auth_routes
node_web_routes -->|"routes requests"| node_profile_controller
node_auth_routes -->|"routes sessions"| node_login_controller
node_auth_routes -->|"routes registration"| node_register_controller
node_shift_controller -->|"reads and writes"| node_shift_model
node_shift_controller -->|"renders"| node_shift_view
node_shift_model -->|"has details"| node_shift_detail_model
node_roster_controller -->|"reads and writes"| node_roster_model
node_roster_controller -->|"validates shift"| node_shift_model
node_roster_controller -->|"renders"| node_roster_view
node_machine_controller -->|"manages records"| node_machine_model
node_login_controller -->|"authenticates with"| node_login_request
node_login_controller -->|"renders login"| node_auth_views
node_register_controller -->|"creates account"| node_user_model
node_register_controller -->|"renders registration"| node_auth_views
node_profile_controller -->|"validates updates"| node_profile_request
node_profile_controller -->|"renders"| node_profile_view
node_user_model -->|"has many"| node_log_model
node_user_model -->|"has many"| node_roster_model
node_user_model -->|"references default shift"| node_shift_model
node_roster_model -->|"belongs to shift"| node_shift_model
node_log_model -->|"references machine"| node_machine_model
node_user_model -.->|"persists account"| node_database
node_shift_model -.->|"persists shifts"| node_database
node_roster_model -.->|"persists rosters"| node_database
node_log_model -.->|"persists logs"| node_database
node_machine_model -.->|"persists machines"| node_database
node_role_guard -->|"checks role"| node_user_model

click node_web_routes "https://github.com/sansdev-malang/sansdev/blob/main/routes/web.php"
click node_auth_routes "https://github.com/sansdev-malang/sansdev/blob/main/routes/auth.php"
click node_role_guard "https://github.com/sansdev-malang/sansdev/blob/main/app/Http/Middleware/CheckRole.php"
click node_shift_controller "https://github.com/sansdev-malang/sansdev/blob/main/app/Http/Controllers/AttendanceShiftController.php"
click node_roster_controller "https://github.com/sansdev-malang/sansdev/blob/main/app/Http/Controllers/AttendanceRosterController.php"
click node_log_controller "https://github.com/sansdev-malang/sansdev/blob/main/app/Http/Controllers/AttendanceLogController.php"
click node_machine_controller "https://github.com/sansdev-malang/sansdev/blob/main/app/Http/Controllers/AttendanceMachineController.php"
click node_admin_views "https://github.com/sansdev-malang/sansdev/tree/main/resources/views/admin"
click node_shift_view "https://github.com/sansdev-malang/sansdev/blob/main/resources/views/attendance/shifts/index.blade.php"
click node_roster_view "https://github.com/sansdev-malang/sansdev/blob/main/resources/views/attendance/rosters/index.blade.php"
click node_log_view "https://github.com/sansdev-malang/sansdev/blob/main/resources/views/attendance/logs/today.blade.php"
click node_machine_view "https://github.com/sansdev-malang/sansdev/blob/main/resources/views/attendance/machines/index.blade.php"
click node_login_controller "https://github.com/sansdev-malang/sansdev/blob/main/app/Http/Controllers/Auth/AuthenticatedSessionController.php"
click node_register_controller "https://github.com/sansdev-malang/sansdev/blob/main/app/Http/Controllers/Auth/RegisteredUserController.php"
click node_profile_controller "https://github.com/sansdev-malang/sansdev/blob/main/app/Http/Controllers/ProfileController.php"
click node_login_request "https://github.com/sansdev-malang/sansdev/blob/main/app/Http/Requests/Auth/LoginRequest.php"
click node_profile_request "https://github.com/sansdev-malang/sansdev/blob/main/app/Http/Requests/ProfileUpdateRequest.php"
click node_user_model "https://github.com/sansdev-malang/sansdev/blob/main/app/Models/User.php"
click node_shift_model "https://github.com/sansdev-malang/sansdev/blob/main/app/Models/AttendanceShift.php"
click node_shift_detail_model "https://github.com/sansdev-malang/sansdev/blob/main/app/Models/AttendanceShiftDetail.php"
click node_roster_model "https://github.com/sansdev-malang/sansdev/blob/main/app/Models/AttendanceRoster.php"
click node_log_model "https://github.com/sansdev-malang/sansdev/blob/main/app/Models/AttendanceLog.php"
click node_machine_model "https://github.com/sansdev-malang/sansdev/blob/main/app/Models/AttendanceMachine.php"
click node_auth_views "https://github.com/sansdev-malang/sansdev/tree/main/resources/views/auth"
click node_profile_view "https://github.com/sansdev-malang/sansdev/blob/main/resources/views/profile/edit.blade.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_routes,node_auth_routes,node_role_guard,node_user toneBlue
class node_shift_controller,node_roster_controller,node_log_controller,node_machine_controller,node_admin_views,node_shift_view,node_roster_view,node_log_view,node_machine_view toneAmber
class node_login_controller,node_register_controller,node_profile_controller,node_login_request,node_profile_request,node_auth_views,node_profile_view toneMint
class node_user_model,node_shift_model,node_shift_detail_model,node_roster_model,node_log_model,node_machine_model,node_database toneRose
```

## Components

### Web entry

- [Web routes](https://github.com/sansdev-malang/sansdev/blob/main/routes/web.php): `routes/web.php`
- [Auth routes](https://github.com/sansdev-malang/sansdev/blob/main/routes/auth.php): `routes/auth.php`
- [Role guard](https://github.com/sansdev-malang/sansdev/blob/main/app/Http/Middleware/CheckRole.php): `app/Http/Middleware/CheckRole.php`

### Attendance operations

- [Shift management](https://github.com/sansdev-malang/sansdev/blob/main/app/Http/Controllers/AttendanceShiftController.php): `app/Http/Controllers/AttendanceShiftController.php`
- [Roster management](https://github.com/sansdev-malang/sansdev/blob/main/app/Http/Controllers/AttendanceRosterController.php): `app/Http/Controllers/AttendanceRosterController.php`
- [Attendance logs](https://github.com/sansdev-malang/sansdev/blob/main/app/Http/Controllers/AttendanceLogController.php): `app/Http/Controllers/AttendanceLogController.php`
- [Machine management](https://github.com/sansdev-malang/sansdev/blob/main/app/Http/Controllers/AttendanceMachineController.php): `app/Http/Controllers/AttendanceMachineController.php`
- [Admin attendance views](https://github.com/sansdev-malang/sansdev/tree/main/resources/views/admin): `resources/views/admin`
- [Shift view](https://github.com/sansdev-malang/sansdev/blob/main/resources/views/attendance/shifts/index.blade.php): `resources/views/attendance/shifts/index.blade.php`
- [Roster view](https://github.com/sansdev-malang/sansdev/blob/main/resources/views/attendance/rosters/index.blade.php): `resources/views/attendance/rosters/index.blade.php`
- [Today log view](https://github.com/sansdev-malang/sansdev/blob/main/resources/views/attendance/logs/today.blade.php): `resources/views/attendance/logs/today.blade.php`
- [Machine view](https://github.com/sansdev-malang/sansdev/blob/main/resources/views/attendance/machines/index.blade.php): `resources/views/attendance/machines/index.blade.php`

### Identity and access

- [Login sessions](https://github.com/sansdev-malang/sansdev/blob/main/app/Http/Controllers/Auth/AuthenticatedSessionController.php): `app/Http/Controllers/Auth/AuthenticatedSessionController.php`
- [Registration](https://github.com/sansdev-malang/sansdev/blob/main/app/Http/Controllers/Auth/RegisteredUserController.php): `app/Http/Controllers/Auth/RegisteredUserController.php`
- [Profile management](https://github.com/sansdev-malang/sansdev/blob/main/app/Http/Controllers/ProfileController.php): `app/Http/Controllers/ProfileController.php`
- [Login validation](https://github.com/sansdev-malang/sansdev/blob/main/app/Http/Requests/Auth/LoginRequest.php): `app/Http/Requests/Auth/LoginRequest.php`
- [Profile validation](https://github.com/sansdev-malang/sansdev/blob/main/app/Http/Requests/ProfileUpdateRequest.php): `app/Http/Requests/ProfileUpdateRequest.php`
- [Authentication views](https://github.com/sansdev-malang/sansdev/tree/main/resources/views/auth): `resources/views/auth`
- [Profile view](https://github.com/sansdev-malang/sansdev/blob/main/resources/views/profile/edit.blade.php): `resources/views/profile/edit.blade.php`

### Domain data

- [User account model](https://github.com/sansdev-malang/sansdev/blob/main/app/Models/User.php): `app/Models/User.php`
- [Shift model](https://github.com/sansdev-malang/sansdev/blob/main/app/Models/AttendanceShift.php): `app/Models/AttendanceShift.php`
- [Shift details](https://github.com/sansdev-malang/sansdev/blob/main/app/Models/AttendanceShiftDetail.php): `app/Models/AttendanceShiftDetail.php`
- [Roster records](https://github.com/sansdev-malang/sansdev/blob/main/app/Models/AttendanceRoster.php): `app/Models/AttendanceRoster.php`
- [Attendance records](https://github.com/sansdev-malang/sansdev/blob/main/app/Models/AttendanceLog.php): `app/Models/AttendanceLog.php`
- [Machine records](https://github.com/sansdev-malang/sansdev/blob/main/app/Models/AttendanceMachine.php): `app/Models/AttendanceMachine.php`
- **Application database**

### Other components

- **User**

## Connections

- User → Web routes: opens
- Web routes → Shift management: routes requests (evidence: `routes/web.php`)
- Web routes → Roster management: routes requests (evidence: `routes/web.php`)
- Web routes → Attendance logs: routes requests (evidence: `routes/web.php`)
- Web routes → Machine management: routes requests (evidence: `routes/web.php`)
- Web routes → Auth routes: loads routes (evidence: `routes/web.php`)
- Web routes → Profile management: routes requests (evidence: `routes/web.php`)
- Auth routes → Login sessions: routes sessions (evidence: `routes/auth.php`)
- Auth routes → Registration: routes registration (evidence: `routes/auth.php`)
- Shift management → Shift model: reads and writes (evidence: `app/Http/Controllers/AttendanceShiftController.php`)
- Shift management → Shift view: renders (evidence: `app/Http/Controllers/AttendanceShiftController.php`)
- Shift model → Shift details: has details (evidence: `app/Models/AttendanceShift.php`)
- Roster management → Roster records: reads and writes (evidence: `app/Http/Controllers/AttendanceRosterController.php`)
- Roster management → Shift model: validates shift (evidence: `app/Http/Controllers/AttendanceRosterController.php`)
- Roster management → Roster view: renders (evidence: `app/Http/Controllers/AttendanceRosterController.php`)
- Machine management → Machine records: manages records (evidence: `app/Http/Controllers/AttendanceMachineController.php`)
- Login sessions → Login validation: authenticates with (evidence: `app/Http/Controllers/Auth/AuthenticatedSessionController.php`)
- Login sessions → Authentication views: renders login (evidence: `app/Http/Controllers/Auth/AuthenticatedSessionController.php`)
- Registration → User account model: creates account (evidence: `app/Http/Controllers/Auth/RegisteredUserController.php`)
- Registration → Authentication views: renders registration (evidence: `app/Http/Controllers/Auth/RegisteredUserController.php`)
- Profile management → Profile validation: validates updates (evidence: `app/Http/Controllers/ProfileController.php`)
- Profile management → Profile view: renders (evidence: `app/Http/Controllers/ProfileController.php`)
- User account model → Attendance records: has many (evidence: `app/Models/User.php`)
- User account model → Roster records: has many (evidence: `app/Models/User.php`)
- User account model → Shift model: references default shift (evidence: `app/Models/User.php`)
- Roster records → Shift model: belongs to shift (evidence: `app/Models/AttendanceRoster.php`)
- Attendance records → Machine records: references machine (evidence: `app/Models/AttendanceLog.php`)
- User account model → Application database: persists account
- Shift model → Application database: persists shifts
- Roster records → Application database: persists rosters
- Attendance records → Application database: persists logs
- Machine records → Application database: persists machines
- Role guard → User account model: checks role
