initial commit

This commit is contained in:
2023-01-09 13:03:16 +01:00
commit d0c0668fad
89 changed files with 12472 additions and 0 deletions

18
back/app/db.py Normal file
View File

@@ -0,0 +1,18 @@
import motor.motor_asyncio
from beanie import init_beanie
from .user import User, AccessToken
from .entity.models import Entity
from .order.models import Order
from .contract.models import Contract
DATABASE_URL = "mongodb://root:example@mongo:27017/"
async def init_db():
client = motor.motor_asyncio.AsyncIOMotorClient(
DATABASE_URL, uuidRepresentation="standard"
)
await init_beanie(database=client.db_name, document_models=[User, AccessToken, Entity, Order, Contract, ], )