Download the PHP package mathsgod/light without Composer
On this page you can find all versions of the php package mathsgod/light. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package light
light
A lightweight PHP 8.3+ GraphQL backend framework for building admin/CMS applications. Exposes a GraphQL API (plus a few REST endpoints for file serving) backed by a custom ORM (mathsgod/light-db), RBAC, and a PSR-15 middleware pipeline.
The companion frontend module is nuxt-light — a Nuxt 4 module using Quasar UI.
Requirements
- PHP >= 8.3
- Composer
- MySQL / MariaDB (or any Laminas DB-supported database)
Installation
Configuration
All configuration is read from a .env file in the project root.
Database
JWT Secret
A random string used to sign JWT access/refresh tokens.
Timezone
Google Sign-In (optional)
Install the Google API client:
Then set:
Other optional settings
Development Server
Both start php -S 0.0.0.0:8888 router.php.
Database Schema
Initialize the database schema (defined in db.json):
CLI Scaffolding
Architecture
Schema generation is annotation-driven via TheCodingMachine/GraphQLite. Controllers in src/Controller/ declare queries and mutations using PHP 8 attributes (#[Query], #[Mutation], #[Type], etc.).
ORM — models live in src/Model/ and extend Light\Model. The schema is defined in db.json. save() and delete() auto-populate audit fields (created_time, updated_time, created_by, updated_by) and write to EventLog.
RBAC — role → permission mappings bootstrap from permissions.yml; menus bootstrap from menus.yml. The Administrators role always has * (wildcard) permission.
File storage — file operations go through Light\Drive (Flysystem MountManager). Supported adapters: Local, AWS S3, Aliyun OSS, Hostlink.
Directory Layout
| Path | Purpose |
|---|---|
src/Controller/ |
GraphQL controllers (queries & mutations) |
src/Model/ |
ORM models, extend Light\Model |
src/Input/ |
GraphQL input types for mutations |
src/Type/ |
GraphQL output types |
src/Command/ |
Symfony Console CLI commands |
src/Auth/ |
JWT auth & authorization logic |
src/Drive/ |
Flysystem drive abstraction |
function/ |
Global helper functions (auto-loaded) |
pages/ |
Optional plain-PHP pages (return JSON) |
db.json |
Database schema definition |
menus.yml |
Hierarchical menu definitions |
permissions.yml |
Role → permission bootstrap mappings |
Authentication Flow
- Login via GraphQL mutation → returns
access_token(short-lived JWT) +refresh_token - Subsequent requests send
Authorization: Bearer <access_token> - Token refresh:
POST /refresh_token - Optional 2FA (TOTP) and WebAuthn supported via
src/Security/
Testing
Tests require a real DB connection (integration tests). Each test wraps in a DB transaction and rolls back in tearDown().
License
MIT
All versions of light with dependencies
laminas/laminas-code Version ^4.7
league/container Version ^5.2
firebase/php-jwt Version ^7.0
laminas/laminas-diactoros Version ^3.5
symfony/yaml Version ^7.4
ramsey/uuid Version ^4.7
league/flysystem Version ^3.15
league/flysystem-path-prefixing Version ^3.3
phpmailer/phpmailer Version ^6.8
symfony/cache Version ^7.4
endroid/qr-code Version ^4.8
sebastian/diff Version ^7.0
mathsgod/light-rbac Version ^1.0
league/event Version ^3.0
utopia-php/system Version ^0.9.0
mathsgod/light-server Version ^1.1
mathsgod/light-graphql Version ^1.3
symfony/serializer Version ^7.4
symfony/property-info Version ^7.4
symfony/property-access Version ^7.4
web-auth/webauthn-lib Version ^4.9
mathsgod/light-db Version ^1.7.0
mathsgod/light-db-graphqlite-mappers Version ^1.0
mathsgod/json-to-sql Version ^1.0
mathsgod/mysql-schema-migrate Version ^1.0
symfony/console Version ^7.4
thecodingmachine/graphqlite Version ^8.3