Skip to content

Add examples and update documentation #6

@genro

Description

@genro

Context

Users need practical examples showing how to use genro-auth in real applications. Examples are better than lengthy docs.

Goal

Create 3 working examples and update README with provider pattern.

Implementation

  • Create examples/basic_usage.py
    • TokenManager setup
    • Generate token
    • Validate token
    • Refresh token
    • Revoke token
  • Create examples/fastapi_app.py
    • Complete FastAPI application
    • Protected endpoints
    • Login endpoint (token generation)
    • Refresh endpoint
    • Scope-based authorization
  • Create examples/custom_storage.py
    • Implement custom TokenStorage
    • Example with SQLite
    • Show how to extend
  • Update README.md
    • Add provider pattern explanation
    • Add configuration examples
    • Update quick start
    • Add links to examples
  • Create docs/ARCHITECTURE.md (optional)
    • Explain provider pattern
    • Explain storage abstraction

Acceptance Criteria

  • All examples run without errors
  • Examples are self-contained (can copy-paste)
  • README reflects new architecture
  • Code in examples is production-quality (not toy code)

Dependencies

Notes

  • Examples should be commented
  • Show best practices (error handling, logging)
  • Keep examples simple but realistic
  • Add comments explaining key concepts

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions