Internal tools

Film school equipment checkout app in Flask

Flask app for reserving film gear by date, scanner-driven checkout and return, and overdue flags that block new bookings.

pythonflasksqlalchemysqlitealembicpytest

Built 1 time, downloaded 0 times.

Install from your terminal

Run this in your project folder. It signs you in, shows what changes and asks before it overwrites a file.

npx claude-lab add film-school-equipment-checkout-app-in-flask-c5e92b
10 filesDownload zip
CLAUDE.md
# Film school equipment checkout

This Flask app lets film students reserve camera and lighting gear by date range. Staff scan barcodes to check items out and back in, and late returns flag the student and block new bookings until staff clear the flag. There are two roles: student and staff.

## Stack

- Python 3.12, Flask app factory, Flask-SQLAlchemy, Flask-Migrate
- SQLite for development, Jinja templates, pytest
- Ruff for lint and format

## Commands

- Run dev server: `flask --app app run --debug`
- Tests: `pytest -q`
- Lint: `ruff check .`
- Format: `ruff format .`
- Migrate: `flask --app app db upgrade`
- Seed fake data: `flask --app app seed`
- Flag overdue items: `flask --app app flag-overdue`

## Layout

- `app/__init__.py`: app factory and config loading
- `app/models.py`: SQLAlchemy models
- `app/blueprints/{student,staff,auth}/`: routes only
- `app/services/`: `booking.py`, `checkout.py`, `overdue.py`
- `templates/`: Jinja templates extending `base.html`
- `tests/`: pytest tests and `conftest.py` fixtures

## Domain rules

- Item states: `available`, `reserved`, `checked_out`, `maintenance`.
- A reservation covers a date range. No two reservations may overlap for the same item.
- An overdue item flags the student and blocks new bookings until staff clear the flag after the item is returned.
- Blocked students cannot create reservations.
- Barcodes are unique strings on `Item`.
- Scanners act as keyboards: scan input arrives in a text field and ends with Enter.

## Conventions

- Business logic lives in `app/services/`. Route handlers stay thin: parse input, call a service, render or redirect.
- Store datetimes in UTC. Compare calendar dates in the school timezone from `SCHOOL_TZ`.
- Never delete items that have history. Soft delete with `active=False`.
- The overdue check must be idempotent. Running `flask --app app flag-overdue` twice must change nothing the second time.
- Secrets come from environment variables only. Use `SECRET_KEY=YOUR_SECRET_KEY` as the placeholder in `.env.example`. Never commit `.env`.
- Use the `booking-rules` skill when editing booking, checkout, return or overdue code.
- Use the `new-route` skill when adding a route.

## Workflow

- Plan before coding any change that touches several files.
- Run the `verify` skill before saying a task is done.
- Keep changes small and commit after each passing phase.

## Review

@REVIEW.md
Use for my project