Skip to content

Latest commit

 

History

History
66 lines (47 loc) · 1.69 KB

README.md

File metadata and controls

66 lines (47 loc) · 1.69 KB

Marko Skeleton

Application skeleton for the Marko Framework.

Installation

composer create-project marko/skeleton my-app
cd my-app

What's Included

  • public/index.php — Web entry point
  • app/ — Your application modules
  • modules/ — Third-party modules
  • config/ — Root configuration
  • storage/ — Logs, cache, sessions
  • .env.example — Environment template

Getting Started

  1. Copy .env.example to .env
  2. Install dev tools: composer install
  3. Start the dev server: marko up
  4. Visit http://localhost:8000

The skeleton ships a working Pest test harness out of the box. tests/Pest.php binds Marko\Testing\TestCase as the base, which registers PSR-4 autoloaders for app/* and modules/* automatically. Run tests with:

composer test

Next Steps

Create a module inside app/ (for example app/foo/, with a composer.json that maps App\Foo\ to src/), then add a controller. Routes are declared with attributes:

<?php

declare(strict_types=1);

namespace App\Foo\Controller;

use Marko\Routing\Attributes\Get;
use Marko\Routing\Http\Response;

class HomeController
{
    #[Get('/')]
    public function index(): Response
    {
        return new Response(
            body: 'Hello, Marko!',
        );
    }
}

See Your First Application for the full walkthrough, including the module's composer.json.

Documentation