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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for stash_ai_server-0.1.0a6-py3-none-any.whl
Algorithm Hash digest
SHA256 dc1acd7106ceeee65a3e2b7cb5321b0bff40b21355b3f4f3fe92ecc4e73b27ac
MD5 81aafdb18159fa2ed9b8a8b9ff3bfe5c
BLAKE2b-256 536853b55a1ad8a00c3ecadc9b633396c786eb1848d7e241feb2b36b22f0d9d0

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