Update: Logic with Twitch login now works.

This commit is contained in:
2025-11-17 02:10:00 +01:00
parent 8829228295
commit 0967983483
2 changed files with 15 additions and 6 deletions

View File

@@ -11,7 +11,11 @@ This project is currently in **Phase 1: Initial Development**.
* **Interaction:** Provide "single message focus" and other moderation tools for streamers and their teams. * **Interaction:** Provide "single message focus" and other moderation tools for streamers and their teams.
* **Self-Hosted:** The service is hosted by the project owner (you) and provided to users. * **Self-Hosted:** The service is hosted by the project owner (you) and provided to users.
## 💻 Technology Stack ## 🔒 Security & Privacy
User privacy and security are paramount. All sensitive user credentials, such as OAuth access and refresh tokens from external platforms, are **always encrypted** before being stored in the database. They are never stored in plain text, ensuring a high standard of security for user data.
## <20> Technology Stack
* **Backend:** Python 3.9+ (FastAPI) * **Backend:** Python 3.9+ (FastAPI)
* **Database:** SQLite (initially, for simplicity) with SQLAlchemy * **Database:** SQLite (initially, for simplicity) with SQLAlchemy

15
main.py
View File

@@ -3,6 +3,7 @@ from fastapi import FastAPI, Request
from starlette.middleware.sessions import SessionMiddleware from starlette.middleware.sessions import SessionMiddleware
from starlette.staticfiles import StaticFiles from starlette.staticfiles import StaticFiles
from starlette.responses import FileResponse, RedirectResponse from starlette.responses import FileResponse, RedirectResponse
from contextlib import asynccontextmanager
import models import models
from database import engine from database import engine
@@ -14,12 +15,16 @@ from config import settings # Import settings to get the secret key
BASE_DIR = os.path.dirname(os.path.abspath(__file__)) BASE_DIR = os.path.dirname(os.path.abspath(__file__))
STATIC_DIR = os.path.join(BASE_DIR, "static") STATIC_DIR = os.path.join(BASE_DIR, "static")
# This line tells SQLAlchemy to create all the tables based on the models @asynccontextmanager
# we defined. It will create the `multichat_overlay.db` file with the async def lifespan(app: FastAPI):
# 'users' and 'settings' tables if they don't exist. # This code runs on startup
models.Base.metadata.create_all(bind=engine) print("Application startup: Creating database tables...")
models.Base.metadata.create_all(bind=engine)
print("Application startup: Database tables created.")
yield
# Code below yield runs on shutdown, if needed
app = FastAPI() app = FastAPI(lifespan=lifespan)
# Mount the 'static' directory using an absolute path for reliability # Mount the 'static' directory using an absolute path for reliability
app.mount("/static", StaticFiles(directory=STATIC_DIR), name="static") app.mount("/static", StaticFiles(directory=STATIC_DIR), name="static")