How leonmmcoset/leonapp works
Project Type and Purpose
• It is a monolithic full-stack web application (“App Store”) written in PHP 7.4+.
• Uses Bootstrap for UI, MySQL for data storage, file system for app files/images, Composer for dependencies, and an SMTP server for email verification.
File Structure
• Top‐level entrypoints: index.php, app.php, api.php, router.php.
• Public web pages: index.php, app.php, download.php, rss.php, tags.php, thanks.php, history_announcements.php.
• Admin module: /admin/*.php
• Developer module: /developer/*.php
• Shared includes: /includes/logger.php, config.php
• Static assets: /css, /js, /scss, /less, /styles.css, /svgs, /webfonts, /sprites
• Data files: /files (uploads), /images (app previews, age_rating SVGs)
• Vendor: /vendor (Composer packages)
• Database schema: app_store.sql
• Email templates: /mail/verification_template.php
• Configuration: config.php, php.ini, nginx.htaccess
Key Architectural Patterns
• Monolithic PHP Front Controller pattern via router.php or direct .php entrypoints.
• Logical separation into Public UI, Admin UI, Developer UI.
• Shared services (logging, config, database connection) under /includes.
• File system storage for user‐uploaded binaries and static assets.
• REST-style API endpoints served by api.php.
Main Components
a. Client Browsers
• Public users
• App developers
• Admin users
b. Web Server Layer
• Nginx/Apache (nginx.htaccess)
• PHP Interpreter (config.php, router.php + .php pages)
• Composer Autoloader (/vendor)
c. Application Modules
• Public Module (index.php, app.php, download.php, rss.php, tags.php, etc.)
• Admin Module (/admin/*.php)
• Developer Module (/developer/*.php)
• API Layer (api.php)
• Shared Services (/includes/logger.php, config.php, router.php)
• Email Service (mail/verification_template.php → SMTP)
d. Data Storage
• MySQL Database (app_store.sql schema)
• File System:
• /files → uploaded app packages
• /css, /js, /svgs, /webfonts → static assets
e. External Services
• SMTP Server (for email verification)
Relationships & Data Flow
• Browsers → HTTP → Web Server → PHP Front Controller or direct .php
• PHP code →
• Queries MySQL (CRUD operations via PDO/mysqli)
• Reads/Writes to file system (/files, /images)
• Sends emails via SMTP (mail/verification_template.php)
• API calls from front‐end or third parties → api.php → same backend services
• Admin/Developer modules share database and file system with Public module