Skip to main content

Archiet's core algorithm in one file: PRD text -> FastAPI app ZIP, pure stdlib, zero dependencies.

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

archiet_microcodegen-0.2.3.tar.gz (19.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

archiet_microcodegen-0.2.3-py3-none-any.whl (22.9 kB view details)

Uploaded Python 3

File details

Details for the file archiet_microcodegen-0.2.3.tar.gz.

File metadata

  • Download URL: archiet_microcodegen-0.2.3.tar.gz
  • Upload date:
  • Size: 19.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for archiet_microcodegen-0.2.3.tar.gz
Algorithm Hash digest
SHA256 27cd4b3c878b9bc1b0e361cd9960aa72136ac74dcb5dc6ea67d44e83c502b616
MD5 45520e0645296f2394422a49fb88558b
BLAKE2b-256 baa634fbbf296eb29364bcc95265f1e9f4812be6a55dae41e8a8a926b2129428

See more details on using hashes here.

File details

Details for the file archiet_microcodegen-0.2.3-py3-none-any.whl.

File metadata

File hashes

Hashes for archiet_microcodegen-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d0b5f9fd572f0de51761444b4a31ef34879c7e735f42a81c48a7b6d038dbf921
MD5 8413d76b7b29095124a040f92456030c
BLAKE2b-256 7dff33db0b0d3fb354f5e4751dc4ae346e59b60352d60a46b9d691ae4ed1584a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page