Add Visione backend foundation

This commit is contained in:
gabdevele
2026-06-02 19:22:00 +02:00 Unverified
commit 580789ac83
52 changed files with 5008 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
# Visione Database Schema
The schema is stored in `migrations/001_initial_schema.sql`.
Important tables:
- `users`: identity, personal data, password hash, points and moderation flags.
- `roles`, `permissions`, `role_permissions`, `user_roles`: authorization.
- `otp_challenges`: local OTP login flow.
- `api_tokens`: bearer tokens for the local API.
- `report_categories`: report classification.
- `areas`: named city areas with GeoJSON polygon boundaries.
- `team_categories`, `teams`: municipal intervention teams.
- `reports`: citizen reports with coordinates, address, status and area.
- `report_status_history`: immutable status transition log.
- `assignments`: report-to-team assignment history.
- `report_photos`: uploaded photo metadata.
- `messages`: citizen/operator report conversation.
- `feedback`: citizen rating and comment after resolution.
- `reward_events`: indirect gamification points ledger.
GeoJSON is intentionally used instead of MySQL Spatial in milestone 1 to keep
the local setup simple and portable.