How schery19/gravity-framework works
GRAVITY is a small PHP web-app scaffold built on the external Gravity Core framework. Its visible request path starts at the public front controller, dispatches a route, and renders a page or handled error through the app controller and templates. Configuration supplies view and asset paths; database settings exist, but no shown code uses them. The repository also provides thin repository, resource, and entity-layer scaffolding. The README describes project creation and a CLI, but the CLI implementation is not shown; unsampled route wiring is therefore not inferred.
Main entry points: index.php Front controller · BaseController.php Base controller · Entity.php Entity base · Repository.php Repository base
Components 13
Request handling
- Front controller
public/index.php - Gravity Core router
- User routes
src/routes/UsersRoutes.php - Base controller
src/app/Controllers/BaseController.php
Presentation
- Welcome view
templates/GRAVITY/welcome.php - Shared layout
templates/GRAVITY/layout.php - Error views
templates/GRAVITY/ERRORS
App scaffolding
- App configuration
configs/configs.php - Database settings
configs/database.php - Entity base
src/app/Entity/Entity.php - Repository base
src/app/Repository/Repository.php - Resource base
src/app/Resources/Resource.php
Other components
- Browser visitor
Connections 10
- Browser visitor → Front controller: requests page
public/index.php - Front controller → App configuration: loads config
public/index.php - Front controller → Gravity Core router: dispatches route
public/index.php - Front controller → Base controller: invokes controller
public/index.php - Base controller → Welcome view: renders view
src/app/Controllers/BaseController.php - Base controller → Shared layout: renders layout
src/app/Controllers/BaseController.php - Base controller → Error views: renders errors
src/app/Controllers/BaseController.php - Entity base → Gravity Core router: extends core entity
- Repository base → Gravity Core router: extends core repository
- Resource base → Gravity Core router: extends core resource