Skip to main content

archiet-microcodegen

PRD text → working FastAPI + PostgreSQL app → ZIP. One command. No LLM. No API key. Pure Python stdlib. 1,377 lines you can read in 20 minutes.

Inspired by Karpathy's micrograd: this file is the complete algorithm. Everything else is just efficiency on top.

pip install archiet-microcodegen
archiet-microcodegen prd.md --out ./myapp/
cd myapp && docker compose up
# → http://localhost:8000/docs

What you get

Write a PRD describing your entities and user stories. Get back a bootable app:

File What it does
main.py FastAPI app with /docs OpenAPI explorer
models/*.py SQLAlchemy 2.0 models, one per entity
schemas/*.py Pydantic v2 Create / Update / Response schemas
routers/*.py Full CRUD — list, create, get, update, delete
auth.py JWT via httpOnly cookies — register / login / logout / me
alembic/ Migrations pre-configured, run alembic upgrade head
tests/test_*.py pytest suite with DB override, auto-skip if Postgres unreachable
docker-compose.yml Postgres 16 with healthcheck-gated startup
ARCHITECTURE.md ArchiMate 3.2 element map — ApplicationComponent, DataObject, ApplicationService, ApplicationInterface
openapi.yaml Machine-readable API contract, importable into Postman

Every entity has per-tenant data isolation built in. Every query filters by the authenticated user's ID. No data leaks between users.

Zero LLM calls. Zero API keys. Zero runtime dependencies. Pure Python stdlib.

The four stages

PRD text
  │
  ▼ parse_prd()        — regex extraction: entities, fields, user stories, integrations
manifest dict
  │
  ▼ manifest_to_genome() — maps to canonical IR with ArchiMate 3.2 element typing
genome dict              (same schema as archiet.com's full platform)
  │
  ▼ render_genome()    — string.Template FastAPI rendering
{path: content}
  │
  ▼ pack()             — stdlib zipfile
ZIP bytes

The genome is the key: your PRD becomes an ArchiMate 3.2 architecture document before any code is generated. That's what makes the output traceable and maintainable — not just scaffolded.

As a library

from archiet_microcodegen import microcodegen, parse_prd, manifest_to_genome, render_genome

# Full pipeline
zip_bytes = microcodegen(open("prd.md").read())

# Or stage by stage
manifest = parse_prd(prd_text)
genome   = manifest_to_genome(manifest)
files    = render_genome(genome)   # dict[str, str]
# inspect files["ARCHITECTURE.md"] to see the ArchiMate element map

Example PRD

# Task Manager

## Entities
- Task: title (string, required), description (text), status (string), due_date (date)
- Project: name (string, required), description (text)

## User Stories
As a user, I want to create tasks so I can track my work.
As a user, I want to assign tasks to projects so I can organise them.

## Integrations
- Stripe for billing

Run it: archiet-microcodegen prd.md --out ./taskapp/ — you'll get 23 files including a fully wired FastAPI app with Task and Project CRUD, auth, migrations, tests, and an ARCHITECTURE.md with ArchiMate 3.2 notation.

Why no LLMs

LLMs are great at understanding messy PRDs. They're unnecessary for the generation step — once you have a clean manifest, code emission is deterministic. This file handles the deterministic half. The full platform at archiet.com handles the LLM-powered extraction, 14 stacks, frontend, mobile, and delivery gates.

If a bug doesn't reproduce with microcodegen, it's in an efficiency layer, not the algorithm.

What's NOT here

  • No LLM extraction (full platform handles messy natural-language PRDs)
  • No frontend, no mobile, no Stripe wiring, no rate limiting, no audit logging
  • No multi-stack (FastAPI only here — for Flask, Django, NestJS, Go, Java see archiet.com)

License

MIT. See LICENSE.

Links

Metadata

Release files for archiet-microcodegen 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for archiet-microcodegen 0.2.3
File Size Uploaded
archiet_microcodegen-0.2.3.tar.gz 19.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for archiet-microcodegen 0.2.3
File Interpreter ABI Platform
archiet_microcodegen-0.2.3-py3-none-any.whl Python 3 none any Details

Total release size: 42.7 kB

Release files / archiet_microcodegen-0.2.3.tar.gz

Download URL archiet_microcodegen-0.2.3.tar.gz
Size 19.8 kB
Tags Source
SHA-256 checksum
How to use checksums
27cd4b3c878b9bc1b0e361cd9960aa72136ac74dcb5dc6ea67d44e83c502b616
BLAKE2b-256 checksum
How to use checksums
baa634fbbf296eb29364bcc95265f1e9f4812be6a55dae41e8a8a926b2129428
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / archiet_microcodegen-0.2.3-py3-none-any.whl

Download URL archiet_microcodegen-0.2.3-py3-none-any.whl
Size 22.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d0b5f9fd572f0de51761444b4a31ef34879c7e735f42a81c48a7b6d038dbf921
BLAKE2b-256 checksum
How to use checksums
7dff33db0b0d3fb354f5e4751dc4ae346e59b60352d60a46b9d691ae4ed1584a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release history Release notifications | RSS feed

This release

0.2.3 This release

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page