|
|
|
|
|
This project needs a Supabase table named user_profiles. Full walkthrough (with screenshots) is in SUPABASE_SETUP.md.
- Open Supabase Dashboard
- Go to SQL Editor
- Copy–paste the content of
schema.sql - Click Run
This library supports two distinct authentication architectures out of the box, controlled via a simple configuration.
- Best for: Admin panels, Organization apps, SaaS platforms.
- The Flow: User explicitly selects a role (e.g., Admin, Director, Writer) → System generates a standardized ID (e.g.,
ADM-4521). - UI Experience: Includes a "Pick your Role" screen during sign-up.
- Best for: Social apps, Games, E-commerce, Standard User apps.
- The Flow: User picks a unique Username → System assigns a default hidden role (e.g.,
DEF) → System generates a unique ID (e.g.,DEF-alian22). - UI Experience: Skips the Role Picker. The role assignment happens invisibly in the background for a seamless sign-up experience.
💡 Future-Proof: Even in Single-Role mode, the backend maintains a role-based structure. This means you can scale a simple social app into a multi-role ecosystem (adding Moderators, VIPs, etc.) later without rewriting your database or migrating data.
This is a complete, working multi-role auth app - and also the demo of what the final installation of flutter_auth_kit, the UI kit, and the other kits looks like once they're actually put together in a real project, not just described in isolation.
Everything here is fully functional and verified end to end against a real Supabase backend. For the actual packages/bricks, more advanced usage, and to leave feedback or file issues, check those repos directly rather than this one:
- flutter_auth_kit - the auth logic (bloc, roles, repository, Supabase calls). A real dependency, wired in here as a git submodule at
packages/flutter_auth_kit. Deliberately has no UI. - haripin_bricks - Mason bricks that scaffold the reusable, non-auth-specific foundation. Not a dependency - each one generates plain files into the project once, and from then on they're just app code you edit freely:
haripin_core→ colors, sizes, text strings, validators, helpers, API-key configharipin_uikit→ theme + widget themes, loading spinnerauth_ui→ login/signup/profile-setup screens, the auth gate, dashboard router - the UI layer that sits on top offlutter_auth_kit
Starting a new app with the same foundation: mason make haripin_core, mason make haripin_uikit, mason make auth_ui, then add flutter_auth_kit as a dependency.
flutter_auth_kit is a git submodule, so a plain git clone leaves packages/flutter_auth_kit/ empty:
git clone --recurse-submodules https://github.com/ba6ul/multi-role-flutter-auth.git
# or, after a normal clone:
git submodule update --initUI: Skips the Role Picker. Seamless sign-up experience.




