blueprintau/lucentapp

Lucent PHP framework project template

Maintainers

Package info

github.com/mineubob/LucentApp

Type:project

pkg:composer/blueprintau/lucentapp

Transparency log

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

dev-main 2026-08-07 22:13 UTC

This package is auto-updated.

Last update: 2026-08-08 10:34:37 UTC


README

Starter project template for the Lucent PHP framework.

Installation

Create a new project with Composer:

composer create-project blueprintau/lucentapp myapp

Getting started

cd myapp
cp .env.example .env   # already done automatically by composer create-project
composer serve          # or: vendor/bin/lucent serve

Example code

The template ships with a small, working example so you can see Lucent's conventions in action. It's safe to delete once you start building.

  • ModelApp/Models/User.php declares columns with the #[Column] attribute. Create its table with:

    vendor/bin/lucent migration make App/Models/User
  • ControllerApp/Controllers/UserController.php shows request validation (Rule::validateRequest) and route model binding (a type-hinted model parameter is resolved from the matching route placeholder, returning a 404 if missing). Controllers return PSR-7 Response objects.

  • MiddlewareApp/Middleware/RequestLogger.php shows a PSR-15 middleware (logs each request, adds a response header). It's attached to the route group via ->middleware([RequestLogger::class]).

  • Routesroutes/api.php registers a REST-style group:

    curl -X POST http://localhost:8000/user/create -d 'name=Jane&email=jane@example.com'
    curl http://localhost:8000/user/1
  • CLI commandApp/Commands/HelloCommand.php registered in commands/hello.php. Note that Lucent CLI commands don't support optional/default arguments, so a no-arg hello and a hello {name} variant are registered separately:

    vendor/bin/lucent hello
    vendor/bin/lucent hello Lucent

Testing

The project ships with PHPUnit wired up, plus example unit and feature tests to get you started.

composer test                # run the full test suite
composer test:unit           # run only the unit testsuite
composer test:feature        # run only the feature testsuite
composer test:coverage       # run with a text coverage report

Tests live in tests/ and use the Tests\ namespace:

tests/
├── bootstrap.php     # Composer autoloader bootstrap
├── TestCase.php      # Base test case (extend this, not PHPUnit's)
├── Unit/             # Unit tests
└── Feature/          # Feature tests (HTTP requests against a sqlite DB)

Feature tests dispatch real HTTP requests through the application against a throwaway sqlite database, so they never touch your real database. The Tests\TestCase::setUpDatabase() helper migrates the models you pass it.

Write your own tests by extending Tests\TestCase:

<?php

namespace Tests\Unit;

use Tests\TestCase;

class MyTest extends TestCase
{
    public function test_something(): void
    {
        $this->assertTrue(true);
    }
}

Structure

myapp/
├── App/
│   ├── Commands/
│   ├── Controllers/
│   ├── Models/
│   └── Rules/
├── commands/        # CLI command definitions
├── routes/          # HTTP route definitions
├── public/          # Web entry point (index.php)
├── storage/         # Application storage
├── logs/            # Log files
├── tests/           # PHPUnit tests (Unit + Feature)
├── .env.example     # Environment template
├── .editorconfig    # Editor/IDE conventions
├── .gitattributes   # Git attributes & archive exclusions
└── composer.json

Entry points

  • HTTP: public/index.php
  • CLI: vendor/bin/lucent

License

MIT