Skip to content

Commit 11ebc7b

Browse files
markshustclaude
andcommitted
docs: update README quick start to use composer create-project marko/skeleton
Simplify onboarding from 6 manual steps to 3: create-project, add controller, marko up. Includes the module composer.json for proper autoloading. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 00a716f commit 11ebc7b

1 file changed

Lines changed: 21 additions & 29 deletions

File tree

README.md

Lines changed: 21 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -40,43 +40,23 @@ Marko is a modular PHP 8.5+ framework where everything is a module: your app cod
4040
## Quick Start
4141

4242
```bash
43-
# Create a new project
44-
mkdir my-app && cd my-app
45-
composer init --type=project --name=my/app
46-
47-
# Require the packages you need
48-
composer require marko/core marko/routing marko/config marko/env
49-
50-
```
51-
52-
Create your entry point at `public/index.php`:
53-
54-
```php
55-
<?php
56-
57-
declare(strict_types=1);
58-
59-
require_once __DIR__ . '/../vendor/autoload.php';
60-
61-
use Marko\Core\Application;
62-
63-
$app = Application::boot(dirname(__DIR__));
64-
$app->handleRequest();
43+
composer create-project marko/skeleton my-app
44+
cd my-app
6545
```
6646

67-
Create your first controller at `app/foo/src/Controller/HomeController.php`:
47+
Create your first controller at `app/hello/src/Controller/HelloController.php`:
6848

6949
```php
7050
<?php
7151

7252
declare(strict_types=1);
7353

74-
namespace App\Foo\Controller;
54+
namespace App\Hello\Controller;
7555

76-
use Marko\Routing\Attribute\Get;
56+
use Marko\Routing\Attributes\Get;
7757
use Marko\Routing\Http\Response;
7858

79-
class HomeController
59+
class HelloController
8060
{
8161
#[Get('/')]
8262
public function index(): Response
@@ -86,11 +66,23 @@ class HomeController
8666
}
8767
```
8868

89-
Register the namespace in `composer.json`, then run:
69+
Register the namespace in `app/hello/composer.json`:
70+
71+
```json
72+
{
73+
"name": "app/hello",
74+
"autoload": {
75+
"psr-4": {
76+
"App\\Hello\\": "src/"
77+
}
78+
}
79+
}
80+
```
81+
82+
Start the dev server:
9083

9184
```bash
92-
composer dump-autoload
93-
php -S localhost:8000 -t public
85+
marko up
9486
```
9587

9688
Visit [http://localhost:8000](http://localhost:8000) to see your response.

0 commit comments

Comments
 (0)