Skip to main content

Model-driven backend platform for FastAPI: REST + GraphQL + search + version history + admin UI from a single msgspec.Struct

Project description

SpecStar

Model-driven backend platform for FastAPI
Generate REST APIs, GraphQL, search, version history, and an admin UI from a single Python model.

PyPI License Docs

Renamed from autocrud to specstar (v0.10.0). The old name still installs as a deprecation shim that redirects every autocrud[.X] import to specstar[.X]. New projects should pip install specstar. See the migration guide.

Focus on business logic, not infrastructure.

⭐ If you find this project useful, consider giving it a star.


Why SpecStar

Modern backend development repeatedly rebuilds the same infrastructure:

  • CRUD APIs
  • validation
  • search and filtering
  • version history
  • permissions
  • background jobs
  • admin tools

Most of this code is not business logic.

SpecStar eliminates this repetition by using a model-driven architecture.

Define your model once, and the framework generates the rest.


Example

Define a resource model:

from msgspec import Struct

class User(Struct):
    name: str
    email: str

Register the model:

from fastapi import FastAPI
from specstar import spec

app = FastAPI()

spec.add_model(User)
spec.apply(app)

Start the server:

uvicorn main:app

Optional startup tuning:

export SPECSTAR_DEFAULT_QUERY_LIMIT=1000

This controls the default page size for list endpoints. Per-request limit still overrides it.

You now automatically get:

POST   /users
GET    /users
GET    /users/{id}
PUT    /users/{id}
PATCH  /users/{id}
DELETE /users/{id}

OpenAPI documentation is generated automatically.


Architecture

graph TD

FastAPI --> SpecStar
SpecStar --> ResourceManager
ResourceManager --> Storage

Storage --> MetaStore
Storage --> RevisionStore
Storage --> BlobStore

SpecStar --> REST_API
SpecStar --> GraphQL_API
SpecStar --> UI_Generator

Core Features

Model-driven APIs

SpecStar generates APIs directly from Python models.

Model
  ↓
REST API
GraphQL API
OpenAPI

Versioned resources

Every resource maintains immutable revision history.

Resource
 ├── r1
 ├── r2
 └── r3

Advantages:

  • audit history
  • rollback
  • draft workflows
  • debugging

Built-in search

Search operates on indexed metadata instead of scanning full resource payloads.

QueryBuilder
   ↓
ResourceManager.search()
   ↓
MetaStore.search()

Background jobs

Jobs are modeled as resources.

create()
  ↓
message_queue.put(resource_id)

Workers process jobs through:

ResourceManager.start_consume()

Storage abstraction

SpecStar supports multiple storage backends.

Backend Meta Revision Blob
Memory memory memory memory
Disk SQLite files filesystem
S3 SQLite S3 S3
Postgres PostgreSQL S3 S3

You can also implement custom storage systems.


UI generation

SpecStar can generate a web interface directly from the API.

API
 ↓
UI generator
 ↓
admin dashboard

This allows rapid creation of internal tools.


Comparison

Feature SpecStar Hasura Django
REST API
GraphQL ⚠️
Version history
Search engine SQL ORM
Storage pluggable PostgreSQL relational
Background jobs built-in external external
UI generation console admin

Quickstart

Install:

pip install specstar

Run your app:

uvicorn main:app

Open:

http://localhost:8000/docs

Documentation

Full documentation:

https://hychou0515.github.io/specstar/


Example use cases

SpecStar works well for:

  • internal tools
  • content systems
  • configuration management
  • job processing systems
  • administrative APIs
  • workflow management systems

License

MIT

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

specstar-0.10.0.tar.gz (1.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

specstar-0.10.0-py3-none-any.whl (315.8 kB view details)

Uploaded Python 3

File details

Details for the file specstar-0.10.0.tar.gz.

File metadata

  • Download URL: specstar-0.10.0.tar.gz
  • Upload date:
  • Size: 1.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for specstar-0.10.0.tar.gz
Algorithm Hash digest
SHA256 a924599d3a48b459117ad7a7b65468db478247b67279d3846307d1d42980ac4d
MD5 b5e4ab2074d7a05b139d6aae802ce186
BLAKE2b-256 b0dc3ec2f511032af0c6dc4fb81c91045c1b2f745a6fc525acc9355d520d61b1

See more details on using hashes here.

File details

Details for the file specstar-0.10.0-py3-none-any.whl.

File metadata

  • Download URL: specstar-0.10.0-py3-none-any.whl
  • Upload date:
  • Size: 315.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for specstar-0.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2d34b5eb8fd961cd92e6072e46a414fa5970963a6e368b51734f93974b8d4556
MD5 b48e972277184be3897cdcdf4f4b23e0
BLAKE2b-256 c8fbd8894ea298c307c64a0a548e8c24fef0ec63da10a65a283bef130b37ae92

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