Files
denya-onecare/AGENTS.md
T

2.4 KiB
Raw Blame History

Denya OneCare — Agent memory

Denya OneCare is a centralized maintenance/issue tracking system for Pavilion Accra (FastAPI + SQLite + Alpine.js + Twilio).

Quick start

# Start the app
docker-compose up

# Or directly
uvicorn app.main:app --reload

Project structure

app/
├── core/          # config, database, security (JWT + bcrypt + RBAC)
├── models/        # SQLAlchemy ORM models
├── schemas/       # Pydantic request/response schemas
├── services/      # Business logic (auth, seed)
└── routers/       # FastAPI route handlers
alembic/           # Database migrations

Commands

  • alembic upgrade head — apply migrations
  • alembic revision --autogenerate -m "msg" — new migration

Seed data

Users and units are auto-seeded on first startup via lifespan hook:

  • 16 users covering all roles (Admin/Jerome, Admin/Wahab, CS Rep, CS Manager, FM Dispatcher, Tech, CEO, Director)
  • 120 apartment units (East/West, 10 floors × 6 apts per wing)
  • Default password for all seed users: denya123
  • Units load from apartment_mapping.json if present, else built-in fallback

Key API endpoints

Method Path Auth Description
GET /health No Health check
POST /api/auth/register No Create user
POST /api/auth/login No Get JWT tokens
POST /api/auth/refresh Token Refresh tokens
GET /api/auth/me Bearer Current user
POST /api/whatsapp/mock No Mock WhatsApp
GET /api/whatsapp/mock-log No Recent mock submissions

Auth

  • JWT access (30min) + refresh (7d) tokens
  • Roles: CS Rep, CS Manager, FM Dispatcher, Admin/Jerome, Admin/Wahab, Tech, CEO, Director
  • Use require_roles("Admin/Jerome", "CEO") dependency for RBAC
  • sub claim holds string user ID

Database

SQLite via aiosqlite with async SQLAlchemy 2.0. Alembic for migrations. Tables: users, units, categories, tickets, ticket_timeline, ticket_photos, escalations, whatsapp_log

Maintaining this file

Keep this file for knowledge useful to almost every future agent session in this project. Do not repeat what the codebase already shows; point to the authoritative file or command instead. Prefer rewriting or pruning existing entries over appending new ones. When updating this file, preserve this bar for all agents and keep entries concise.