
- Implemented complete authentication system with JWT tokens - Created user management with registration and profile endpoints - Built client management with full CRUD operations - Developed invoice system with line items and automatic calculations - Set up SQLite database with proper migrations using Alembic - Added health monitoring and API documentation - Configured CORS for cross-origin requests - Included comprehensive README with usage examples
20 lines
565 B
Python
20 lines
565 B
Python
from fastapi import APIRouter, Depends
|
|
from sqlalchemy.orm import Session
|
|
from sqlalchemy import text
|
|
from app.db.session import get_db
|
|
|
|
router = APIRouter()
|
|
|
|
@router.get("/health")
|
|
async def health_check(db: Session = Depends(get_db)):
|
|
try:
|
|
db.execute(text("SELECT 1"))
|
|
database_status = "healthy"
|
|
except Exception:
|
|
database_status = "unhealthy"
|
|
|
|
return {
|
|
"status": "healthy" if database_status == "healthy" else "unhealthy",
|
|
"database": database_status,
|
|
"service": "SaaS Invoicing Application"
|
|
} |