1.7 KiB
1.7 KiB
Port Plan
Goals
- Replace the custom FastAPI auth flow with Django sessions and
AUTH_USER_MODEL - Collapse the two legacy SQLite files into one relational schema owned by Django migrations
- Move domain logic out of route files into app models and services
- Replace the React monolith with a SvelteKit frontend structured by route and domain
- Prepare for
shadcn-svelteinstead of continuing with bespoke one-off UI patterns
Target backend split
accounts: user, role, permission, device, business-access concernscore: business, product, vendor, category master dataoperations: invoices, inventory, events, schedulingreporting: pre-aggregated dashboard tables and future ETL landing pointsnotifications: reminders and inbox stateapi: thin JSON layer for the Svelte frontend
Legacy migration strategy
- Create Django migrations from the new model set.
- Migrate the new database.
- Run
import_legacy_datato ingest the bundled legacy SQLite files indata/legacy/. - Rebuild auth credentials by forcing password resets for imported users.
- Move ETL scripts into Django management commands later instead of repo-root scripts.
Frontend direction
- SvelteKit routes mirror the existing user navigation
- app shell owns layout, not each page
- each large legacy page becomes a route plus smaller components
- fetch is centralized in
$lib/api/client.ts - visual primitives are compatible with
shadcn-svelteconventions
Known gaps
- Migrations were not generated, by design, because nothing heavy was run
- API coverage is partial; the high-risk domains are modeled first
- Scheduling and event recurrence still need dedicated service extraction
- ETL jobs have not been rewritten yet