Skip to main content

Coasti Planning Framework — Backend

The backend is a Python 3.13 FastAPI application managed with uv. It serves the framework and content-package assets from local Vite build directories.

Setup

Run this command from the repository root:

uv sync --directory backend --locked

The repository root also provides a Nix/direnv development shell that installs the required tools automatically. See the root README.

Build the frontend distributions

The backend does not build frontend assets itself. Build the framework and the example extension before running the backend in local distribution mode.

Framework distribution

Install the frontend workspace dependencies and build the planner framework:

pnpm --dir frontend install --frozen-lockfile
pnpm --dir frontend build

This creates the framework distribution in frontend/planner/dist.

Example extension distribution

Install the extension dependencies and build the example content package:

pnpm --dir cp_example_extension install --frozen-lockfile
pnpm --dir cp_example_extension build

This creates the extension distribution in cp_example_extension/dist. The build includes the generated manifest.json and Module Federation entry point.

Configuration

The server accepts a server command and an optional YAML configuration path. The legacy form with only the configuration path remains supported.

The example configuration is available at config.example.yml:

backend:
  host: 127.0.0.1
  port: 8000
framework:
  dist_folder: ../frontend/planner/dist
extension:
  dist_folder: ./dist

Configuration is loaded by EYConf using its Pydantic validation backend. The configuration is represented by three pairs of schema/runtime types in coasti_planner.config:

  • BackendConfigSchema / BackendConfig define the listening host and port.
  • AssetSourceSchema / AssetSource define a local distribution or remote development server.
  • ServerConfigSchema / ServerConfig combine the backend, framework, and extension settings.

Each asset source defines a local dist_folder. Relative paths are resolved relative to the configuration file, not relative to the current working directory.

Run the backend

From the repository root, after building both distributions:

uv run --directory backend coasti-planner ../cp_example_extension/config.example.yml

Run the full stack in development mode

Development mode does not require either frontend distribution directory. Run the backend from the backend project directory:

cd backend
uv run backend server --dev

The backend uses Uvicorn autoreload and the example configuration by default. Run the Vite development servers in separate terminals:

pnpm --dir frontend dev
pnpm --dir cp_example_extension dev

The frontend development server proxies API requests to the autoreloading backend, while the frontend and extension servers reload their own source files.

HTTP endpoints

  • / serves the framework index.html and its root-relative assets.
  • /api_v1/framework/{path} serves framework distribution files.
  • /api_v1/extension/{path} serves extension distribution files.
  • /api_v1/extension/manifest.json serves the extension's generated manifest.

The manifest is read from the extension distribution. It is not duplicated in the backend.

Metadata

Release files for coasti-planner 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 coasti-planner 0.1.0
File Size Uploaded
coasti_planner-0.1.0.tar.gz 81.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for coasti-planner 0.1.0
File Interpreter ABI Platform
coasti_planner-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 96.8 kB

Release files / coasti_planner-0.1.0.tar.gz

Download URL coasti_planner-0.1.0.tar.gz
Size 81.4 kB
Tags Source
SHA-256 checksum
How to use checksums
74b57f219d461cc187ded2e6f4c69144f205c20fa5d27ee2079e581d1ca3eb59
BLAKE2b-256 checksum
How to use checksums
70d831ae4d50dd6cb560624d42c22689950f6b99f4901dbe067cd9110322f843
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

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

Download URL coasti_planner-0.1.0-py3-none-any.whl
Size 15.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bed6fb7555aab118d5ecd4f2a9c9de184301b1d8b55ab08524ce2641038e530b
BLAKE2b-256 checksum
How to use checksums
3e3df22aa5f881456a298cb06272e06c6876963af9e4b7b09084c422a0eb59b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

0.1.2

2 release files

0.1.1

2 release files

This release

0.1.0 This release

2 release files

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