How imxsquash/polissage-lending-v2 works
Project type and purpose
• This is a small full-stack PHP/JavaScript web application (“Polissage Lending v2”) for presenting automotive polishing training content.
• It uses PHP for routing and server-side rendering, JavaScript for interactive UI, and a Python script to generate or initialize JSON-based test data.
File structure
• Top-level
• composer.json (PHP dependencies)
• data/ (JSON files act as the data store: articles.json, courses.json, gallery.json, reviews.json)
• public/ (web-root containing index.php, CSS, JS, .htaccess)
• python/ (init_data.py for dev-only data generation)
• src/ (application code)
• src/
• config/config.php (application configuration)
• controllers/HomeController.php (handles incoming requests, invokes services)
• services/DataService.php (reads/writes JSON files, business logic)
• utils/Router.php (parses URLs and dispatches to appropriate controller)
• utils/ViewRenderer.php (renders PHP view templates)
• views/ (server-side templates, split into pages/ and components/)
• render.yaml (possibly build or deployment config)
• Architectural pattern: lightweight MVC. No external database—uses JSON files as datastore.
Extract additional insights from README
• Backend: PHP 8+
• Frontend: HTML/CSS served by PHP, JS for carousels and animations
• Python: only for generating test data in development
• Deployment: can run on PHP’s built-in server or any Apache/Nginx
a. Main components
1. Client/browser (requests, renders HTML/CSS/JS)
2. Web server (Apache/Nginx or PHP built-in)
3. Router (src/utils/Router.php)
4. Controllers (HomeController.php)
5. Services (DataService.php reading JSON files)
6. ViewRenderer (templates in src/views/)
7. Data store (JSON files under data/)
8. Static assets (public/css, public/js)
9. Python data generator (python/init_data.py)
b. Relationships and data flow
• Browser → HTTP request → Web server → index.php
• index.php → Router → Controller
• Controller → DataService → JSON data
• Controller → ViewRenderer → HTML
• HTML + CSS + JS → Browser
• Python script ↔ JSON files (only in dev workflow)
c. Architectural patterns / design principles
• MVC-style separation (Router, Controller, View)
• Single-source JSON datastore (no RDBMS)
• Clear separation between static assets and dynamic rendering
• Single entry point (public/index.php)
d. Key technologies
• PHP 8.0+, Composer
• JavaScript for UI interactivity
• Python 3.6+ (dev data generation)
• JSON files as datastore
• Apache/Nginx or PHP built-in server