feat: migrate to PostgreSQL + SQLAlchemy ORM, rebrand to Nexus Autoparts

- Migrate from SQLite to PostgreSQL with normalized schema
- Add 11 lookup tables (fuel_type, body_type, drivetrain, transmission,
  materials, position_part, manufacture_type, quality_tier, countries,
  reference_type, shapes)
- Rewrite dashboard/server.py (76 routes) using SQLAlchemy text() queries
- Rewrite console/db.py (27 methods) using SQLAlchemy ORM
- Add models.py with 27 SQLAlchemy model definitions
- Add config.py for centralized DB_URL configuration
- Add migrate_to_postgres.py migration script
- Add docs/METABASE_GUIDE.md with complete data entry guide
- Rebrand from "AUTOPARTS DB" to "NEXUS AUTOPARTS"
- Fill vehicle data gaps via NHTSA API + heuristics:
  engines (cylinders, power, torque), brands (country, founded_year),
  models (body_type, production years), MYE (drivetrain, transmission, trim)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-19 05:24:47 +00:00
parent 7ecf1295a5
commit 7b2a904498
41 changed files with 3519 additions and 3489 deletions

View File

@@ -1,5 +1,5 @@
"""
Admin CRUD screen for Cross-References in the AUTOPARTES console application.
Admin CRUD screen for Cross-References in the NEXUS AUTOPARTS console application.
Provides a paginated list view with create (F3), edit (ENTER), and
delete (F8/Del) operations for the part_cross_references table.

View File

@@ -1,5 +1,5 @@
"""
Admin CRUD screen for Manufacturers in the AUTOPARTES console application.
Admin CRUD screen for Manufacturers in the NEXUS AUTOPARTS console application.
Provides a list view with create (F3), edit (ENTER), and delete (F8/Del)
operations for the manufacturers table.

View File

@@ -1,5 +1,5 @@
"""
Import/Export screen for the AUTOPARTES console application.
Import/Export screen for the NEXUS AUTOPARTS console application.
Provides a simple menu flow to import CSV files into the database or
export data to JSON files. Uses the renderer's show_input and

View File

@@ -1,5 +1,5 @@
"""
Admin CRUD screen for Parts in the AUTOPARTES console application.
Admin CRUD screen for Parts in the NEXUS AUTOPARTS console application.
Provides a paginated list view with create (F3), edit (ENTER), and
delete (F8/Del) operations. Form editing is handled inline with

View File

@@ -1,5 +1,5 @@
"""
Part number search screen for the AUTOPARTES console application.
Part number search screen for the NEXUS AUTOPARTS console application.
Prompts the user for a part number (OEM, aftermarket, or cross-reference)
and displays matching results in a table. Selecting a result navigates

View File

@@ -1,5 +1,5 @@
"""
Full-text search screen for the AUTOPARTES console application.
Full-text search screen for the NEXUS AUTOPARTS console application.
Prompts the user for a search query and displays matching parts using
the FTS5 full-text search engine (with LIKE fallback). Results are

View File

@@ -1,5 +1,5 @@
"""
Catalog navigation screen for the AUTOPARTES console application.
Catalog navigation screen for the NEXUS AUTOPARTS console application.
Provides a three-level drill-down through the parts hierarchy:
Categories -> Groups -> Parts. An optional vehicle filter (mye_id)

View File

@@ -1,5 +1,5 @@
"""
Part comparator screen for the AUTOPARTES console application.
Part comparator screen for the NEXUS AUTOPARTS console application.
Displays a side-by-side comparison of an OEM part against its aftermarket
alternatives. The first column is always the OEM part; subsequent columns

View File

@@ -1,5 +1,5 @@
"""
Statistics dashboard screen for the AUTOPARTES console application.
Statistics dashboard screen for the NEXUS AUTOPARTS console application.
Displays database table counts and coverage metrics retrieved via
:meth:`Database.get_stats`.

View File

@@ -1,5 +1,5 @@
"""
Main menu screen for the AUTOPARTES console application.
Main menu screen for the NEXUS AUTOPARTS console application.
Displays a numbered Pick-style menu with navigation options for all
application sections. Number keys jump directly; arrow keys move the

View File

@@ -1,5 +1,5 @@
"""
Part detail screen for the AUTOPARTES console application.
Part detail screen for the NEXUS AUTOPARTS console application.
Shows full part information (OEM number, name, group, category, etc.)
with a table of aftermarket alternatives. Number keys navigate to

View File

@@ -1,5 +1,5 @@
"""
Vehicle drill-down navigation screen for the AUTOPARTES console application.
Vehicle drill-down navigation screen for the NEXUS AUTOPARTS console application.
Guides the user through a four-level hierarchy:

View File

@@ -1,5 +1,5 @@
"""
VIN decoder screen for the AUTOPARTES console application.
VIN decoder screen for the NEXUS AUTOPARTS console application.
Prompts for a 17-character Vehicle Identification Number, decodes it
via the NHTSA vPIC API (with local caching), and displays the decoded