FASE 1: Parts Database - Added part_categories, part_groups, parts, vehicle_parts tables - 12 categories, 190 groups with Spanish translations - API endpoints for categories, groups, parts CRUD FASE 2: Cross-References & Aftermarket - Added manufacturers, aftermarket_parts, part_cross_references tables - 24 manufacturers, quality tier system (economy/standard/premium/oem) - Part number search across OEM and aftermarket FASE 3: Exploded Diagrams - Added diagrams, vehicle_diagrams, diagram_hotspots tables - SVG viewer with zoom controls and interactive hotspots - 3 sample diagrams (brake, oil filter, suspension) FASE 4: Search & VIN Decoder - SQLite FTS5 full-text search with auto-sync triggers - NHTSA VIN decoder API integration with 30-day cache - Unified search endpoint FASE 5: Optimization & UX - API pagination (page/per_page, max 100 items) - Dark mode with localStorage persistence - Keyboard shortcuts (/, Ctrl+K, Escape, Backspace, Ctrl+D) - Breadcrumb navigation - ARIA accessibility (labels, roles, focus management) - Skip link for keyboard users Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Vehicle Database
A comprehensive database system for storing information about vehicle brands, models, years, and engines.
Overview
This project provides a structured database for vehicle information with the following entities:
- Brands: Vehicle manufacturers with details like country of origin and founding year
- Models: Vehicle models with body type, generation, and production years
- Years: Calendar years for vehicle production
- Engines: Engine specifications including displacement, cylinders, power, and fuel type
- Model-Year-Engine: Junction table linking all entities with trim levels and specifications
Database Schema
The database uses SQLite and consists of the following tables:
brands
id: Primary keyname: Brand name (e.g., Toyota, Ford)country: Country of originfounded_year: Year the company was founded
engines
id: Primary keyname: Engine namedisplacement_cc: Engine displacement in cubic centimeterscylinders: Number of cylindersfuel_type: Type of fuel (gasoline, diesel, electric, hybrid)power_hp: Horsepowertorque_nm: Torque in Newton metersengine_code: Manufacturer engine code
models
id: Primary keybrand_id: Foreign key to brands tablename: Model name (e.g., Camry, Civic)body_type: Body style (sedan, SUV, truck, etc.)generation: Model generationproduction_start_year: Year production startedproduction_end_year: Year production ended (NULL if still in production)
years
id: Primary keyyear: Calendar year
model_year_engine
id: Primary keymodel_id: Foreign key to models tableyear_id: Foreign key to years tableengine_id: Foreign key to engines tabletrim_level: Trim level (e.g., base, luxury, sport)drivetrain: Drive system (FWD, RWD, AWD, 4WD)transmission: Transmission type (manual, automatic, CVT)
Setup
- Install Python 3.x if not already installed
- Clone or download this repository
- Run the database manager script:
cd vehicle_database
python scripts/database_manager.py
This will create the database, populate it with sample data, and run example queries.
Usage
The VehicleDatabaseManager class provides methods to:
- Create and manage the database schema
- Insert new brands, models, engines, and years
- Query vehicle information
- Link models, years, and engines with trim levels and specifications
Sample Queries
The script demonstrates several query patterns:
- Get all brands
- Get models for a specific brand
- Search for specific vehicles by brand, model, year, or engine
- Retrieve comprehensive vehicle information
Extending the Database
To add more data, you can:
- Use the provided Python API
- Directly execute SQL commands on the SQLite database
- Import data from CSV files using the provided structure
File Structure
vehicle_database/
├── sql/
│ └── schema.sql # Database schema
├── scripts/
│ └── database_manager.py # Python database manager
├── data/ # Directory for data files
└── README.md # This file