How drun16/flask_rbac_project works
This Flask application supports account registration and login, session-based authentication, role-protected pages, and administrator CRUD for users and roles. The main workflow runs through the route handlers: forms validate submissions, user and role models provide identity and authorization data, and successful requests render pages or redirect. Admin access is separately enforced by the Flask-Admin views. The README also documents schema migrations and deployment database configuration; these are not expanded into operational components here because the sampled runtime code does not show their detailed flow.
Main entry points: routes.py Web routes · models.py User and role models · admin.py Admin interface · app.db Application database
Components 10
Web interface
- Web routes
app/routes.py - Page templates
app/templates - App factory
app/__init__.py
Identity and access
- Auth forms
app/forms.py - User and role models
app/models.py - Role guard
app/decorators.py
Administration
- Admin interface
app/admin.py - Initial role seeding
seed.py
Persistence
- Application database
app.db
Other components
- Visitor
Connections 13
- Visitor → Web routes: requests
- Web routes → Auth forms: validates with
- Auth forms → User and role models: checks uniqueness
- Web routes → User and role models: reads and updates
- Web routes → Role guard: guards admin route
- Web routes → Page templates: renders
- Web routes → Visitor: returns pages
- App factory → Admin interface: initializes
- Admin interface → User and role models: registers CRUD views
- Admin interface → Application database: CRUD via session
- User and role models → Application database: reads and writes
- Initial role seeding → User and role models: creates roles and user
- Initial role seeding → Application database: commits seed data