How lucasnvs/siboon works
Project Type and Purpose
• The project is an e-commerce platform for a skate shop. It follows the MVC pattern and is designed as a full-stack web application with distinct modules for API endpoints, administrative interfaces, and public-facing web/app views.
• Key functionalities include user authentication, shopping cart management (with LocalStorage), integration with external services (simulated Payment and Shipment via MockWebService), and a well-structured database backend (MySQL).
• The README also notes the usage of PHP, Composer for dependency management, CoffeeCode Router for routing, Plates Template Engine for templating, and Firebase JWT for authentication.
Analyzing the File Structure
• Top-level Files/Directories:
• .env.example (environment configuration), .htaccess files (URL rewriting/security), index.php (entry point).
• "api" directory: Contains its own .htaccess, README, and index.php – this indicates a dedicated API layer for service integration.
• "db" directory: Holds SQL schema and test initialization scripts indicating database setup and population.
• "source" directory: Houses the core PHP application logic (Boot, Controller, Core, Exceptions, Models, etc.). This is the backbone following the MVC pattern.
• The "themes" directory is well organized into subdirectories such as admin, app, shared, and web. They represent different presentation layers for various user interfaces:
• "admin" for administration,
• "app" for mobile or a specialized shopping experience,
• "web" for the public website,
• "shared" for common scripts and component libraries managed by the frontend.
Key Components
a. Backend (Server-Side):
• Application Core: Represent the "source" directory split into modules such as Controllers (AdminController, Api Controllers, WebController), Models (handling business logic for Company, Faq, Inventory, Order, Product, User, Website), and Core utilities (API Controller, TokenJWT, configuration, exception handling).
• API Module: Show the dedicated "api" directory and its interactions with API controllers located under the source (e.g., Api controllers in source/Controller/Api) and with external clients.
• External Services Integration: Include the "MockWebService" components for Payment and Shipment. Indicate that these simulate external integrations.
b. Frontend (Client-Side):
c. Database:
• MySQL Database: Represented by the "db" components, with SQL schema (siboon_schemas.sql) and initialization/test scripts. Indicate data flow between Models and the database.
d. External Libraries & Frameworks:
Illustrating Relationships and Interactions
• From the client (different themes) to the web controllers.
• From the API endpoints (api directory and its controllers) to any external client (e.g., mobile apps or third-party integrations).
• From Controllers to Models – outlining how the MVC pattern processes user requests.
• From Models to the Database (MySQL) to indicate CRUD operations.
Emphasizing Architectural Patterns and Design Principles
• Separation of concerns: the API layer is explicitly separated from the main web app while sharing common business logic.