PHPackages                             archiet/microcodegen-laravel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. archiet/microcodegen-laravel

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

archiet/microcodegen-laravel
============================

PRD text -&gt; Laravel 11 app -&gt; ZIP. Pure PHP stdlib. &lt;1400 LOC. Zero LLM calls.

00PHP

Since May 25Pushed 2mo agoCompare

[ Source](https://github.com/aniekanasuquookono-web/archiet-microcodegen-laravel)[ Packagist](https://packagist.org/packages/archiet/microcodegen-laravel)[ RSS](/packages/archiet-microcodegen-laravel/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

archiet-microcodegen-laravel
============================

[](#archiet-microcodegen-laravel)

> PRD text → working Laravel 11 app → ZIP, in &lt;1400 LOC, pure PHP stdlib, zero LLM calls.
> Inspired by Karpathy's micrograd: this file is the complete algorithm.

[![Packagist](https://camo.githubusercontent.com/f4994243abbe62f56d05d11cf148a41ba7bd43edc62997c1c533af349885da6c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f617263686965742f6d6963726f636f646567656e2d6c61726176656c)](https://packagist.org/packages/archiet/microcodegen-laravel)[![PHP](https://camo.githubusercontent.com/8f0af9c5395ae4ef8ba7a7ad65fa61c44927ea9c3eb3be91a13c678254f29bd4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e322d383839324246)](https://php.net)[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](LICENSE)

---

The fastest path from requirements to a running Laravel REST API
----------------------------------------------------------------

[](#the-fastest-path-from-requirements-to-a-running-laravel-rest-api)

You have a PRD (a Markdown file, a Confluence export, a Notion page).
You want a **Laravel 11 REST API** with real auth, a real database, and real routing — ready to `docker compose up`.
Most tools give you a prompt and a prayer. This gives you a ZIP in 3 seconds.

```
composer global require archiet/microcodegen-laravel
archiet-microcodegen-laravel prd.md --out ./my-app
cd my-app && cp .env.example .env && docker compose up
```

First request hits `/api/auth/register` before the coffee is done.

---

Install
-------

[](#install)

```
# Global install (recommended)
composer global require archiet/microcodegen-laravel

# Or run the single PHP file directly
curl -LO https://raw.githubusercontent.com/aniekanasuquookono-web/archiet/main/archiet_microcodegen_laravel/bin/archiet-microcodegen-laravel.php
php archiet-microcodegen-laravel.php prd.md --out ./my-app
```

---

Use
---

[](#use)

### CLI

[](#cli)

```
# Write files to a directory
archiet-microcodegen-laravel prd.md --out ./my-api

# Write a ZIP instead
archiet-microcodegen-laravel prd.md --zip my-api.zip

# Then boot
cd my-api
cp .env.example .env        # edit DB_PASSWORD, JWT_SECRET
docker compose up           # Postgres + Laravel artisan serve
php artisan migrate         # (runs automatically on first boot via Dockerfile)
```

### Library (PHP)

[](#library-php)

```
require 'vendor/autoload.php';

$text     = file_get_contents('prd.md');
$manifest = parse_prd($text);
$genome   = manifest_to_genome($manifest);
$files    = render_genome($genome);

// Write to disk
write_disk($files, './output');

// Or get a ZIP blob
$zip = zip_create($files);
file_put_contents('output.zip', $zip);
```

---

Sample input: a real PRD excerpt
--------------------------------

[](#sample-input-a-real-prd-excerpt)

```
# Task Manager

## Entities

**Project**
  - name: string (required)
  - description: text
  - status: string (required)

**Task**
  - title: string (required)
  - body: text
  - due_date: date
  - priority: string
```

**Output:** a complete Laravel 11 app with `Project` and `Task` models, per-tenant scoping, JWT auth, Eloquent ORM, migrations, Dockerfile, and `openapi.yaml` — ready to `docker compose up`.

---

What you get
------------

[](#what-you-get)

FileWhat it does`composer.json`Package manifest, declares `laravel/framework ^11.0``artisan`Laravel CLI entry point`bootstrap/app.php`Laravel 11 bootstrap with API routing and JWT middleware alias`config/database.php`PostgreSQL config driven by `DATABASE_URL` env var`config/jwt.php`JWT secret + TTL from env`routes/api.php`Auth routes + `apiResource` for every entity`app/Models/User.php``Authenticatable`, `fillable`, `hidden``app/Models/{Entity}.php`Eloquent model with `scopeForUser(Builder $q, int $uid)``app/Http/Controllers/AuthController.php``register`, `login`, `logout`, `me` with inline JWT helpers`app/Http/Controllers/{Entity}Controller.php`Full CRUD, every query scoped to `_user_id``app/Http/Middleware/JwtMiddleware.php`Validates `access_token` httpOnly cookie`database/migrations/*.php`One migration per entity + users table`.env.example`All required env vars pre-documented`Dockerfile`Multi-stage PHP 8.3 build`docker-compose.yml`App + Postgres 16, healthcheck-gated`ARCHITECTURE.md`ArchiMate 3.2 ApplicationComponent + DataObject inventory`openapi.yaml`Machine-readable API contract---

The four stages
---------------

[](#the-four-stages)

```
parse_prd(text)              → manifest   (entities, stories, integrations)
manifest_to_genome(manifest) → genome     (ArchiMate 3.2 typed IR)
render_genome(genome)        → files      (Laravel 11 PHP source)
zip_create(files) / write_disk(files, dir)

```

**Stage 1** — regex-based PRD parser. Finds entities, fields, user stories, and third-party integrations (Stripe, SendGrid, Twilio, …) without an LLM.

**Stage 2** — converts the manifest into a structured genome. Every entity gains `id`, `user_id`, `created_at`, `updated_at` automatically. The genome is a plain PHP array — no classes, no ORM, no magic.

**Stage 3** — renders all Laravel files from the genome. Auth logic (JWT encode/decode, httpOnly cookie) is baked into `AuthController.php` as plain functions — no Sanctum, no Passport, no external library required at runtime.

**Stage 4** — writes files to a directory or produces a valid PKZIP file using PHP's native `gzdeflate()` and `pack()`. Zero dependency on `ZipArchive`.

---

Security by default
-------------------

[](#security-by-default)

- **httpOnly cookie, not localStorage.** The `access_token` cookie is `httpOnly`, `secure`, `SameSite=Lax`. The JWT payload never touches JavaScript.
- **Per-tenant isolation.** Every Eloquent model has a `scopeForUser(Builder $q, int $uid)`scope. Every controller calls `forUser($request->_user_id)` before any read or write. There is no code path that returns another user's data.
- **Zero hardcoded secrets.** `JWT_SECRET` and `DB_PASSWORD` are environment variables. `.env.example` is the only file with placeholders; it is never loaded in production.

---

archiet-microcodegen-laravel vs the alternatives
------------------------------------------------

[](#archiet-microcodegen-laravel-vs-the-alternatives)

`archiet-microcodegen-laravel``laravel new``laravel/breeze`InputYour PRDNothingNothingOutputFull CRUD API for your entitiesEmpty skeletonAuth scaffold onlyAuthJWT httpOnly cookieSession / SanctumSession / SanctumPer-tenant isolationBuilt-in (`scopeForUser`)NoneNoneEntitiesFrom your requirementsNoneNone`docker-compose.yml`✅❌❌`openapi.yaml`✅❌❌`ARCHITECTURE.md`✅ ArchiMate 3.2❌❌LLM / API key❌ Never❌❌---

FAQ
---

[](#faq)

**Does the generated app really boot with `docker compose up`?**
Yes. The generated `Dockerfile` runs a multi-stage PHP 8.3 build; `docker-compose.yml`waits for Postgres `pg_isready` before starting Laravel. `php artisan migrate` runs as part of the boot sequence.

**Is the generator itself pure PHP stdlib?**
Yes. `archiet-microcodegen-laravel.php` uses only `gzdeflate`, `pack`, `preg_match`, `json_encode`, `file_get_contents`, and `file_put_contents`. No Composer runtime dependencies in the generator. The generated app has its own `composer.json`.

**What PHP version is required?**
PHP ≥ 8.2 for the generator. The generated app targets PHP 8.3.

**What Laravel version does it generate?**
Laravel 11, using the `bootstrap/app.php` bootstrap style (no `Http/Kernel.php`).

**What about Sanctum or Passport for auth?**
The generated app uses a custom JWT middleware with no external package — one less thing to configure. If you prefer Sanctum, the generator is a single PHP file; fork and adapt Stage 3.

**What's NOT generated?**
Queue workers, broadcasting, file uploads, mail templates, front-end scaffolding, and multi-database support. For a full-stack app generated from your architecture diagram, see [archiet.com](https://archiet.com?utm_source=packagist&utm_medium=package&utm_campaign=microcodegen-laravel).

---

Why this exists
---------------

[](#why-this-exists)

Architecture before code. A vibe-coded Laravel app has routes and models. An *architected* Laravel app has a formal representation of why those routes and models exist — what requirement they satisfy, what component they belong to, what boundaries they must not cross.

`archiet-microcodegen-laravel` encodes that representation as an ArchiMate 3.2 genome and renders it deterministically. Same PRD → same app. No hallucinations.

The genome is not a prompt. It is a typed intermediate representation: every entity has an archimate type, every field has a domain type, every auth rule is a structural constraint — not a comment in a template.

For teams that want a full architecture-to-code platform (multi-stack, governance, PRD intake, quality scoring, delivery gates), visit [archiet.com](https://archiet.com?utm_source=packagist&utm_medium=package&utm_campaign=microcodegen-laravel).

---

*Generated with [archiet-microcodegen-laravel](https://packagist.org/packages/archiet/microcodegen-laravel) · [archiet.com](https://archiet.com?utm_source=packagist&utm_medium=package&utm_campaign=microcodegen-laravel)*

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance58

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/51254310?v=4)[Archiet](/maintainers/Archiet)[@Archiet](https://github.com/Archiet)

---

Top Contributors

[![aniekanasuquookono-web](https://avatars.githubusercontent.com/u/265106487?v=4)](https://github.com/aniekanasuquookono-web "aniekanasuquookono-web (1 commits)")

### Embed Badge

![Health badge](/badges/archiet-microcodegen-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/archiet-microcodegen-laravel/health.svg)](https://phpackages.com/packages/archiet-microcodegen-laravel)
```

###  Alternatives

[jderusse/composer-warmup

179101.9k](/packages/jderusse-composer-warmup)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
