How mustafa-kh-hamad/bnka works
Project type and purpose
• This is a full-stack PHP web application for a memorization center.
• It follows an MVC-like pattern: routing and controllers in app/HTTP, business logic in app/Class, views in app/view, and core bootstrap/config in core.
File structure
• Top-level:
• public/ – webroot and static resources
• core/ – framework bootstrap, routing, autoload, configuration
• app/Class/ – service classes (Authenticator, Validator, Database, Session, Router), plus middleware
• app/HTTP/controller/ – controllers organized by resource (classes, dashboard, register, session, etc.)
• app/view/ – HTML views and components
• Configuration: core/configuration.php, app/Class/Database.php
• Routing: core/route.php → app/Class/Router.php
• Middleware: app/Class/middleware/* for Auth, Admin, Guest checks
Extract architecture hints from README
• Uses PHP server with single entry point (public/index.php)
• MySQL database with two tables: users (with classes_id FK) and classes
• Admin and user flows, automatic “Distribute” logic
Main components and their interactions
a. Client (browser) – sends HTTP requests, receives HTML/CSS/JS
b. Web server/PHP runtime – front-controller at public/index.php
c. Core framework – core/bootstrap.php loads autoloader, configures environment
d. Router – core/route.php & app/Class/Router.php dispatch requests to controllers
e. Middleware – Auth, Admin, Guest interceptors applied per-route
f. Controllers – in app/HTTP/controller handle requests, orchestrate services
g. Service classes – app/Class/Authenticator, Validator, Database, Session, ClassesModification
h. Views – app/view/ template rendering, components (header, footer)
i. Database – MySQL, accessed via app/Class/Database.php
j. Static assets – public/resources/images/, Tailwind CSS in the views
Architectural patterns & design principles
• MVC-inspired separation: Controllers ↔ Models (service classes) ↔ Views
• Front Controller: single entry (public/index.php)
• Dependency Injection via autoload; centralized configuration
• Middleware pipeline for authentication/authorization
• REST-style controllers for CRUD on classes, dashboard, sessions
What
• Clear component labels (Core, Router, Middleware, Controllers, Services, Views, DB)