Skip to main content

Stash AI Overhaul Backend Server

Project description

AI Overhaul Backend

Minimal FastAPI backend with SQLite + Alembic migrations.

Features

  • FastAPI application exposing /api/v1/requests CRUD (create + read/list now)
  • SQLite database stored under backend/data/app.db
  • SQLAlchemy 2.0 style models
  • Alembic migration management
  • Docker dev environment with live reload (code mounted as volume)

Directory Layout

backend/
  stash_ai_server/
    api/          # Routers
    core/         # Config
    db/           # Session + base
    models/       # SQLAlchemy models
    schemas/      # Pydantic schemas
    main.py       # FastAPI entry
  alembic/        # Migration scripts
  alembic.ini     # Alembic config
  requirements.txt
  Dockerfile

Run (Docker Compose)

docker compose up --build

Then visit http://localhost:8000/docs for the Swagger UI.

During development, source changes under backend/stash_ai_server auto-reload thanks to --reload and bind mount.

Manual Local Run (Without Docker)

python -m venv .venv
. .venv/Scripts/activate  # Windows PowerShell: .venv\Scripts\Activate.ps1
pip install -r backend/requirements.txt
uvicorn backend.stash_ai_server.main:app --reload

Apply Migrations

The container runs with Base.metadata.create_all() for convenience right now. To use Alembic migration fully:

# Inside container or local env (with PYTHONPATH set to backend):
alembic upgrade head

Example Requests

POST /api/v1/requests
{
  "prompt": "Describe scenic imagery"
}

GET /api/v1/requests
GET /api/v1/requests/1

Next Steps

  • Add status update endpoint (PATCH)
  • Introduce background processing queue
  • Add filtering/pagination on list endpoint
  • Add CORS config if frontend fetches directly
  • Authentication (API key or session) when needed

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

stash_ai_server-0.1.1a2-py3-none-any.whl (56.5 kB view details)

Uploaded Python 3

File details

Details for the file stash_ai_server-0.1.1a2-py3-none-any.whl.

File metadata

File hashes

Hashes for stash_ai_server-0.1.1a2-py3-none-any.whl
Algorithm Hash digest
SHA256 9cd54066a1dc12e3ca85aea435c162547f85c319f9f20daab6506d4399f7e398
MD5 c0b51ff4a3d8738c70a93ebc641f95e9
BLAKE2b-256 b8c30e3901a7e66371314489df83c9e8a1d0902446808ee4042ac37ba4b7fc4b

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