How rks-ad/lawupwebstackfull works
Purpose and runtime
A server-rendered legal-services marketplace: users discover lawyers/services, book consultations and order services; lawyers manage offerings, orders, payments, and withdrawals; admins operate the platform. It is a PHP Laravel application rooted under src/core, fronted by a public PHP entry point and containerized with Nginx.
• src/index.php
• src/core/artisan
• Dockerfile
• docker/nginx.conf
Application entry and routing
Laravel bootstraps through its standard application bootstrap, with route domains separated by audience and integration boundary. Site/public routes, user and lawyer portals, administration, API, payment IPNs, broadcasting channels, and scheduled commands are independently declared.
• src/core/bootstrap/app.php
• src/core/routes/web.php
• src/core/routes/user.php
• src/core/routes/lawyer.php
• src/core/routes/admin.php
• src/core/routes/ipn.php
Identity, roles, and access gates
Three principal identities—admin, user, lawyer—have separate authentication controllers, models, portal controllers, and views. Middleware enforces authentication, account status, role routing, KYC, staged registration, service entitlement, template/language selection, and maintenance mode before business actions execute.
• src/core/app/Models/User.php
• src/core/app/Models/Lawyer.php
• src/core/app/Models/Admin.php
• src/core/app/Http/Middleware/KycMiddleware.php
• src/core/app/Http/Middleware/LawyerServiceAccess.php
Marketplace workflow
The central transactional flow is: lawyers create categorized services; users browse marketplace content, submit bookings or service orders; both parties monitor progress, reviews, chats, and support. Persistent Eloquent models form the shared domain boundary, while audience-specific controllers expose the same lifecycle to each role.
• src/core/app/Models/Service.php
• src/core/app/Models/ServiceOrder.php
• src/core/app/Models/Booking.php
• src/core/app/Http/Controllers/User/ServiceOrderController.php
• src/core/app/Http/Controllers/Lawyer/ServiceController.php
Money, plans, and payouts
Deposits fund user/lawyer actions such as plans and boosts; transactions record financial state; withdrawal requests flow to admin-managed withdrawal methods. PaymentController is the common orchestration boundary, delegating initiation/callback handling to a large gateway adapter set; IPN routes receive external provider notifications.
• src/core/app/Http/Controllers/Gateway/PaymentController.php
• src/core/app/Models/Deposit.php
• src/core/app/Models/Transaction.php
• src/core/app/Models/Withdrawal.php
• src/core/app/Http/Controllers/Gateway/Stripe/ProcessController.php
Communication and notifications
Chat is modeled separately from marketplace orders and mediated by ChatService; message events and Blade partials indicate realtime delivery via configured broadcasting/Pusher. A configurable notification subsystem renders templates and sends email, SMS (including Textmagic), and push notifications; Firebase browser messaging assets support web push.
• src/core/app/Services/ChatService.php
• src/core/app/Events/MessageSent.php
• src/core/app/Notify/NotifyProcess.php
• src/core/config/broadcasting.php
• src/assets/global/js/firebase/configs.js
Administration and presentation
Admins manage marketplace records, payment gateways, KYC, frontend content/pages, language, notification templates, cron configuration, reports, and system settings. The application is Blade-rendered with a selectable “basic” template; frontend assets live outside Laravel’s core and are served from src/assets.
• src/core/app/Http/Controllers/Admin/AdminController.php
• src/core/app/Http/Controllers/Admin/PageBuilderController.php
• src/core/resources/views/templates/basic/layouts/frontend.blade.php
• src/core/resources/views/admin/layouts/app.blade.php
• src/assets/templates/basic
Infrastructure and operational boundaries
Configuration is environment-driven (.env.example) for database, mail, sessions/cache/queue, external services, and filesystem storage. Laravel’s scheduler/cron controller and cron models provide application-managed periodic execution. Uploaded/public and framework runtime data belong under storage, requiring writable persistent storage in deployment.
• src/core/.env.example
• src/core/config/database.php
• src/core/config/services.php
• src/core/app/Http/Controllers/CronController.php
• src/core/app/Models/CronSchedule.php
Main entry points: PaymentController.php Payment orchestration · ServiceOrderController.php Marketplace portals · ServiceOrder.php Services, orders & bookings · AdminController.php Admin operations
Components 19
Edge & Runtime
- Nginx container · Serves the public PHP entry point.
docker/nginx.conf - Public entry point
src/index.php - Environment & persistent storage · Environment config and writable Laravel runtime/upload storage.
src/core/.env.example
Laravel Application
- Laravel bootstrap
src/core/bootstrap/app.php - Audience & IPN routes · Public, user, lawyer, admin, and provider callbacks are separated.
src/core/routes/web.php - Identity & access gates · Admin, user, and lawyer access is gated by role, status, KYC, and entitlements.
src/core/app/Http/Middleware/KycMiddleware.php - Application scheduler · Application-managed periodic execution and schedules.
src/core/app/Http/Controllers/CronController.php
Marketplace Domain
- Marketplace portals · User ordering and lawyer service management expose the shared lifecycle.
src/core/app/Http/Controllers/User/ServiceOrderController.php - Services, orders & bookings · Shared marketplace records for offerings and transactions.
src/core/app/Models/ServiceOrder.php
Payments & Payouts
- Payment orchestration · Initiates payments and handles provider callbacks.
src/core/app/Http/Controllers/Gateway/PaymentController.php - Stripe gateway adapter · Representative external gateway processing boundary.
src/core/app/Http/Controllers/Gateway/Stripe/ProcessController.php - Deposits & payouts · Tracks deposits, transactions, withdrawals, and financial state.
src/core/app/Models/Transaction.php
Communication
- Chat service · Keeps chat lifecycle separate from marketplace orders.
src/core/app/Services/ChatService.php - Realtime message event
src/core/app/Events/MessageSent.php - Notification delivery · Renders templates and dispatches email, SMS, and push.
src/core/app/Notify/NotifyProcess.php
Administration & UI
- Admin operations · Operates records, gateways, KYC, content, reports, and settings.
src/core/app/Http/Controllers/Admin/AdminController.php - Page builder
src/core/app/Http/Controllers/Admin/PageBuilderController.php - Blade templates · Basic selectable frontend template and admin layouts.
src/core/resources/views/templates/basic/layouts/frontend.blade.php - Public assets · Template assets and Firebase browser messaging configuration.
src/assets/templates/basic
Connections 22
- Nginx container → Public entry point: serves
- Public entry point → Laravel bootstrap: boots
- Laravel bootstrap → Audience & IPN routes: registers
- Audience & IPN routes → Identity & access gates: protects portal actions
- Identity & access gates → Marketplace portals: authorizes
- Marketplace portals → Services, orders & bookings: creates and updates
- Audience & IPN routes → Payment orchestration: payment and IPN endpoints
- Payment orchestration → Stripe gateway adapter: delegates processing
- Stripe gateway adapter → Payment orchestration: provider callback
- Payment orchestration → Deposits & payouts: records financial state
- Marketplace portals → Payment orchestration: funds orders and plans
- Marketplace portals → Chat service: supports participant chat
- Chat service → Realtime message event: emits
- Realtime message event → Notification delivery: triggers delivery
- Admin operations → Services, orders & bookings: operates records
- Admin operations → Deposits & payouts: manages withdrawals
- Admin operations → Page builder: manages content
- Page builder → Blade templates: publishes pages
- Blade templates → Public assets: uses
- Application scheduler → Services, orders & bookings: runs periodic work
- Laravel bootstrap → Environment & persistent storage: loads configuration
- Services, orders & bookings → Environment & persistent storage: persists data and uploads