
- Set up project structure with FastAPI and SQLAlchemy - Create Todo model with CRUD operations - Implement database migrations with Alembic - Add health endpoint and API documentation - Create comprehensive README generated with BackendIM... (backend.im)
23 lines
624 B
Python
23 lines
624 B
Python
import uvicorn
|
|
from fastapi import FastAPI
|
|
from pathlib import Path
|
|
|
|
from app.api.routes import todo_router, health_router
|
|
from app.db.database import engine
|
|
from app.db.models import Base
|
|
|
|
# Create database tables
|
|
Base.metadata.create_all(bind=engine)
|
|
|
|
app = FastAPI(
|
|
title="Simple Todo App",
|
|
description="A simple Todo application built with FastAPI and SQLite",
|
|
version="0.1.0",
|
|
)
|
|
|
|
# Include routers
|
|
app.include_router(todo_router, prefix="/api", tags=["todos"])
|
|
app.include_router(health_router, tags=["health"])
|
|
|
|
if __name__ == "__main__":
|
|
uvicorn.run("main:app", host="0.0.0.0", port=8000, reload=True) |