- 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>
39 lines
1.1 KiB
Python
39 lines
1.1 KiB
Python
"""
|
|
Configuration settings for the NEXUS AUTOPARTS console application.
|
|
"""
|
|
|
|
import os
|
|
import sys
|
|
|
|
# Application metadata
|
|
VERSION = "2.0.0"
|
|
APP_NAME = "NEXUS AUTOPARTS"
|
|
APP_SUBTITLE = "Tu conexión directa con las partes que necesitas"
|
|
|
|
# Database URL (PostgreSQL)
|
|
sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), '..'))
|
|
from config import DB_URL
|
|
|
|
# NHTSA VIN Decoder API
|
|
NHTSA_API_URL = "https://vpic.nhtsa.dot.gov/api/vehicles/DecodeVin"
|
|
VIN_CACHE_DAYS = 30
|
|
|
|
# Display defaults
|
|
PAGE_SIZE = 15
|
|
|
|
# VT220 color pairs: (foreground, background)
|
|
# These map to curses color pair indices used by the renderer.
|
|
COLORS_VT220 = {
|
|
"header": ("green", "black"),
|
|
"footer": ("black", "green"),
|
|
"normal": ("green", "black"),
|
|
"highlight": ("black", "green"),
|
|
"border": ("green", "black"),
|
|
"title": ("white", "black"),
|
|
"error": ("red", "black"),
|
|
"info": ("cyan", "black"),
|
|
"field_label": ("green", "black"),
|
|
"field_value": ("white", "black"),
|
|
"field_active": ("black", "cyan"),
|
|
}
|