Community 93 Premium feature complete
This commit is contained in:
@@ -2,15 +2,14 @@
|
||||
|
||||
## Architecture Summary
|
||||
|
||||
MotoVaultPro is a single-tenant vehicle management application built with a **6-container Docker-first architecture**. All development and deployment occurs in production-configured containers with no local installation dependencies.
|
||||
MotoVaultPro is a single-tenant vehicle management application built with a **5-container Docker-first architecture**. All development and deployment occurs in production-configured containers with no local installation dependencies.
|
||||
|
||||
### Core Containers
|
||||
1. **Traefik** - Reverse proxy and service discovery
|
||||
2. **Frontend** - React SPA with Vite (Node.js 20 + nginx)
|
||||
3. **Backend** - Node.js API with Fastify (Node.js 20)
|
||||
4. **PostgreSQL** - Primary database (PostgreSQL 15)
|
||||
5. **Redis** - Caching layer (Redis 7)
|
||||
6. **Platform** - Vehicle data service (Python FastAPI)
|
||||
3. **Backend** - Node.js API with Fastify (Node.js 20) - includes platform feature module
|
||||
4. **PostgreSQL** - Primary database (PostgreSQL 18)
|
||||
5. **Redis** - Caching layer (Redis 8)
|
||||
|
||||
### Key Architectural Principles
|
||||
- **Production-Only**: All services use production builds and configuration
|
||||
@@ -63,13 +62,13 @@ MotoVaultPro is a single-tenant vehicle management application built with a **6-
|
||||
### Backend Network
|
||||
- **Purpose**: API service communication
|
||||
- **Type**: Bridge (non-internal)
|
||||
- **Connected Services**: Traefik, Backend, Platform
|
||||
- **Connected Services**: Traefik, Backend
|
||||
- **Access**: External (requires Auth0 JWT validation)
|
||||
|
||||
### Database Network
|
||||
- **Purpose**: Data layer isolation
|
||||
- **Type**: Bridge (internal)
|
||||
- **Connected Services**: Backend, Platform, PostgreSQL, Redis
|
||||
- **Connected Services**: Backend, PostgreSQL, Redis
|
||||
- **Access**: Internal only, no external exposure
|
||||
|
||||
## Request Flow
|
||||
@@ -81,7 +80,7 @@ MotoVaultPro is a single-tenant vehicle management application built with a **6-
|
||||
- Domain: motovaultpro.com or www.motovaultpro.com
|
||||
- Path: / → Frontend (priority 10)
|
||||
- Path: /api → Backend (priority 20)
|
||||
- Path: /platform → Platform (priority 25)
|
||||
- Path: /api/platform/* → Backend (platform feature module)
|
||||
3. Frontend/Backend → Process Request
|
||||
4. Response → Traefik → User
|
||||
```
|
||||
@@ -196,12 +195,12 @@ MotoVaultPro is a single-tenant vehicle management application built with a **6-
|
||||
- **Health**: Covered by backend `/health` endpoint and feature-specific logs
|
||||
- **Configuration**:
|
||||
- `backend/src/features/platform/domain/*.ts` - Business logic
|
||||
- `backend/src/features/platform/data/*.ts` - Database + vPIC integration
|
||||
- `backend/src/features/platform/data/*.ts` - Database queries
|
||||
- **Secrets**:
|
||||
- Reuses backend secrets (PostgreSQL, Auth0, etc.)
|
||||
- **Purpose**:
|
||||
- Vehicle make/model/trim/engine data
|
||||
- VIN decoding (planned)
|
||||
- Vehicle hierarchical data (years, makes, models, trims, engines)
|
||||
- VIN decoding (Planned/Future - not yet implemented)
|
||||
- Standardized vehicle information
|
||||
|
||||
## Platform Module Integration
|
||||
@@ -380,7 +379,7 @@ REDIS_HOST: mvp-redis
|
||||
|
||||
### Container Commands (via Makefile)
|
||||
```bash
|
||||
make start # Start all 5 containers
|
||||
make start # Start all containers
|
||||
make stop # Stop all containers
|
||||
make restart # Restart all containers
|
||||
make rebuild # Rebuild and restart containers
|
||||
|
||||
@@ -13,13 +13,30 @@ The platform module runs as part of the backend service:
|
||||
|
||||
## Platform Capabilities
|
||||
|
||||
### Vehicle Data Service
|
||||
### Vehicle Data Service (Implemented)
|
||||
|
||||
The platform provides vehicle data capabilities including:
|
||||
- Vehicle makes, models, trims
|
||||
The platform provides vehicle hierarchical data lookups:
|
||||
- Vehicle years (distinct, descending)
|
||||
- Vehicle makes for a specific year
|
||||
- Vehicle models for year and make
|
||||
- Vehicle trims for year, make, and model
|
||||
- Engine and transmission data
|
||||
- VIN decoding
|
||||
- Year-based vehicle information
|
||||
|
||||
**Endpoints**:
|
||||
- `GET /api/platform/years` - Available model years
|
||||
- `GET /api/platform/makes?year={year}` - Makes for year
|
||||
- `GET /api/platform/models?year={year}&make={make}` - Models for year/make
|
||||
- `GET /api/platform/trims?year={year}&make={make}&model={model}` - Trims
|
||||
- `GET /api/platform/engines?year={year}&make={make}&model={model}&trim={trim}` - Engines
|
||||
- `GET /api/platform/transmissions?...` - Transmissions
|
||||
|
||||
### VIN Decoding (Planned/Future)
|
||||
|
||||
VIN decoding is planned but not yet implemented. Future capabilities will include:
|
||||
- `GET /api/platform/vehicle?vin={vin}` - Decode VIN to vehicle details
|
||||
- PostgreSQL-based VIN decode function
|
||||
- NHTSA vPIC API fallback with circuit breaker
|
||||
- Redis caching (7-day TTL for successful decodes)
|
||||
|
||||
**Data Source**: Vehicle data from standardized sources
|
||||
**Cache Strategy**: Year-based hierarchical caching using mvp-redis
|
||||
|
||||
@@ -1,34 +1,25 @@
|
||||
*** CRITICAL ***: Never read this file. Stop and move on.
|
||||
|
||||
*** PERSONALITY ***
|
||||
Read README.md CLAUDE.md and AI-INDEX.md to understand this code repository. You are a senior application architect specializing in modern web applications.
|
||||
Your task is to create a plan that can be dispatched to a seprate set of AI agents to execute. Write this plan out in VEHICLE-UPDATES.md
|
||||
|
||||
*** FEATURE ***
|
||||
- Vehicles feature. All aspects that relate to the vehicle.
|
||||
|
||||
*** BUGS TO FIX ***
|
||||
- The Vehicle summary page has icons for "Edit" and "Delete". The "Edit" icon doesn't work, when clicked it does nothing.
|
||||
|
||||
*** CHANGES TO IMPLEMENT ***
|
||||
- Requirment. Add links on saved/favorite stations
|
||||
- Links should be
|
||||
- - "Navigate in Google" with a link to Google Maps
|
||||
- - "Navigate in Apple Maps" with a link to Apple Maps
|
||||
- - "Navigate in Wave" with a link to Waze
|
||||
|
||||
|
||||
|
||||
*** ROLE ***
|
||||
You are a senior DevOps SRE in charge of MotoVaultPro. A automotive fleet management application.
|
||||
You are a senior software engineer specializsing in NodeJS, Typescript, front end and back end development. You will be delegating tasks to the platform-agent, feature-agent, first-frontend-agent and quality-agent when appropriate.
|
||||
|
||||
*** ACTION ***
|
||||
- The production deployment from GitLab CI is not installing the Let's Encrypt certificates
|
||||
- You should start looking at if the cloudflare API key is being passed into the pipeline.
|
||||
- Read README.md CLAUDE.md and AI-INDEX.md to understand this code repository in the context of this change.
|
||||
- You need to improve the Community sharing of the 93 Octane gas stations.
|
||||
- These changes are going to focus on reducing administrative overhead and making community engagement easier.
|
||||
- Make no assumptions.
|
||||
- Ask clarifying questions.
|
||||
- Ultrathink
|
||||
|
||||
*** CONTEXT ***
|
||||
- This is a modern web app for managing a vehicle fleet. It has both a desktop and mobile versions of the site that both need to maintain feature parity. It's currently deployed via docker compose but in the future will be deployed via k8s.
|
||||
- This is a modern web app for managing a vehicle fleet. It has both a desktop and mobile versions of the site that both need to maintain feature parity. It's currently deployed via docker compose but in the future will be deployed via k8s.
|
||||
- Read README.md CLAUDE.md and AI-INDEX.md and follow relevant instructions to understand this code repository in the context of this change.
|
||||
|
||||
*** CHANGES TO IMPLEMENT ***
|
||||
- Plan and recommend the best solution for this change
|
||||
- Plan and recommend the best solution for this change
|
||||
- The submission of Community Verified 93 gas stations should be auto approved.
|
||||
- The results cards for search results only have icons for "Navigate" "Premium 93" and "Favorite". Add a small font text below those icons with those labels. Don't make it so small it can't be viewed on Mobile.
|
||||
- When you click the "Premium 93" icon, the card shows two check boxes. They currently say "Has 93 Octane" and "93 Octane is ethanol-free". This needs to be changed to radio buttons where you can select one or the other. The first option should read "Premium 93 with Ethanol" and the second option should be "Premium 93 w/o Ethanol"
|
||||
- You need to add a third radio button to the same form that says "No longer has Premium 93". All three options are mutually exclusive.
|
||||
- If two community users submit that a station no longer has Premium 93 it should be removed from the Community Premium 93 section and results.
|
||||
- The "Premium 93" tab should be showing results when searches are ran. I want the icon for "Premium 93" to change color on the main "Results" page to change colors to the same color as an activated favorite if the station is confirmed by the community as a Premium 93 station.
|
||||
@@ -24,4 +24,4 @@ Project documentation hub for the 5-container single-tenant architecture with in
|
||||
## Notes
|
||||
|
||||
- Canonical URLs: Frontend `https://motovaultpro.com`, Backend health `https://motovaultpro.com/api/health`.
|
||||
- Feature test coverage: Basic test structure exists for vehicles and documents features; other features have placeholder tests.
|
||||
- All 7 features have comprehensive test suites (unit + integration tests).
|
||||
@@ -33,14 +33,14 @@ make shell-backend
|
||||
npm test
|
||||
|
||||
# Test single feature (complete isolation)
|
||||
npm test -- features/vehicles
|
||||
npm test -- --testPathPattern=src/features/vehicles
|
||||
|
||||
# Test specific test type
|
||||
npm test -- features/vehicles/tests/unit
|
||||
npm test -- features/vehicles/tests/integration
|
||||
npm test -- --testPathPattern=src/features/vehicles/tests/unit
|
||||
npm test -- --testPathPattern=src/features/vehicles/tests/integration
|
||||
|
||||
# Test with coverage
|
||||
npm test -- features/vehicles --coverage
|
||||
npm test -- --testPathPattern=src/features/vehicles --coverage
|
||||
|
||||
# Watch mode
|
||||
npm run test:watch
|
||||
@@ -89,25 +89,24 @@ Example: `vehicles.integration.test.ts`
|
||||
- Tests database persistence
|
||||
- Tests error responses
|
||||
|
||||
### Test Fixtures
|
||||
**Location**: `features/[name]/tests/fixtures/`
|
||||
**Purpose**: Reusable test data
|
||||
**Format**: JSON files with valid test objects
|
||||
### Test Data
|
||||
**Location**: Inline within test files
|
||||
**Purpose**: Test-specific mock data
|
||||
**Format**: TypeScript objects defined in test files
|
||||
|
||||
Example: `vehicles.fixtures.json`
|
||||
```json
|
||||
{
|
||||
"validVehicle": {
|
||||
"vin": "1HGBH41JXMN109186",
|
||||
"nickname": "Test Honda",
|
||||
"color": "Blue"
|
||||
},
|
||||
"vpicResponse": {
|
||||
"Make": "Honda",
|
||||
"Model": "Civic",
|
||||
"ModelYear": "2021"
|
||||
}
|
||||
}
|
||||
Tests use inline mock data rather than external fixture files. Example pattern:
|
||||
```typescript
|
||||
const mockVehicle = {
|
||||
vin: "1HGBH41JXMN109186",
|
||||
nickname: "Test Honda",
|
||||
color: "Blue"
|
||||
};
|
||||
|
||||
const mockPlatformResponse = {
|
||||
make: "Honda",
|
||||
model: "Civic",
|
||||
year: 2021
|
||||
};
|
||||
```
|
||||
|
||||
## Testing Commands Reference
|
||||
@@ -121,10 +120,10 @@ make shell-backend
|
||||
npm test
|
||||
|
||||
# Run specific feature
|
||||
npm test -- features/vehicles
|
||||
npm test -- features/fuel-logs
|
||||
npm test -- features/maintenance
|
||||
npm test -- features/stations
|
||||
npm test -- --testPathPattern=src/features/vehicles
|
||||
npm test -- --testPathPattern=src/features/fuel-logs
|
||||
npm test -- --testPathPattern=src/features/maintenance
|
||||
npm test -- --testPathPattern=src/features/stations
|
||||
|
||||
# Run with file watching
|
||||
npm run test:watch
|
||||
@@ -142,7 +141,7 @@ docker compose exec mvp-frontend npm test
|
||||
### Coverage Reports
|
||||
```bash
|
||||
# Generate coverage for specific feature
|
||||
npm test -- features/vehicles --coverage
|
||||
npm test -- --testPathPattern=src/features/vehicles --coverage
|
||||
|
||||
# View coverage report
|
||||
# Inside the container, open using your OS tooling,
|
||||
@@ -177,8 +176,14 @@ make clean && make start
|
||||
- **Seeding**: Use feature-level fixtures when needed
|
||||
|
||||
### Coverage and Availability
|
||||
- Full test suite exists for `vehicles`.
|
||||
- Other features (e.g., `fuel-logs`, `stations`, `maintenance`) have placeholders and are being built out.
|
||||
All features have comprehensive test suites with unit and integration tests:
|
||||
- `admin` - Unit + integration tests
|
||||
- `documents` - Unit + integration tests
|
||||
- `fuel-logs` - Unit + integration tests
|
||||
- `maintenance` - Unit + integration tests
|
||||
- `platform` - Unit + integration tests
|
||||
- `stations` - Unit + integration tests (including community stations)
|
||||
- `vehicles` - Unit + integration tests
|
||||
|
||||
### Mock Strategy
|
||||
- **External APIs**: Completely mocked (vPIC, Google Maps)
|
||||
@@ -188,17 +193,20 @@ make clean && make start
|
||||
|
||||
## Test Data Management
|
||||
|
||||
### Fixtures Strategy
|
||||
```javascript
|
||||
// In test files
|
||||
import fixtures from '../fixtures/vehicles.fixtures.json';
|
||||
### Inline Mock Data Strategy
|
||||
```typescript
|
||||
// In test files - define mock data inline
|
||||
const mockVehicle = {
|
||||
vin: '1HGBH41JXMN109186',
|
||||
nickname: 'Test Honda',
|
||||
year: 2021,
|
||||
make: 'Honda',
|
||||
model: 'Civic'
|
||||
};
|
||||
|
||||
describe('Vehicle Service', () => {
|
||||
it('should create vehicle', async () => {
|
||||
const result = await vehicleService.create(
|
||||
fixtures.validVehicle,
|
||||
'user123'
|
||||
);
|
||||
const result = await vehicleService.create(mockVehicle, 'user123');
|
||||
expect(result.make).toBe('Honda');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user