Greenfield
This commit is contained in:
138
MOTOVAULTPRO.md
Normal file
138
MOTOVAULTPRO.md
Normal file
@@ -0,0 +1,138 @@
|
||||
Technology Stack
|
||||
|
||||
Frontend: React 18 with TypeScript
|
||||
Backend: Node.js 20 + Express + TypeScript
|
||||
Database: PostgreSQL 15
|
||||
Cache: Redis 7
|
||||
File Storage: MinIO (S3-compatible)
|
||||
Authentication: Auth0
|
||||
Container Runtime: Docker
|
||||
Orchestration: Kubernetes (Nutanix NKP)
|
||||
GitOps: FluxCD + Kustomize
|
||||
APIs: NHTSA vPIC (free), Google Maps Platform
|
||||
|
||||
Project Structure
|
||||
motovaultpro/
|
||||
├── docker-compose.yml # Local development environment
|
||||
├── .env.example # Environment variables template
|
||||
├── README.md # Project documentation
|
||||
├── Makefile # Common commands
|
||||
│
|
||||
├── backend/
|
||||
│ ├── package.json
|
||||
│ ├── tsconfig.json
|
||||
│ ├── Dockerfile
|
||||
│ ├── src/
|
||||
│ │ ├── index.ts # Express server entry point
|
||||
│ │ ├── app.ts # Express app configuration
|
||||
│ │ ├── config/
|
||||
│ │ │ ├── database.ts # PostgreSQL connection
|
||||
│ │ │ ├── redis.ts # Redis connection
|
||||
│ │ │ ├── auth0.ts # Auth0 middleware
|
||||
│ │ │ └── minio.ts # MinIO client setup
|
||||
│ │ ├── routes/
|
||||
│ │ │ ├── index.ts # Route aggregator
|
||||
│ │ │ ├── auth.routes.ts # Authentication endpoints
|
||||
│ │ │ ├── vehicles.routes.ts # Vehicle CRUD + VIN decode
|
||||
│ │ │ ├── fuel.routes.ts # Fuel log endpoints
|
||||
│ │ │ ├── maintenance.routes.ts
|
||||
│ │ │ └── stations.routes.ts # Google Maps integration
|
||||
│ │ ├── controllers/
|
||||
│ │ │ ├── vehicles.controller.ts
|
||||
│ │ │ ├── fuel.controller.ts
|
||||
│ │ │ ├── maintenance.controller.ts
|
||||
│ │ │ └── stations.controller.ts
|
||||
│ │ ├── services/
|
||||
│ │ │ ├── vpic.service.ts # NHTSA vPIC integration
|
||||
│ │ │ ├── googlemaps.service.ts
|
||||
│ │ │ ├── cache.service.ts # Redis caching logic
|
||||
│ │ │ └── storage.service.ts # MinIO operations
|
||||
│ │ ├── models/
|
||||
│ │ │ ├── user.model.ts
|
||||
│ │ │ ├── vehicle.model.ts
|
||||
│ │ │ ├── fuel-log.model.ts
|
||||
│ │ │ └── maintenance-log.model.ts
|
||||
│ │ ├── middleware/
|
||||
│ │ │ ├── auth.middleware.ts
|
||||
│ │ │ ├── validation.middleware.ts
|
||||
│ │ │ └── error.middleware.ts
|
||||
│ │ ├── utils/
|
||||
│ │ │ ├── logger.ts # Structured logging
|
||||
│ │ │ └── validators.ts # Input validation schemas
|
||||
│ │ └── migrations/
|
||||
│ │ ├── 001_initial_schema.sql
|
||||
│ │ ├── 002_vin_cache.sql
|
||||
│ │ └── 003_stored_procedures.sql
|
||||
│
|
||||
├── frontend/
|
||||
│ ├── package.json
|
||||
│ ├── tsconfig.json
|
||||
│ ├── Dockerfile
|
||||
│ ├── vite.config.ts
|
||||
│ ├── index.html
|
||||
│ ├── src/
|
||||
│ │ ├── main.tsx
|
||||
│ │ ├── App.tsx
|
||||
│ │ ├── api/
|
||||
│ │ │ ├── client.ts # Axios instance
|
||||
│ │ │ ├── vehicles.api.ts
|
||||
│ │ │ ├── fuel.api.ts
|
||||
│ │ │ └── stations.api.ts
|
||||
│ │ ├── components/
|
||||
│ │ │ ├── Layout/
|
||||
│ │ │ ├── VehicleForm/
|
||||
│ │ │ ├── VINDecoder/
|
||||
│ │ │ ├── FuelLogForm/
|
||||
│ │ │ ├── StationPicker/ # Google Maps component
|
||||
│ │ │ └── common/
|
||||
│ │ ├── pages/
|
||||
│ │ │ ├── Dashboard.tsx
|
||||
│ │ │ ├── Vehicles.tsx
|
||||
│ │ │ ├── FuelLogs.tsx
|
||||
│ │ │ └── Maintenance.tsx
|
||||
│ │ ├── hooks/
|
||||
│ │ │ ├── useAuth.ts
|
||||
│ │ │ ├── useVehicles.ts
|
||||
│ │ │ └── useGoogleMaps.ts
|
||||
│ │ ├── store/
|
||||
│ │ │ └── index.ts # Zustand or Redux
|
||||
│ │ └── types/
|
||||
│ │ └── index.ts
|
||||
│
|
||||
├── k8s/ # GitOps configurations
|
||||
│ ├── base/
|
||||
│ │ ├── namespace.yaml
|
||||
│ │ ├── backend/
|
||||
│ │ │ ├── deployment.yaml
|
||||
│ │ │ ├── service.yaml
|
||||
│ │ │ └── configmap.yaml
|
||||
│ │ ├── frontend/
|
||||
│ │ │ ├── deployment.yaml
|
||||
│ │ │ └── service.yaml
|
||||
│ │ ├── postgres/
|
||||
│ │ │ ├── statefulset.yaml
|
||||
│ │ │ ├── service.yaml
|
||||
│ │ │ ├── pvc.yaml
|
||||
│ │ │ └── init-scripts.yaml
|
||||
│ │ ├── redis/
|
||||
│ │ │ ├── statefulset.yaml
|
||||
│ │ │ └── service.yaml
|
||||
│ │ ├── minio/
|
||||
│ │ │ ├── statefulset.yaml
|
||||
│ │ │ ├── service.yaml
|
||||
│ │ │ └── pvc.yaml
|
||||
│ │ └── ingress.yaml
|
||||
│ │
|
||||
│ └── overlays/
|
||||
│ ├── development/
|
||||
│ │ ├── kustomization.yaml
|
||||
│ │ └── patches/
|
||||
│ └── production/
|
||||
│ ├── kustomization.yaml
|
||||
│ ├── sealed-secrets/
|
||||
│ └── patches/
|
||||
│
|
||||
└── .github/
|
||||
└── workflows/
|
||||
├── ci.yml # Test and build
|
||||
└── cd.yml # Deploy via GitOps
|
||||
Reference in New Issue
Block a user