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,4 +1,4 @@
# Guía de Instalación - Autoparts DB
# Guía de Instalación - Nexus Autoparts
## Requisitos del Sistema
@@ -28,10 +28,10 @@ El proyecto es compatible con:
```bash
# 1. Clonar el repositorio
git clone https://git.consultoria-as.com/[usuario]/Autoparts-DB.git
git clone https://git.consultoria-as.com/[usuario]/Nexus-Autoparts.git
# 2. Entrar al directorio
cd Autoparts-DB
cd Nexus-Autoparts
# 3. Instalar dependencias
pip install -r requirements.txt
@@ -48,8 +48,8 @@ python3 server.py
### Paso 1: Clonar el Repositorio
```bash
git clone https://git.consultoria-as.com/[usuario]/Autoparts-DB.git
cd Autoparts-DB
git clone https://git.consultoria-as.com/[usuario]/Nexus-Autoparts.git
cd Nexus-Autoparts
```
### Paso 2: Crear Entorno Virtual (Recomendado)
@@ -254,16 +254,16 @@ gunicorn -w 4 -b 0.0.0.0:8080 server:app
### Usando systemd
Crear archivo `/etc/systemd/system/autoparts-db.service`:
Crear archivo `/etc/systemd/system/nexus-autoparts.service`:
```ini
[Unit]
Description=Autoparts DB Dashboard
Description=Nexus Autoparts Dashboard
After=network.target
[Service]
User=www-data
WorkingDirectory=/path/to/Autoparts-DB/dashboard
WorkingDirectory=/path/to/Nexus-Autoparts/dashboard
ExecStart=/usr/bin/python3 server.py
Restart=always
@@ -274,8 +274,8 @@ WantedBy=multi-user.target
Habilitar e iniciar:
```bash
sudo systemctl enable autoparts-db
sudo systemctl start autoparts-db
sudo systemctl enable nexus-autoparts
sudo systemctl start nexus-autoparts
```
### Usando Docker (Opcional)
@@ -294,8 +294,8 @@ CMD ["python3", "dashboard/server.py"]
```
```bash
docker build -t autoparts-db .
docker run -p 5000:5000 autoparts-db
docker build -t nexus-autoparts .
docker run -p 5000:5000 nexus-autoparts
```
---
@@ -319,7 +319,7 @@ pip install --upgrade -r requirements.txt
deactivate
# Eliminar directorio del proyecto
rm -rf Autoparts-DB
rm -rf Nexus-Autoparts
# Eliminar entorno virtual (si está separado)
rm -rf venv