Skip to content

🔥 An Example of a simple CRUD API using FastAPI

License

Notifications You must be signed in to change notification settings

mbalashovv/user-service

Repository files navigation

User Service

User service is a simple CRUD Web API that follows the principles of Clean Architecture

Endpoints

Endpoints

GET /healthcheck

curl -X "GET" "http://localhost:8000/healthcheck"
{"status": "ok"}

POST /users

curl -X "POST" \
  "http://127.0.0.1:8000/users" \
  -d '{
      "username": "Matthew",
      "password": "qwerty123"
  }'
{
  "id": "420cea35-3f8e-47c9-8df7-be28039598ed",
  "username": "Matthew",
  "created_at": 1734812913
}

GET /users

curl -X "GET" "http://127.0.0.1:8000/users"
{
  "users": [
    {
      "id": "520cea35-3f8e-47c9-8df7-be28039598ed",
      "username": "Taylor",
      "created_at": 1734809284
    },
    {
      "id": "420cea35-3f8e-47c9-8df7-be28039598ed",
      "username": "Matthew",
      "created_at": 1734812913
    }
  ]
}

Dependencies

Infrastructure

Grafana stack

  • Grafana — Web view for logs
  • Loki — A platform to store and query logs
  • Vector.dev — A tool to collect logs and send them to Loki

Key python libs

  • FastAPI — Async web framework
  • AIOPG — PostgreSQL driver for interaction with database
  • Yoyo — Database schema migration tool
  • Dependency-Injector — A dependency injection framework for Python

About

🔥 An Example of a simple CRUD API using FastAPI

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages