Cleaned project directory and added new development plan for simplified stack

This commit is contained in:
Jo Eskil
2025-11-13 23:43:39 +01:00
parent 384d5364a8
commit 2ed89fecbc
21 changed files with 0 additions and 513 deletions

View File

@@ -1,35 +0,0 @@
import os
from sqlalchemy import create_engine, Column, Integer, String
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
DATABASE_URL = os.environ.get("DATABASE_URL")
engine = create_engine(DATABASE_URL)
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
Base = declarative_base()
class User(Base):
__tablename__ = "users"
id = Column(Integer, primary_key=True, index=True)
twitch_id = Column(String, unique=True, index=True)
twitch_username = Column(String)
# We will store encrypted tokens
twitch_access_token = Column(String)
twitch_refresh_token = Column(String)
youtube_id = Column(String, unique=True, index=True, nullable=True)
youtube_username = Column(String, nullable=True)
youtube_access_token = Column(String, nullable=True)
youtube_refresh_token = Column(String, nullable=True)
def get_db():
db = SessionLocal()
try:
yield db
finally:
db.close()
def create_tables():
Base.metadata.create_all(bind=engine)