How leopoldo-medeiros/codecv6 works
Project type and purpose
• This is a monolithic, full-stack Laravel web application with a user-facing site, an admin panel, RESTful API endpoints, authentication/authorization, course management, payment processing, and background job/email handling.
Top-level architecture components
a. Client Layer
• Web browsers (HTML/Blade + CSS/JS served via public/)
• Mobile apps or third-party clients (hitting api/index.php endpoints)
b. Web Server Layer
• Nginx/Apache proxies to:
– public/index.php (Laravel web routes)
– api/index.php (standalone or micro-API entrypoint)
c. Application Layer (Laravel MVC)
• Router (routes/web.php & routes/api.php)
• HTTP Controllers (app/Http/Controllers)
• Requests & Validation (app/Http/Requests)
• Domain Models & ORM (Eloquent in app/Models)
• Service Providers & Container (app/Providers)
• Migrations, Seeders (database/)
• Blade Templating (resources/views + layouts/includes)
• Assets & Build (resources/js/css + vite.config.js → public/js/css)
d. Persistence & Caching
• Relational database (MySQL/Postgres per config/database.php)
• Cache/session store (Redis, Memcached, file per config/cache.php)
• Queue backend (Redis or database per config/queue.php)
e. Supporting Services
• Mail server or SMTP provider (config/mail.php)
• Payment gateway (Stripe/PayPal invoked in PaymentController)
• External APIs (if any – defined in config/services.php)
• Background workers (php artisan queue:work)
f. DevOps & Deployment
• Environment (.env)
• Lando (lando.yml) or Docker for local dev
• CI (GitHub Actions stub in README)
• Composer & NPM build pipelines
Relationships and data flows
• Web client → HTTP(S) → Web server → public/index.php
→ Laravel Router → Controllers → Services/Models → Database
→ Controller → Blade view → HTML response back to client
• API client → HTTP(S) → Web server → api/index.php
→ Laravel/Custom micro-framework controllers → JSON response
• Controllers dispatch Jobs → Queue → Worker → processes jobs (email, notifications)
• Controllers trigger Mailables → SMTP server → client inbox
• Controllers interact with Payment API → external payment gateway → callback/webhook → controller
Architectural patterns & design principles
• MVC (Model-View-Controller) for web flows
• RESTful endpoints for API flows
• Dependency Injection via Service Providers
• Repository or Service layer (if implemented) for business logic separation
• Event-driven background processing (Jobs/Queues)
• Configuration-driven design (.env, config/*.php)
• Single codebase with modular directory separation (api/, app/, resources/, public/)
[ ] Clear labels for each component (e.g., “User Browser”, “Nginx”, “Laravel Router”)
[ ] Zoom-in inset for the Laravel MVC directory layout