How calvins-ongele/peer-2-peer works
This repository is a PHP MVC web application with public pages, account and game flows, and an administrative dashboard. Its central runtime path parses a request, dispatches a controller, loads a model and renders a view; the README describes the clean-URL MVC pattern. The sampled code also shows game and payment operations in a large shared model. Several domain controllers and views are present in the tree but were not sampled, so their internal wiring is not asserted here.
Main entry points: Controller.php Controller base · App.php URL dispatcher · index.php Front controller · Model.php Data access
Components 20
MVC runtime
- Front controller
index.php - URL dispatcher
libs/App.php - Request controllers
controllers - Controller base
libs/Controller.php - View renderer
libs/View.php - Session authorization
util/Auth.php
Product features
- Account management
models/user_model.php - Games and payments
models/myapp_model.php - Admin dashboard
controllers/dashboard.php - Blog publishing
controllers/blog.php
Web interface
- Public pages
views/index - Game screens
views/games/start.php - User game details
views/user/game-details.php - Dashboard screens
views/dashboard - Wager history
public/sections/wager-history.section.php
Persistence and session
- Data access
libs/Model.php - MySQL database
libs/Database.php - PHP session
libs/Session.php
Other components
- Visitor
- Payment service
Connections 11
- Visitor → Front controller: requests page
- Front controller → URL dispatcher: starts routing
index.php - URL dispatcher → Request controllers: dispatches request
libs/App.php - URL dispatcher → Controller base: loads controller
libs/App.php - Controller base → Request controllers: initializes model
libs/Controller.php - Controller base → View renderer: creates renderer
libs/Controller.php - Controller base → PHP session: initializes session
libs/Controller.php - Data access → MySQL database: opens connection
libs/Model.php - Controller base → Data access: loads model
libs/Controller.php - Games and payments → Payment service: initiates payment
models/myapp_model.php - Admin dashboard → Session authorization: checks access
controllers/dashboard.php