How aredo97/clearance_system works
Purpose and Entry Points
This is a Laravel/PHP university clearance-management application, with student requests routed through offices, finance, notifications, certificates, and an AI-assisted interface. The README is the stock Laravel README; scope is inferred from application code layout.
HTTP enters through public/index.php, boots via bootstrap/app.php, and is dispatched by routes/web.php plus authentication routes in routes/auth.php. Browser UI is server-rendered Blade with Vite-built assets from resources/js/app.js and resources/css/app.css.
Identity, Roles, and Access Boundary
Laravel authentication supports registration, login, password recovery, email verification, and profile management. Application authorization adds role checks and associates users with offices; user data also includes registration-number and dean/officer extensions.
Key paths:
• app/Models/User.php
• app/Http/Middleware/RoleMiddleware.php
• app/Http/Controllers/Auth/AuthenticatedSessionController.php
Role middleware is the primary boundary separating student, office/department, finance, and administrative workflows.
Clearance Domain and Workflow
The central domain is a clearance request. Students submit and inspect requests; assigned offices/department users act on them, with status/detail views representing the workflow state. Requests and offices are persisted through Eloquent models and migrations.
Key paths:
• app/Models/ClearanceRequest.php
• app/Models/Office.php
• app/Http/Controllers/ClearanceRequestController.php
Primary flow: authenticated student → clearance form → ClearanceRequest persistence → office/department review → approval or rejection outcomes → student-facing status/details and downstream notification/certificate behavior.
Finance and Certificate Stages
Finance is represented as a distinct controller/view area, implying a specialized clearance checkpoint rather than a generic office screen. A certificate controller and printable certificate view form the terminal artifact path after clearance completion.
Key paths:
• app/Http/Controllers/financeController.php
• resources/views/finance/index.blade.php
• app/Http/Controllers/CertificateController.php
The certificate boundary should enforce completed/approved clearance state before rendering or issuing the result.
Notifications and Email
Workflow events are surfaced through database notifications and email. Separate notification classes cover request creation, reminders, approvals, and rejections; mail classes/templates support clearance approvals and reminders.
Key paths:
• app/Http/Controllers/NotificationController.php
• app/Notifications/requestApprovedNotification.php
• app/Mail/clearanceApprovalMail.php
This introduces external mail transport configured through config/mail.php; database notification storage is created by database/migrations/2026_07_13_141151_create_notifications_table.php.
AI-Assisted Clearance Interface
An AI endpoint/controller renders prompt and response views, backed by a university-focused agent and a tool explicitly named to submit clearance. This is a controlled integration boundary: conversational handling should delegate actual mutations through the tool/domain workflow rather than bypassing authorization or request-state rules.
Key paths:
• app/Http/Controllers/AIController.php
• app/Ai/Agents/UniversityAgent.php
• app/Ai/Tools/SubmitClearanceTool.php
AI provider/runtime settings are centralized in config/ai.php.
Runtime, Persistence, and Operations
The application runs on PHP/Laravel (Artisan entry point artisan) and is containerizable with Dockerfile. It uses Laravel’s configurable database, cache, session, queue, broadcasting, filesystem, and logging subsystems. Migrations establish users, offices, clearance requests, cache, jobs, and notifications.
Key paths:
• config/database.php
• config/queue.php
• database/migrations/2026_07_11_073818_create_clearance_requests_table.php
Real-time infrastructure is provisioned/configurable through config/broadcasting.php and config/reverb.php, though active event usage is not established beyond app/Events/HelloWorld.php.
Main entry points: web.php Web routes · ClearanceRequestController.php Clearance requests · ClearanceRequest.php Clearance request · requestApprovedNotification.php Approval notification
Components 22
HTTP & UI
- Web entry point
public/index.php - Laravel bootstrap
bootstrap/app.php - Web routes
routes/web.php - Authentication · Handles browser session login.
app/Http/Controllers/Auth/AuthenticatedSessionController.php - Role boundary · Separates student, office, finance, and administrative workflows.
app/Http/Middleware/RoleMiddleware.php - Server UI assets
resources/js/app.js
Clearance workflow
- Clearance requests · Student submission, status, detail, and office-review actions.
app/Http/Controllers/ClearanceRequestController.php - Clearance request · Central request and workflow-state record.
app/Models/ClearanceRequest.php - Offices · Assigned clearance-review organizations.
app/Models/Office.php - Finance checkpoint · Specialized financial clearance stage.
app/Http/Controllers/financeController.php - Certificate issuance · Produces the terminal printable clearance artifact.
app/Http/Controllers/CertificateController.php
Notifications & AI
- Notification center
app/Http/Controllers/NotificationController.php - Approval notification · Workflow approval notification channel.
app/Notifications/requestApprovedNotification.php - Approval email
app/Mail/clearanceApprovalMail.php - AI interface · Renders conversational prompt and response views.
app/Http/Controllers/AIController.php - University agent
app/Ai/Agents/UniversityAgent.php - Submit clearance tool · Delegates conversational submissions into the clearance workflow.
app/Ai/Tools/SubmitClearanceTool.php
Runtime & persistence
- Application database · Stores users, offices, requests, jobs, and notifications.
config/database.php - Request schema
database/migrations/2026_07_11_073818_create_clearance_requests_table.php - Notification storage
database/migrations/2026_07_13_141151_create_notifications_table.php - Mail transport · External email delivery is configured here.
config/mail.php - Queue subsystem · Configurable asynchronous-work backend.
config/queue.php
Connections 25
- Web entry point → Laravel bootstrap: boots
- Laravel bootstrap → Web routes: loads
- Web routes → Authentication: auth endpoints
- Web routes → Role boundary: protected routes
- Web routes → Clearance requests: clearance actions
- Web routes → Finance checkpoint: finance actions
- Web routes → Certificate issuance: certificate actions
- Web routes → AI interface: AI endpoint
- Role boundary → Clearance requests: authorizes
- Clearance requests → Clearance request: creates and updates
- Clearance request → Offices: assigned review
- Finance checkpoint → Clearance request: financial review
- Certificate issuance → Clearance request: reads completion state
- Clearance requests → Approval notification: workflow outcome
- Approval notification → Notification center: shown to user
- Approval notification → Approval email: email channel
- Approval email → Mail transport: delivers through
- Notification center → Notification storage: reads
- AI interface → University agent: invokes
- University agent → Submit clearance tool: uses
- Submit clearance tool → Clearance requests: submits through
- Clearance request → Application database: persists in
- Request schema → Application database: defines table
- Notification storage → Application database: stored in
- Server UI assets → Web routes: browser UI