How elan47/tirukkurals works
Project type and purpose
• It’s a full-stack Single Page Application (SPA) for browsing and listening to Tirukkural couplets.
• Backend: Laravel 7.x (MVC + REST API), Eloquent ORM, migration+seeds.
• Frontend: Vue.js 2.x SPA served from Laravel’s public/index.php, built with webpack-mix, Bootstrap 4, Lottie animations.
File structure
• Top-level:
– /app → Laravel application code (Models, Controllers, Middleware, Resources)
– /config → environment & service configurations (DB, cache, session, mail, sanctum)
– /database → migrations, factories, seeders
– /resources → Vue components, JS entrypoint, SASS, Blade views, localization
– /routes → API (routes/api.php), web (routes/web.php), console, channels
• Patterns: MVC on the backend, RESTful API endpoints, SPA frontend routing via Vue-Router, asset pipeline via webpack-mix.
Extract README insights
• Tech stack: Laravel 7.22.4, Vue.js 2.6.11, Bootstrap 4.5.2, LottiePlayer 0.5.1
• Purpose: modern client for an ancient Tamil text, search, audio playback, user auth.
Main components and interactions
a. Client (Browser SPA)
– Vue.js application (resources/js + compiled public/js/app.js)
– Vue-Router for navigation (Home, Section, Chapter, Kural pages, Login/Register)
– LottiePlayer + Bootstrap UI components
– Requests JSON via Axios to backend API
– Streams audio files from public/assets/audio
b. Web Server / Reverse Proxy
– Apache/Nginx serves public/index.php, static assets
– Forwards API calls (/api/*) to PHP runtime
c. Laravel Backend
– HTTP Kernel & Middleware (auth, CSRF, CORS, maintenance)
– Controllers (ChapterController, KuralController, Auth controllers, etc.)
– Resources (ChapterResource, KuralResource) transform Eloquent models to JSON
– Models & Eloquent ORM (Chapter, Section, Kural, ChapterGroup, User)
– Services: Auth (Sanctum or session), caching, queuing (if used), mailing, broadcasting (configurable)
d. Database
– MySQL/PostgreSQL (config/database.php) with users, chapters, sections, kurals tables
– Seeders & factories for test data
e. Storage
– Local filesystem for uploaded files (if any), logs, cache, sessions (config/storage)
f. Build Toolchain
– Node.js + webpack-mix (webpack.mix.js) compiles Vue, CSS/SASS into public/js & public/css
Architectural patterns / design principles
• MVC on backend, RESTful API for data, SPA on frontend
• Separation of concerns: Controllers + Resources (API layer), Models (data), Views (Blade only serves bootstrapping SPA)
• Asset pipeline isolation: Node/webpack compile before deployment
• Middleware chain ensures security, CORS, auth, etc.
Final checklist
– Notes on key frameworks (Laravel, Vue, Eloquent, webpack-mix)