How fliz-none/capstoneproject works
Project Type and Purpose
• This is a composite capstone monorepo containing two major subsystems:
a. LaravelCore – a full-stack Laravel application providing both an administrator dashboard and a customer-facing web shop, including REST endpoints, templated views, real-time chat, and scheduled background jobs.
b. RasaBot – a standalone Rasa NLU/Dialogue microservice that handles conversational queries (e.g., check order, check product, promotions, stock) and custom action logic, often querying the same database.
High-Level File-Structure Analysis
• LaravelCore
• app/: Controllers (split into Admin and public controllers), Models, Events, Jobs, Observers, Middleware, Console Commands, Helpers, Rules, Mail, Providers.
• config/, database/ (migrations, seeders), routes/, resources/views/, public/, storage/, tests/
• Integrations: Pusher (real-time chat broadcasts), scheduled tasks (Kernel.php), queued jobs (e.g., ProcessRasaMessage).
• RasaBot
• config.yml, credentials.yml, endpoints.yml – Rasa server configuration
• data/: NLU training data, rules, stories
• domain.yml – intents, entities, slots
• actions/: custom Python code (actions.py, db_helper.py) to query the shared database
• main.py – Rasa runner entrypoint
• models/: trained Rasa model tarball
Key README Insights
• Minimal README: project titled “CapstoneProject,” implying a showcase/integration of ecommerce and conversational AI.
Main Components
a. Client Layer
• End Users (Web Browsers / Mobile)
• Admin Users (Browser)
• Chat Widgets embedded in both public and admin UIs
b. Web Application Layer (LaravelCore)
• HTTP Controllers (Admin vs Web vs API)
• Middleware (Auth, GlobalSettings, isAdmin, CSRF)
• Business Logic (Services, Jobs, Console Commands)
• Real-time Layer (Pusher channel broadcasting events)
c. Data Layer
• MySQL (or configured relational database) for persistent storage (users, products, orders, conversations, etc.)
• File Storage (local disk under storage/app/public for attachments, images)
d. Conversational AI Layer (RasaBot)
• Rasa Core & NLU Engine – HTTP endpoint (/webhooks/rest/webhook)
• Custom Actions – Python code that connects to the same database via db_helper
• Training Data & Models
e. External Services
• Pusher (for broadcasting chat messages)
• SMTP (Mail::SendMail) for notifications
• Google Drive (GoogleDriveServiceProvider)
Relationships and Data Flows
1. User ⇄ LaravelCore Web UI
• Standard HTTP GET/POST (blade templates, JS, CSS)
• Chat UI posts messages to Laravel ChatController
2. LaravelCore ⇄ Database
• Eloquent ORM (app/Models) for CRUD
• Migrations & Seeders for schema and test data
3. LaravelCore ⇄ RasaBot
• ChatController or queued job (ProcessRasaMessage) makes an HTTP request to Rasa HTTP API
• Rasa processes intent via trained model, then calls custom action endpoint (actions.py)
• Custom action queries database and returns a structured reply
• Rasa returns final message payload back to Laravel
4. LaravelCore ⇄ Pusher
• Once Laravel receives Rasa response, it fires PusherBroadcast event
• Clients subscribed to the channel receive real-time updates
Architectural Patterns / Principles
• MVC (Laravel’s controllers, models, views)
• Microservice style for AI (RasaBot)
• Event-driven in chat subsystem (Jobs, Events, Pusher)
• Layered separation: Presentation (Views/JS), Application (Controllers/Jobs), Domain (Models/Services), Infrastructure (DB, External APIs)
• Component boundaries with labels