Skip to main content

PRD text → working Flask + SQLAlchemy app ZIP. Pure stdlib, zero dependencies, zero LLM calls.

Project description

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.

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_flask-0.1.0.tar.gz (14.5 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_flask-0.1.0-py3-none-any.whl (19.0 kB view details)

Uploaded Python 3

File details

Details for the file archiet_microcodegen_flask-0.1.0.tar.gz.

File metadata

File hashes

Hashes for archiet_microcodegen_flask-0.1.0.tar.gz
Algorithm Hash digest
SHA256 af44bae9cf1f7efa9af6a92efe1caacc96c6d6151152e8f2924aeccfbde6514f
MD5 ac1c307aa82db6b03eb6a5f4bd5e73c0
BLAKE2b-256 32cec37dddeddca51f21dc1b4597a0f56baaf036d08e694d74c0da631dec5ac5

See more details on using hashes here.

File details

Details for the file archiet_microcodegen_flask-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for archiet_microcodegen_flask-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 17c6038171646ab1a23cf8cb9ac3cd0d58aa4e32eb2b7edf27a105c911b865d8
MD5 290242b4876264b8b92fde004ec7486e
BLAKE2b-256 6e4c2c1efd13d2db45400a42e8a8486b5a7ecbc86a09ade97ced4e6c3f931e2d

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