feat: backend FastAPI funcional con auth, ETA y simulador

This commit is contained in:
2026-05-22 14:42:02 -06:00
parent 53255cfc3a
commit 935380290f
3271 changed files with 736013 additions and 0 deletions

16
backend/database.py Normal file
View File

@@ -0,0 +1,16 @@
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
DATABASE_URL = "postgresql://postgres:postgres@localhost:5432/hackonlinces"
engine = create_engine(DATABASE_URL)
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
Base = declarative_base()
def get_db():
db = SessionLocal()
try:
yield db
finally:
db.close()