Skip to Content
SPAPS is proprietary hosted SaaS. Paid access required; pre-1.0 contracts may change. Terms and access
Maintainer TutorialsMaintainer: Build A Service

Build A First Service

Maintainer-only and separately authorized development surface. Customers integrate the hosted API with an authorized client package; this tutorial is not permission to deploy or redistribute the SPAPS backend.

The quickest way for an authorized maintainer to understand the package surface is to build a tiny service that uses create_app, BaseServiceSettings, and a normal FastAPI router. This tutorial uses the reusable quickstart API, not the full SPAPS production app.

Verified source surface: spaps-server-quickstart 0.7.1 at Sweet Potato 5b09d3df1194577c5313c865fef1db98f694cdea. Use Python 3.12+. Confirm that your installed package version contains the same API before copying the snippet:

python --version python -c "from importlib.metadata import version; print(version('spaps-server-quickstart'))"

Install the package

python -m venv .venv source .venv/bin/activate pip install spaps-server-quickstart

If version 0.7.1 is not available from your configured registry, install the exact sibling source used by this documentation instead:

pip install ../sweet-potato/packages/python-server-quickstart

Define settings

from spaps_server_quickstart.settings import BaseServiceSettings class ExampleSettings(BaseServiceSettings): app_name: str = "Example Service" spaps_auth_enabled: bool = False

Add a router

from fastapi import APIRouter router = APIRouter() @router.get("/health") async def health() -> dict[str, bool]: return {"ok": True}

Create the app

from spaps_server_quickstart import create_app from spaps_server_quickstart.settings import create_settings_loader app = create_app( settings_loader=create_settings_loader(ExampleSettings), api_router=router, )

Run it

uvicorn example:app --reload curl http://127.0.0.1:8000/health

Docs maintainers can execute these Python fences plus the /health assertion against the sibling package environment:

node scripts/verify-first-service-snippet.mjs --upstream ../sweet-potato

Why This Works

create_app configures logging, optional CORS, optional SPAPS auth middleware, startup checks, and router mounting. The settings loader is cached by create_settings_loader, so route dependencies get stable configuration without global mutable setup.

Keep spaps_auth_enabled=False while proving the smallest app. Add SPAPS auth after the route and settings shape are correct.

Next