Docs Cleanup

This commit is contained in:
Eric Gullickson
2025-11-02 10:34:43 -06:00
parent a0748ced5b
commit 3693ce5761
60 changed files with 885 additions and 6815 deletions

View File

@@ -3,7 +3,7 @@
This document explains the endtoend Vehicles API architecture after the platform service rebuild, how the MotoVaultPro app consumes it, how migrations/seeding work, and how to operate the stack in productiononly development.
## Overview
- Architecture: MotoVaultPro Application Service (Fastify + TS) consumes the MVP Platform Vehicles Service (FastAPI + Postgres + Redis).
- Architecture: MotoVaultPro Application Service (Fastify + TS) consumes the MVP Platform service (FastAPI) with shared Postgres and Redis.
- Goal: Predictable year→make→model→trim→engine cascades, productiononly workflow, AIfriendly code layout and docs.
## Platform Vehicles Service
@@ -52,8 +52,8 @@ Seed files under `mvp-platform-services/vehicles/sql/schema/`:
- 2017 Chevrolet Corvette Z06 Convertible → Engine LT4 (6.2L V8 SC)
Reapply seeds on an existing volume:
- `docker compose exec -T mvp-platform-vehicles-db psql -U mvp_platform_user -d vehicles -f /docker-entrypoint-initdb.d/005_seed_specific_vehicles.sql`
- Clear platform cache: `docker compose exec -T mvp-platform-vehicles-redis sh -lc "redis-cli FLUSHALL"`
- `docker compose exec -T mvp-postgres psql -U mvp_user -d mvp_db -f /docker-entrypoint-initdb.d/005_seed_specific_vehicles.sql`
- Clear platform cache: `docker compose exec -T mvp-redis sh -lc "redis-cli FLUSHALL"`
## MotoVaultPro Backend (Application Service)
@@ -135,21 +135,22 @@ VIN/License rule
### Rebuild a single service
- Frontend: `docker compose up -d --build frontend`
- Backend: `docker compose up -d --build backend`
- Platform API: `docker compose up -d --build mvp-platform-vehicles-api`
- Platform API: `docker compose up -d --build mvp-platform`
### Logs & Health
- Backend: `/health` shows status/feature list
- Platform: `/health` shows database/cache status
- Logs:
- `make logs-backend`, `make logs-frontend`
- `docker compose logs -f mvp-platform-vehicles-api`
- `docker compose logs -f mvp-platform`
### Common Reset Sequences
- Platform seed reapply (nondestructive): apply `005_seed_specific_vehicles.sql` and flush Redis cache.
- Platform reset (destructive only to platform DB/cache):
- `docker compose rm -sf mvp-platform-vehicles-db mvp-platform-vehicles-redis`
- `docker volume rm motovaultpro_platform_vehicles_data motovaultpro_platform_vehicles_redis_data`
- `docker compose up -d mvp-platform-vehicles-db mvp-platform-vehicles-redis mvp-platform-vehicles-api`
- Platform reset (WARNING - DESTRUCTIVE to shared resources):
- `docker compose rm -sf mvp-postgres mvp-redis`
- `docker volume rm motovaultpro_postgres_data motovaultpro_redis_data`
- `docker compose up -d mvp-postgres mvp-redis mvp-platform`
- Note: This will destroy ALL application data, not just platform data, as database and cache are shared
## Security Summary
- Platform: `Authorization: Bearer ${API_KEY}` required on all `/api/v1/vehicles/*` endpoints.
@@ -164,7 +165,7 @@ VIN/License rule
- Check backend `/api/vehicles` 500s (migrations not run or DB unavailable).
- Run `make migrate` or ensure backend container automigrate is succeeding; check `docker compose logs backend`.
- Dropdowns not updating after seed:
- Run specific seed SQL (see above) and `redis-cli FLUSHALL` on platform Redis.
- Run specific seed SQL (see above) and `redis-cli FLUSHALL` on shared Redis (mvp-redis).
- Backend flapping on start after rebuild:
- Ensure Postgres is up; the runner now waits/retries, but confirm logs.