feat: convert to self-hosted version

This commit is contained in:
Jayden Pyles
2024-07-06 22:40:47 -05:00
parent 8808b493e6
commit 2bfc751d01
24 changed files with 1073 additions and 222 deletions

23
api/backend/database.py Normal file
View File

@@ -0,0 +1,23 @@
# STL
import os
from typing import Any
# PDM
from dotenv import load_dotenv
from motor.motor_asyncio import AsyncIOMotorClient
_ = load_dotenv()
MONGODB_URI = os.getenv("MONGODB_URI")
def get_user_collection():
client: AsyncIOMotorClient[dict[str, Any]] = AsyncIOMotorClient(MONGODB_URI)
db = client["scrape"]
return db["users"]
def get_job_collection():
client: AsyncIOMotorClient[dict[str, Any]] = AsyncIOMotorClient(MONGODB_URI)
db = client["scrape"]
return db["jobs"]