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