-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
37 lines (27 loc) · 964 Bytes
/
main.py
File metadata and controls
37 lines (27 loc) · 964 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
"""
DDD Python Sample - Restaurant Booking System
A complete example of Domain-Driven Design implementation in Python
following the patterns from the aicheck project.
"""
from fastapi import FastAPI
from src.shared.infrastructure.database import Base, engine
from adapters.http.api.clients.routers import router as clients_router
from adapters.http.api.bookings.routers import router as bookings_router
# Create database tables
Base.metadata.create_all(bind=engine)
# Create FastAPI app
app = FastAPI(
title="DDD Python Sample",
description="Restaurant booking system with Domain-Driven Design",
version="1.0.0",
)
# Include routers
app.include_router(clients_router, prefix="/api")
app.include_router(bookings_router, prefix="/api")
@app.get("/health")
def health_check() -> dict:
"""Health check endpoint."""
return {"status": "healthy"}
if __name__ == "__main__":
import uvicorn
uvicorn.run(app, host="0.0.0.0", port=8000)