Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Rafa

Build engineering web apps in plain Python. Declare the inputs, write the calculation, get a browser workspace with forms, live views, revisions and a database. A library you run on your own infrastructure.

The workspace: loads of a foundation pad on the left, its soil pressure chart on the canvas, metrics in the results panel on the right
  • Python SDK (rafa): parametrizations, controllers, views, actions, entities, revisions, migrations. Stored in SQLite or PostgreSQL through SQLModel.
  • Server: a FastAPI app that serves the HTTP API and the web UI from one process.
  • Web app: a Vue 3 workspace rendered from layout JSON the server generates from your Python classes: entity browser, autosave with undo and revision history, RUN for slow calculations, keyboard shortcuts and a command palette, dark and light theme.

Quickstart

Requires Python 3.12+. The package contains the web app, so no Node.js is needed. Rafa is in beta:

pip install rafa-engineering                  # or: uv add rafa-engineering
rafa serve --demo                             # http://127.0.0.1:7232
rafa new bridge-checks && cd bridge-checks    # a new app of your own
rafa dev                                      # it, restarted and checked on every change

The Quickstart walks from the install to your own app in the browser, and shows how to run the example apps from a checkout.

Features

  • Declarative inputs: 25 field types (numbers, options, dates, tables, dynamic arrays, files, entity references) in tabs and sections, with Lookup constraints and conditional visibility.
  • Views: @view returns HTML, data, a table, an image, a PDF, a Plotly chart or 3D geometry; @metric shows a number in the results panel. Fast views refresh on every change, slow views run on RUN.
  • Actions: @action methods become buttons that return a message, a file download, new input values or candidate designs to choose from.
  • Entities: typed, hierarchical records with navigation, cascade rules, soft delete and recovery.
  • Revisions: every save is a revision; list, read and restore.
  • Schema migrations: evolve a parametrization without losing stored data.
  • Server: one rafa serve command, sign-in (API key, proxy, OpenID Connect or your own hook), SQLite or PostgreSQL, backups, retention, calculation limits, a Docker image.
  • Design system: one token file drives the web app's dark and light theme.

Overview: docs/features.md.

Documentation

You want to Read
Try it in 5 minutes Quickstart
Learn the SDK step by step Tutorial
Look up a term Concepts
Learn from working apps Example apps
Solve a specific task How-to guides
Use the web app User guide
Run or deploy the server Run the server, Deploy, Settings
Call the HTTP API HTTP API
Look up a class Reference
Know why it works this way Decisions, Architecture

Build the documentation site locally:

uv sync --group docs
uv run properdocs serve -f properdocs.yml   # http://127.0.0.1:8000

Project layout

src/rafa/          Python SDK (package `rafa`)
  core/            Application, Controller, Parametrization, Entity, Params, services
  fields/          input fields and layout (Tab, Section, ...)
  views/ actions/  @view, @metric, @action and their result types
  layout/          layout tree sent to the web app as JSON
  persistence/     SQLModel models and repositories
  server/          FastAPI app, settings, middleware
frontend/          Vue 3 + Vite + Tailwind web app
design_system/     design tokens (colors_and_type.css) and UI kit
examples/          example apps: engineering_app (Beam, Project, Showcase), foundation_app,
                   beam_formulas_app
docs/              documentation site (properdocs)
tests/             pytest suite

Development

uv sync --all-groups                 # Python dependencies (dev + docs)
uv run pytest                        # tests
uv run ruff check . && uv run ruff format --check .
uv run ty check .                    # type check

# Frontend development: the API with reload (answering the dev server's origin), and Vite
RAFA_CORS_ORIGINS=http://localhost:5173 \
  uv run uvicorn rafa.server.main:app --reload --port 8000 --no-proxy-headers
cd frontend
npm ci
npm run dev                          # http://localhost:5173, uses the API on :8000
npm run build                        # type check + production build to dist/
npm test                             # Storybook story tests (needs Playwright Chromium)

CI runs all of the above plus a strict docs build, and builds the wheel, installs it outside the checkout and serves an app from it. See Contributing.

License

Rafa is licensed under the Business Source License 1.1. Production use is free for:

  • individuals;
  • small enterprises: fewer than 50 staff and at most EUR 10 million turnover or balance sheet total (the EU definition, Recommendation 2003/361/EC, group companies included);
  • teaching, study and research at educational institutions and non-profit research organizations.

Development, testing and evaluation are free for everyone. Production use on behalf of, for, or by people of a larger organization needs a commercial license: contact Enrique García at enriquegarcia@live.nl. Four years after its release, each version becomes available under the Apache License 2.0.

© 2026 Enrique García

Metadata

Release files for rafa-engineering 0.0.1b2

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

Source distribution (sdist)

Source distribution for rafa-engineering 0.0.1b2
File Size Uploaded
rafa_engineering-0.0.1b2.tar.gz 4.6 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for rafa-engineering 0.0.1b2
File Interpreter ABI Platform
rafa_engineering-0.0.1b2-py3-none-any.whl Python 3 none any Details

Total release size: 9.3 MB

Release files / rafa_engineering-0.0.1b2.tar.gz

Download URL rafa_engineering-0.0.1b2.tar.gz
Size 4.6 MB
Tags Source
SHA-256 checksum
How to use checksums
70cfc373eaa0463c8eba2c63e16fe235057dafbd5b68fa47273aa12958265132
BLAKE2b-256 checksum
How to use checksums
e82681f76fadd1634ed29f3317403d01d0d92a6276c6eb42d4aa865e1955e7e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Release files / rafa_engineering-0.0.1b2-py3-none-any.whl

Download URL rafa_engineering-0.0.1b2-py3-none-any.whl
Size 4.7 MB
Tags Python 3
SHA-256 checksum
How to use checksums
20df8514f538419f039007fbb4c4aff275d79cd43dda191815f1915d09dcf344
BLAKE2b-256 checksum
How to use checksums
247e32c8328cfa1388f4eceed3b0e2dd30c7331cc4a18dd74f0cadaa00dce59b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log
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