r/learnpython 2h ago

Monolithic designed auth solution

I am trying to learn modular monoliths and I want to use this auth solutions for repetitive use for my applications.

If I asked you to convert the repo linked, into monolithic patterns, how would you do it for app/.

Repo: https://github.com/auth0-blog/auth0-rbac-fga-fastapi

fastapi-openfga-project/
├── app/
│ ├── main.py # FastAPI application entry point
│ ├── config.py # Configuration settings
│ ├── database.py # SQLAlchemy database setup and models
│ ├── models/
│ │ ├── organization.py # Organization Pydantic models
│ │ └── resource.py # Resource Pydantic models
│ ├── routes/
│ │ ├── organization_routes.py # Organization management endpoints
│ │ └── resource_routes.py # Resource management endpoints
│ ├── services/
│ │ └── authorization_service.py # OpenFGA integration
│ ├── utils/
│ │ └── auth0_fga_client.py # OpenFGA client wrapper
│ └── openfga/
│ └── model.fga.yaml # OpenFGA model definition
├── app.db # SQLite database file (auto-created)
├── requirements.txt
└── README.md

0 Upvotes

0 comments sorted by