@mytec: 1.1iter ready for testing

This commit is contained in:
2026-01-30 22:36:32 +02:00
parent 43b1267c56
commit 4326a6c4f7
28 changed files with 245 additions and 8 deletions

View File

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,13 @@
from pydantic_settings import BaseSettings
class Settings(BaseSettings):
MONGODB_URL: str = "mongodb://localhost:27017"
DATABASE_NAME: str = "rfcp"
TERRAIN_DATA_DIR: str = "/opt/rfcp/data/terrain"
class Config:
env_file = ".env"
settings = Settings()

View File

@@ -0,0 +1,22 @@
from motor.motor_asyncio import AsyncIOMotorClient
from app.core.config import settings
class Database:
client: AsyncIOMotorClient = None
db = Database()
async def get_database():
return db.client[settings.DATABASE_NAME]
async def connect_to_mongo():
db.client = AsyncIOMotorClient(settings.MONGODB_URL)
async def close_mongo_connection():
if db.client:
db.client.close()