feat: add admin panel with Bouncer authorization and user CRUD API - #2
Open
n3n wants to merge 7 commits into
Open
feat: add admin panel with Bouncer authorization and user CRUD API#2n3n wants to merge 7 commits into
n3n wants to merge 7 commits into
Conversation
Integrates react-admin with @adonisjs/bouncer for role-based access control, adds a REST API for user management, and wires up per-page Inertia layouts. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add single-file List/Show/Create/Edit components for the users resource and wire them into the Admin resource. Exempt /api routes from CSRF so the react-admin data provider can call the user API. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…i i18n - Add `role` column to users; gate /admin and the users API behind AdminPolicy (admins only) via Bouncer — verified: non-admin gets 403, admin 200 - Fix broken AdminPolicy (dropped non-existent #models/admin import) and implement viewAdmin/manageUsers abilities - Add VineJS create/update validators + reusable database-unique rule (email format & uniqueness, password length, role enum) → 422 on bad input - Serve react-admin SPA under /admin/* with matching basename so deep links and refreshes resolve; fix duplicate-dot `api.` route name - Add Thai i18nProvider (English fallback) and pass the MUI theme to <Admin> - Seed admin@kmitl.ac.th (admin) and demo@kmitl.ac.th (user), password "password" Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Wrap <Admin> in HashRouter so all admin navigation lives in the URL fragment (/admin#/users) — deep links and refreshes never hit the server, and react-admin reuses this router instead of mounting its own BrowserRouter. Add react-router-dom as a direct dependency. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Revert to react-admin's default router and drop the react-router-dom dependency that was only used for HashRouter. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@adonisjs/bouncerfor role-based access control with anAdminPolicyand abilities, guarded byInitializeBouncerMiddlewarereact-admin-powered/adminpage backed by@aginix/vulcan-data-providerand a REST API (/api/users) for full user CRUDUsermodel with theFilterablemixin, adds per-page Inertia layout support inapp.tsx, and registers new routes, controllers, and policies in AdonisJS config filesTest plan
/adminrenders the react-admin UI/admin(Bouncer policy check)🤖 Generated with Claude Code