Skip to main content

Quick start

Generate an application from a model and run it locally.

Prerequisites​

ToolWhy
Bun 1.4.4Runs the generator, the web front end and the test suites. Exactly this release: the repository and every generated project pin it.
Rust toolchainThe generated backend is a Cargo crate. The generator installs the Loco CLI (loco 1.2 or later) if it is missing.
PostgreSQLThe application's database. A local server, a managed one, or Neon.

1. Install​

git clone <your copy of the repository> cedm && cd cedm
bun install

2. Generate​

Generate the Sales application from the library, or the drug-discovery example the repository is validated on:

# From a CEDM model
bun run generate:tanstack -- -i applications/sales.cedm.yaml -o generated-projects/sales -n sales

# From a model document
bun run generate:tanstack -- -i examples/drug-discovery.eml.yaml \
-o generated-projects/drug-discovery -n drug-discovery

By default, generation then installs dependencies, creates the database, migrates and seeds. Pass --no-setup to stop after writing the files.

3. Create the database, migrate and seed (with --no-setup)​

If you generated with --no-setup, do the same by hand. The development database is named <crate>_development:

createdb drug_discovery_development
cd generated-projects/drug-discovery/backend
cargo loco db migrate && cargo loco db seed

db seed applies the Application Dictionary, the workflows, the access rules and the administrator account, in that order. Each step is idempotent.

4. Run​

cargo loco start --server-and-worker # API on http://localhost:3000
cd ../frontend && bun install && bun run dev # web app on http://localhost:3001

Sign in as admin@admin.com with the password admin. The API describes itself at http://localhost:3000/openapi.json, with browsable versions at /redoc and /scalar.

Prefer containers?

docker compose up in the generated project starts the database, backend and front end together. See Deploy an application.

Next​