Advanced Developer Guide
Complete internal architecture, logic, and engineering details of the RDA system.
System Architecture
- Laravel 10 MVC Architecture
- Service Layer Pattern
- Repository Pattern (Partial Implementation)
- Blade + Livewire UI Rendering
Core Workflow Logic
- Dynamic forwarding chain
- Multi-cycle approval application
- Signature rendering logic
Packages Used
Route Structure & System Endpoints
The system primarily uses Laravel Web Routes with middleware protection. It includes payment gateways, internal modules, and authenticated operations.
Payment Gateway Routes
| Method | Endpoint | Description |
|---|---|---|
| GET | /payment/initiate/temp/{id} | Initiate payment session |
| POST | /payment/success | Payment success callback |
| POST | /payment/fail | Payment failure callback |
| POST | /payment/cancel | Payment cancel callback |
Betterment & Bank Payment
| Method | Endpoint | Description |
|---|---|---|
| POST | /betterment/online/{application}/{letter} | Initiate online betterment payment |
| POST | /betterment/bank/invoice/{letter} | Generate bank invoice |
| GET | /betterment/bank/invoice/pdf/{payment} | Download invoice PDF |
Authenticated Core System Routes
- All core operations are protected via auth:sanctum middleware
- Additional role-based middleware (Laratrust)
- Activity tracking middleware enabled
NOC Approval Workflow Routes
| Method | Endpoint | Description |
|---|---|---|
| POST | /noc-approval/{id}/approve | Approve application |
| POST | /noc-approval/forward/{id} | Forward to next officer |
| POST | /noc-approval/submit-note | Add note to workflow |
Reporting System Routes
| Endpoint | Description |
|---|---|
| /report/noc-details | NOC approval report |
| /report/payment-details | Payment report |
| /report/monthly | Monthly analytics report |
Database Design Overview
| Table | Description |
|---|---|
| noc_applications | Main application data |
| noc_approvals | Approval workflow tracking |
| noc_letters | Letter tracking |
| noc_application_archives | Archive file management |
| nothi_nisponnos | After approval |
| plot_applications | Plot management |
| meetings | mMeetings system |
| Payments | Payment data |
| Report | Report Details |
Internal Modules (Livewire Based)
- Market Management Module
- Residential Plot Module
- Store & Payment Module
- Report Dashboard Module
⚠️ Note: This system is not a pure REST API system. It combines Web Routes, Livewire components, and controller-based logic to handle a complex government workflow system.
Role-Based Access Control (RBAC)
- Super Admin → Full access
- Admin → Manage reports & applications
- Officer → Approval workflow
- User → Apply & track
File & Document Handling
- Stored in storage/app/public
- Only PDF allowed
- UUID-based naming
- Protected access
Notification & Event System
- SMS Notification
- Email Alerts
- Event Driven Architecture
Performance Optimization
- Eager Loading
- Indexing
- Cache System
- Chunk Processing
Audit Log System (Tracking & Compliance)
Every action in the system is traceable for accountability.
- User activity tracking
- Status change history
- Approval logs
Error Handling & Exception Strategy
- Global Exception Handler
- Try-Catch Critical Operations
- Custom Error Messages
Modular & Scalable Architecture
The system is designed to be scalable and modular for future expansion.
- Service Layer Separation
- Reusable Components
- Future Microservice Ready
Security Implementation
- CSRF Protection
- Validation Layer
- Database indexing
- Log system include
- Role Permission Control
- Lazy loading relationships
- Chunk processing for reports
- Secure File Upload (PDF only)
Automation Features
- SMS Notification System
- Email Alerts
- Status Tracking Engine
- Auto Fee Calculation
Example Logic (Forwarding)
Database Transactions & Data Consistency
To maintain data integrity across complex operations like approval workflows, payment verification, and multi-step processing, the system uses database transactions.
- Atomic operations for critical actions
- Rollback on failure
- Prevents partial data corruption
- Ensures consistency across multiple tables
This approach is critical when handling financial transactions or multi-user approval chains.
System Deployment & Environment Setup
The system is designed for flexible deployment across local, staging, and production environments.
- Environment-based configuration (.env)
- Separate database for production
- Secure APP_KEY & credentials
- Optimized deployment commands
Recommended production stack: Nginx + PHP-FPM + MySQL + Redis
Ensure proper permissions: storage/ and bootstrap/cache must be writable.