FastAPI and SQLite application for managing biomedical assets, maintenance requests, preventive maintenance, and inventory.
- Create and activate a Python virtual environment.
- Install dependencies with
pip install -r requirements.txt. - Copy
.env.exampleto.env, then replace the placeholder secret and bootstrap password. Do not commit.env. - For an existing database, run
python -m backend.migrations.add_electrical_engineer_support,python -m backend.migrations.separate_engineering_assets_inventory, andpython -m backend.migrations.add_spare_parts_stock_consumptiononce. Re-run the first migration after updating to add the IT role. - Start the app from this directory:
uvicorn backend.main:app --reload. - Open
http://127.0.0.1:8000.
All /api endpoints except login require the HttpOnly session cookie issued by /api/auth/login. API clients may instead send the cookie's JWT as an Authorization: Bearer <token> header. Manager-only and biomedical-engineer endpoints are checked by the server; browser localStorage only controls dashboard presentation.
The application creates missing tables but does not modify existing tables at startup. Back up database/biotrack.db and apply reviewed migration scripts for schema changes.