Health check and readiness endpoints for web services — liveness probes,
97
99%
Does it follow best practices?
Impact
94%
3.61xAverage score across 4 eval scenarios
Passed
No known issues
Build a user management microservice using FastAPI and Python. The service will run in Docker containers behind a Kubernetes ingress controller.
Endpoints:
GET /api/users -- list all users (paginated)POST /api/users -- create a user (fields: name, email, role)GET /api/users/{id} -- get user by IDDELETE /api/users/{id} -- deactivate a user (soft delete)Use SQLite via sqlite3 for storage. Each user has id, name, email, role, active, and created_at fields. Email must be unique.
Produce:
main.py -- FastAPI application with routes and database setupmodels.py -- Pydantic models for request/response schemasdatabase.py -- Database connection and initializationrequirements.txt -- Python dependenciesDockerfile -- For containerized deployment