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.2.tar.gz (18.6 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.2-py3-none-any.whl (22.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: archiet_microcodegen-0.2.2.tar.gz
  • Upload date:
  • Size: 18.6 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.2.tar.gz
Algorithm Hash digest
SHA256 84f382ea1faa266ac0ef08853efcf3530d5a569c8e607f473fd121d86c4d2146
MD5 dddabd5c758a42bf2d19a7d2fa9bdd81
BLAKE2b-256 af249ee5cd88477ee80cf34100dffb6565f501dcfaff8158156035bd902bf6ef

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for archiet_microcodegen-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7b182aac6a822b5190b418750309bbbcf45948cfb0a2cd3127ad68cc9fc8b1ad
MD5 e3d44906d6240c6ceaae0814d86561ec
BLAKE2b-256 0ac5c23b1afe949b47395e42c8a29c17419b02c0f52e1e3ab000572de138f1a0

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