Skip to content

Migrate admin panel from Blazor WASM to React SPA#152

Merged
djoufson merged 17 commits intomainfrom
feature/react-admin
Mar 29, 2026
Merged

Migrate admin panel from Blazor WASM to React SPA#152
djoufson merged 17 commits intomainfrom
feature/react-admin

Conversation

@djoufson
Copy link
Copy Markdown
Member

Summary

  • Replace Blazor WebAssembly admin with a standalone React SPA (Vite + TanStack Router/Query + Tailwind v4) at src/admin/
  • Add REST API surface (/api/admin/*) for events CRUD, partners CRUD, external apps, auth, and file uploads — all behind AdminOnly policy
  • Add MinIO-backed file storage replacing base64 image encoding — includes FileUploader, FileDownloader, FileManager implementations, a POST /api/admin/files/upload endpoint, and an ImageUpload React component
  • Modern admin dashboard with stat cards, charts (events by status/type via Recharts), and recent events table
  • Re-enable /events page on the public site and add "All Events" link to the navbar
  • Infrastructure: MinIO in docker-compose, prod docker-compose with .env variables, standalone docker-compose.infra.yml, Caddy reverse proxy config
  • Cleanup: delete src/app.client/ (Blazor WASM), remove WASM packages/references, remove admin-only JS/CSS

Test plan

  • docker compose -f docker-compose.infra.yml up -d starts SQL Server and MinIO
  • dotnet build src/app/app.csproj succeeds (implicitly builds the React SPA)
  • Navigate to /admin — dashboard loads with stats and charts
  • CRUD operations on events, partners, and apps work end-to-end
  • Image uploads go to MinIO and return a public URL
  • Public site /events page renders with upcoming and previous events
  • /events/{id} detail page works
  • Login redirects correctly to /admin via HttpContext.Response.Redirect

🤖 Generated with Claude Code

djoufson and others added 15 commits March 29, 2026 14:58
Introduce minimal API endpoints under /api/admin for the React admin
dashboard migration. Covers events CRUD (with publish/cancel/mark-passed),
partners CRUD, external apps management, and auth/me endpoint.
All endpoints require AdminOnly policy with antiforgery disabled for
JSON-based SPA consumption.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Initialize src/admin/ with Vite React-TS template. Configure Tailwind
CSS 4 with project theme tokens, set base path to /admin/, build output
to wwwroot/admin/, and dev proxy to ASP.NET Core. Install TanStack
Router and Query for routing and data fetching.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implement all admin pages in React: events list with search/pagination,
event create/edit form (activities, partners, image upload), external
apps management with secret generation, and partners CRUD. Set up API
client layer with TanStack Query hooks, TanStack Router with file-based
routing, and admin layout with header/sidebar.

Wire ASP.NET Core to serve the React SPA via MapFallbackToFile for
client-side routing under /admin/. Add admin:dev and admin:build
scripts to root package.json.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Delete src/app.client/ project entirely — all admin pages are now in
the React SPA. Remove WASM render mode from Program.cs and Extensions.cs,
remove WebAssembly.Server package and project reference from app.csproj,
remove from solution file and Dockerfile.

Move EventActivityCard component to server project for the public event
details page. Clean up admin-only JS functions (toggleExpand, saveDraft,
copySecretToClipboard, etc.) and delete unused JS API wrappers. Remove
admin sidebar/activity-popup CSS from input.css.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@djoufson djoufson self-assigned this Mar 29, 2026
@djoufson djoufson added the enhancement New feature or request label Mar 29, 2026
@djoufson djoufson merged commit baebd6d into main Mar 29, 2026
1 check passed
@djoufson djoufson deleted the feature/react-admin branch March 29, 2026 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant