# rehan-sikalgar313/problem-x architecture

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

- Interactive diagram: https://gitdiagram.com/rehan-sikalgar313/problem-x
- Repository: https://github.com/rehan-sikalgar313/problem-x

## Overview

This appears to be a Laravel civic-complaint portal: users register with email OTP verification, sign in, submit and track complaints, while admins review complaints and update their status. The main flow is routed through `routes/web.php` to controllers and views, with Eloquent models representing users, temporary OTP records, and complaints. The source excerpts support the authentication, complaint submission, tracking, and admin-management links. Department notification code is present, but occurs after a return in the shown complaint handler, so it is not shown as an active workflow.

Main entry points: [`routes/web.php`](https://github.com/rehan-sikalgar313/problem-x/blob/master/routes/web.php) (Web routes), [`app/Http/Controllers/AuthController.php`](https://github.com/rehan-sikalgar313/problem-x/blob/master/app/Http/Controllers/AuthController.php) (Authentication), [`app/Http/Controllers/AdminComplaintController.php`](https://github.com/rehan-sikalgar313/problem-x/blob/master/app/Http/Controllers/AdminComplaintController.php) (Complaint administration), [`app/Models/Complaint.php`](https://github.com/rehan-sikalgar313/problem-x/blob/master/app/Models/Complaint.php) (Complaint records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Web entry"]
  node_app_entry["Laravel entry<br/>[index.php]"]
  node_web_routes["Web routes<br/>[web.php]"]
  node_base_controller["Base controller<br/>[Controller.php]"]
end

subgraph group_identity["Account access"]
  node_auth_controller["Authentication<br/>[AuthController.php]"]
  node_otp_model[("Registration OTP")]
  node_user_model[("User account<br/>[User.php]")]
  node_otp_mail["OTP email<br/>[VerifyOtpMail.php]"]
  node_register_view["Registration form<br/>[register.blade.php]"]
  node_otp_view["OTP verification"]
  node_login_view["Login form<br/>[login.blade.php]"]
end

subgraph group_complaints["Complaint handling"]
  node_complaint_controller["Complaint submission"]
  node_complaint_model[("Complaint records<br/>[Complaint.php]")]
  node_department_mail["Department notice"]
  node_report_view["Report form<br/>[report.blade.php]"]
  node_dashboard_view["Dashboard"]
  node_track_view["Complaint tracking<br/>[track.blade.php]"]
end

subgraph group_admin["Administration"]
  node_admin_middleware["Admin access check"]
  node_admin_controller["Complaint administration"]
  node_admin_view["Admin complaint list"]
end

node_visitor(("Portal user"))

node_app_entry -->|"loads routes"| node_web_routes
node_visitor -->|"requests pages"| node_web_routes
node_web_routes -->|"serves form"| node_register_view
node_web_routes -->|"serves form"| node_otp_view
node_web_routes -->|"serves form"| node_login_view
node_web_routes -->|"routes auth"| node_auth_controller
node_auth_controller -->|"creates and checks"| node_otp_model
node_auth_controller -->|"creates account"| node_user_model
node_auth_controller -->|"sends OTP with"| node_otp_mail
node_web_routes -->|"serves form"| node_report_view
node_web_routes -->|"routes submission"| node_complaint_controller
node_complaint_controller -->|"creates complaint"| node_complaint_model
node_web_routes -->|"serves dashboard"| node_dashboard_view
node_web_routes -->|"serves tracking"| node_track_view
node_web_routes -->|"queries user complaints"| node_complaint_model
node_web_routes -->|"guards admin routes"| node_admin_middleware
node_web_routes -->|"routes admin actions"| node_admin_controller
node_admin_controller -->|"reads and updates"| node_complaint_model
node_admin_controller -->|"renders list"| node_admin_view

click node_app_entry "https://github.com/rehan-sikalgar313/problem-x/blob/master/public/index.php"
click node_web_routes "https://github.com/rehan-sikalgar313/problem-x/blob/master/routes/web.php"
click node_base_controller "https://github.com/rehan-sikalgar313/problem-x/blob/master/app/Http/Controllers/Controller.php"
click node_auth_controller "https://github.com/rehan-sikalgar313/problem-x/blob/master/app/Http/Controllers/AuthController.php"
click node_otp_model "https://github.com/rehan-sikalgar313/problem-x/blob/master/app/Models/RegistrationOtp.php"
click node_user_model "https://github.com/rehan-sikalgar313/problem-x/blob/master/app/Models/User.php"
click node_otp_mail "https://github.com/rehan-sikalgar313/problem-x/blob/master/app/Mail/VerifyOtpMail.php"
click node_register_view "https://github.com/rehan-sikalgar313/problem-x/blob/master/resources/views/register.blade.php"
click node_otp_view "https://github.com/rehan-sikalgar313/problem-x/blob/master/resources/views/verify-otp.blade.php"
click node_login_view "https://github.com/rehan-sikalgar313/problem-x/blob/master/resources/views/login.blade.php"
click node_complaint_controller "https://github.com/rehan-sikalgar313/problem-x/blob/master/app/Http/Controllers/ComplaintController.php"
click node_complaint_model "https://github.com/rehan-sikalgar313/problem-x/blob/master/app/Models/Complaint.php"
click node_department_mail "https://github.com/rehan-sikalgar313/problem-x/blob/master/app/Mail/ComplaintDepartmentMail.php"
click node_report_view "https://github.com/rehan-sikalgar313/problem-x/blob/master/resources/views/report.blade.php"
click node_dashboard_view "https://github.com/rehan-sikalgar313/problem-x/blob/master/resources/views/dashboard.blade.php"
click node_track_view "https://github.com/rehan-sikalgar313/problem-x/blob/master/resources/views/track.blade.php"
click node_admin_middleware "https://github.com/rehan-sikalgar313/problem-x/blob/master/app/Http/Middleware/AdminMiddleware.php"
click node_admin_controller "https://github.com/rehan-sikalgar313/problem-x/blob/master/app/Http/Controllers/AdminComplaintController.php"
click node_admin_view "https://github.com/rehan-sikalgar313/problem-x/blob/master/resources/views/admin/complaints.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_app_entry,node_web_routes,node_base_controller,node_visitor toneBlue
class node_auth_controller,node_otp_model,node_user_model,node_otp_mail,node_register_view,node_otp_view,node_login_view toneAmber
class node_complaint_controller,node_complaint_model,node_department_mail,node_report_view,node_dashboard_view,node_track_view toneMint
class node_admin_middleware,node_admin_controller,node_admin_view toneRose
```

## Components

### Web entry

- [Laravel entry](https://github.com/rehan-sikalgar313/problem-x/blob/master/public/index.php): `public/index.php`
- [Web routes](https://github.com/rehan-sikalgar313/problem-x/blob/master/routes/web.php): `routes/web.php`
- [Base controller](https://github.com/rehan-sikalgar313/problem-x/blob/master/app/Http/Controllers/Controller.php): `app/Http/Controllers/Controller.php`

### Account access

- [Authentication](https://github.com/rehan-sikalgar313/problem-x/blob/master/app/Http/Controllers/AuthController.php): `app/Http/Controllers/AuthController.php`
- [Registration OTP](https://github.com/rehan-sikalgar313/problem-x/blob/master/app/Models/RegistrationOtp.php): `app/Models/RegistrationOtp.php`
- [User account](https://github.com/rehan-sikalgar313/problem-x/blob/master/app/Models/User.php): `app/Models/User.php`
- [OTP email](https://github.com/rehan-sikalgar313/problem-x/blob/master/app/Mail/VerifyOtpMail.php): `app/Mail/VerifyOtpMail.php`
- [Registration form](https://github.com/rehan-sikalgar313/problem-x/blob/master/resources/views/register.blade.php): `resources/views/register.blade.php`
- [OTP verification](https://github.com/rehan-sikalgar313/problem-x/blob/master/resources/views/verify-otp.blade.php): `resources/views/verify-otp.blade.php`
- [Login form](https://github.com/rehan-sikalgar313/problem-x/blob/master/resources/views/login.blade.php): `resources/views/login.blade.php`

### Complaint handling

- [Complaint submission](https://github.com/rehan-sikalgar313/problem-x/blob/master/app/Http/Controllers/ComplaintController.php): `app/Http/Controllers/ComplaintController.php`
- [Complaint records](https://github.com/rehan-sikalgar313/problem-x/blob/master/app/Models/Complaint.php): `app/Models/Complaint.php`
- [Department notice](https://github.com/rehan-sikalgar313/problem-x/blob/master/app/Mail/ComplaintDepartmentMail.php): `app/Mail/ComplaintDepartmentMail.php`
- [Report form](https://github.com/rehan-sikalgar313/problem-x/blob/master/resources/views/report.blade.php): `resources/views/report.blade.php`
- [Dashboard](https://github.com/rehan-sikalgar313/problem-x/blob/master/resources/views/dashboard.blade.php): `resources/views/dashboard.blade.php`
- [Complaint tracking](https://github.com/rehan-sikalgar313/problem-x/blob/master/resources/views/track.blade.php): `resources/views/track.blade.php`

### Administration

- [Admin access check](https://github.com/rehan-sikalgar313/problem-x/blob/master/app/Http/Middleware/AdminMiddleware.php): `app/Http/Middleware/AdminMiddleware.php`
- [Complaint administration](https://github.com/rehan-sikalgar313/problem-x/blob/master/app/Http/Controllers/AdminComplaintController.php): `app/Http/Controllers/AdminComplaintController.php`
- [Admin complaint list](https://github.com/rehan-sikalgar313/problem-x/blob/master/resources/views/admin/complaints.blade.php): `resources/views/admin/complaints.blade.php`

### Other components

- **Portal user**

## Connections

- Laravel entry → Web routes: loads routes (evidence: `public/index.php`)
- Portal user → Web routes: requests pages (evidence: `routes/web.php`)
- Web routes → Registration form: serves form (evidence: `routes/web.php`)
- Web routes → OTP verification: serves form (evidence: `routes/web.php`)
- Web routes → Login form: serves form (evidence: `routes/web.php`)
- Web routes → Authentication: routes auth (evidence: `routes/web.php`)
- Authentication → Registration OTP: creates and checks (evidence: `app/Http/Controllers/AuthController.php`)
- Authentication → User account: creates account (evidence: `app/Http/Controllers/AuthController.php`)
- Authentication → OTP email: sends OTP with (evidence: `app/Http/Controllers/AuthController.php`)
- Web routes → Report form: serves form (evidence: `routes/web.php`)
- Web routes → Complaint submission: routes submission (evidence: `routes/web.php`)
- Complaint submission → Complaint records: creates complaint (evidence: `app/Http/Controllers/ComplaintController.php`)
- Web routes → Dashboard: serves dashboard (evidence: `routes/web.php`)
- Web routes → Complaint tracking: serves tracking (evidence: `routes/web.php`)
- Web routes → Complaint records: queries user complaints (evidence: `routes/web.php`)
- Web routes → Admin access check: guards admin routes (evidence: `routes/web.php`)
- Web routes → Complaint administration: routes admin actions (evidence: `routes/web.php`)
- Complaint administration → Complaint records: reads and updates (evidence: `app/Http/Controllers/AdminComplaintController.php`)
- Complaint administration → Admin complaint list: renders list (evidence: `app/Http/Controllers/AdminComplaintController.php`)
