Skip to main content

archiet-microcodegen-flask

PRD text → working Flask + SQLAlchemy app → ZIP, in <1400 LOC, pure stdlib, zero LLM calls. Inspired by Karpathy's micrograd: this file is the complete algorithm.

Built on Archiet — AI-native architecture-to-code platform.

Install

pip install archiet-microcodegen-flask

Use

# Write ZIP to disk
archiet-microcodegen-flask path/to/prd.md --out ./out/

# Pipe ZIP to stdout
archiet-microcodegen-flask path/to/prd.md > app.zip

As a library:

from archiet_microcodegen_flask import microcodegen_flask

prd_text = open("prd.md").read()
zip_bytes = microcodegen_flask(prd_text)

What you get

The generated output is a working Flask + PostgreSQL app:

app/__init__.py          Flask app factory — create_app()
app/extensions.py        db, jwt, migrate singletons
app/auth/routes.py       register / login / logout / me
app/models/user.py       User model
app/models/<entity>.py   One SQLAlchemy model per entity
app/routes/<entity>.py   One Blueprint per entity (full CRUD)
config.py                JWT_TOKEN_LOCATION=["cookies"], JWT_COOKIE_HTTPONLY=True
manage.py                Flask CLI entrypoint
requirements.txt         flask, flask-sqlalchemy, flask-jwt-extended, flask-migrate, psycopg2-binary
docker-compose.yml       Postgres 16 with healthcheck-gated startup
Dockerfile               python:3.12-slim, port 5000
.env.example             DATABASE_URL, JWT_SECRET_KEY, SECRET_KEY
tests/test_app.py        pytest smoke tests (register, login, health)
ARCHITECTURE.md          ArchiMate 3.2 element map
openapi.yaml             OpenAPI 3.1 spec
GENOME.json              Intermediate representation (for debugging/regeneration)
README.md                Quick-start for the generated app

The four stages

  1. parse_prd(text) → manifest — regex extraction of entities, fields, user stories, integrations
  2. manifest_to_genome(manifest) → genome — maps to canonical IR with ArchiMate 3.2 element typing
  3. render_genome(genome) → {path: content} — string.Template-based Flask rendering
  4. pack(files) → bytes — stdlib zipfile

Auth — httpOnly cookies, non-negotiable

  • JWT_TOKEN_LOCATION = ["cookies"]
  • JWT_COOKIE_HTTPONLY = True
  • JWT_COOKIE_SAMESITE = "Lax"
  • Register → sets cookie. Login → sets cookie. Logout → clears cookie.
  • NEVER localStorage. NEVER Authorization header in response body.

Why this exists

Spec-driven architecture before vibecoding. The genome is an ArchiMate 3.2 intermediate representation — your PRD becomes an architecture document, not just a prompt.

The full Archiet platform adds:

  • LLM-powered PRD extraction (chunked, overlap+dedup, handles natural language)
  • 12+ stack renderers (FastAPI, Flask, Django, NestJS, Laravel, Go, Java, Rails, .NET, Tauri+Rust, Salesforce, SAP CAP)
  • Capability emission, frontend (Next.js / Expo), stub-filling, quality scoring, delivery gates
  • Cross-stack parity enforcement and verification

But none of that changes the core algorithm. If a bug doesn't reproduce here, it's in an efficiency layer.

What's NOT included

  • No LLM calls (deterministic zone by design)
  • No frontend, no mobile, no payment integration, no rate limiting, no audit logging
  • No multi-stack output (Flask only; see archiet-microcodegen for the FastAPI variant)

License

MIT. See LICENSE.

Metadata

Release files for archiet-microcodegen-flask 0.1.0

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-flask 0.1.0
File Size Uploaded Provenance Actions
archiet_microcodegen_flask-0.1.0.tar.gz 14.5 kB Without provenance Details for archiet_microcodegen_flask-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for archiet-microcodegen-flask 0.1.0
File Interpreter ABI Platform Actions
archiet_microcodegen_flask-0.1.0-py3-none-any.whl Python 3 none any Details for archiet_microcodegen_flask-0.1.0-py3-none-any.whl

Total release size: 33.6 kB

Release files / archiet_microcodegen_flask-0.1.0.tar.gz

Download URL archiet_microcodegen_flask-0.1.0.tar.gz
Size 14.5 kB
Tags Source
SHA-256 checksum
How to use checksums
af44bae9cf1f7efa9af6a92efe1caacc96c6d6151152e8f2924aeccfbde6514f
BLAKE2b-256 checksum
How to use checksums
32cec37dddeddca51f21dc1b4597a0f56baaf036d08e694d74c0da631dec5ac5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / archiet_microcodegen_flask-0.1.0-py3-none-any.whl

Download URL archiet_microcodegen_flask-0.1.0-py3-none-any.whl
Size 19.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
17c6038171646ab1a23cf8cb9ac3cd0d58aa4e32eb2b7edf27a105c911b865d8
BLAKE2b-256 checksum
How to use checksums
6e4c2c1efd13d2db45400a42e8a8486b5a7ecbc86a09ade97ced4e6c3f931e2d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Security for archiet-microcodegen-flask 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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