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/
  app/
    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/app 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.app.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.0a7-py3-none-any.whl (54.3 kB view details)

Uploaded Python 3

File details

Details for the file stash_ai_server-0.1.0a7-py3-none-any.whl.

File metadata

File hashes

Hashes for stash_ai_server-0.1.0a7-py3-none-any.whl
Algorithm Hash digest
SHA256 5607011a7bfdaf9dfd90ca33f94c97a457ee2cfd56b024ef6717be410ee604b7
MD5 6124d09e414db128c029113832f67c86
BLAKE2b-256 c9c80db592b1113b4b9bb67ec05ef9d1fcfd6824019b04cbf2df6226021a1045

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