Phase 2: Admin console (admin.appe.at)
A desktop-first React app for organizers, guarded to the admin role. Backend (supabase/migrations/20260823000000_admin_app.sql): - Admin-only SELECT policies on preferences, connections, feedback - reset_qr_token RPC: regenerates a lanyard token, re-hashes it as the Auth password (old token stops working), and clears the attendee's sessions to force re-login App (apps/admin, port 3001): - Login: same QR+email flow, but non-admin sessions are rejected - Dashboard: live stats + top points + recent activity - Attendees: search, edit name/company/role, reset QR, adjust points - Schedule: manage slots + sessions (create/edit/delete) - Activity: check-ins / connections / feedback tables - Same-origin proxy (Vite dev / nginx in Docker), same design tokens Docker + scripts: - convivo-admin service in docker-compose.yml (:3001) - admin:dev / admin:build root scripts - fixed db:reset script (supabase reset -> supabase db reset) Docs: new frontend/admin-app.md; updated architecture, rls, rpcs, docker, next-steps, and READMEs. Verified: build clean, all views + flows browser-tested, Docker build + proxy + login + admin guard confirmed. DB reset to clean seed. Co-authored-by: Stephan Charles <[email protected]> Co-authored-by: Amelia Hernandez <[email protected]> Co-authored-by: Markus Franz <[email protected]> Co-authored-by: Sabrina Hota <[email protected]> Co-authored-by: Nilüfer Doğan <[email protected]>
This commit is contained in:
1 parent
015c0a3a06
commit
32c86767ef
45 files changed
+4425
-87
No files matched your search
@@ -0,0 +1,35 @@
|
||||
# Convivo Admin app — multi-stage build.
|
||||
#
|
||||
# Stage 1 (build): compile the Vite/React/TS app into static assets.
|
||||
# Stage 2 (serve): nginx serves the static build and proxies the Supabase
|
||||
# same-origin paths (/auth, /rest, /realtime, /storage) to the Supabase core.
|
||||
#
|
||||
# The Supabase core itself is NOT built here — it runs via the Supabase CLI
|
||||
# (`supabase start`) or as a separate container. See the root docker-compose.yml.
|
||||
|
||||
# ---- Build stage -------------------------------------------------------------
|
||||
FROM node:20-alpine AS build
|
||||
WORKDIR /app
|
||||
|
||||
# Install deps first for better layer caching (reproducible via lock file).
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci
|
||||
|
||||
# Copy sources and build. The anon key is baked in at build time (it is not a
|
||||
# secret — it is the standard local Supabase anon key). Override with
|
||||
# --build-arg VITE_SUPABASE_ANON_KEY=... if you use a custom key.
|
||||
ARG VITE_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0
|
||||
ENV VITE_SUPABASE_ANON_KEY=$VITE_SUPABASE_ANON_KEY
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
# ---- Serve stage -------------------------------------------------------------
|
||||
FROM nginx:1.27-alpine AS serve
|
||||
# nginx template: serve the SPA + proxy Supabase paths to the core. The proxy
|
||||
# target is injected at container start (see docker-entrypoint.sh).
|
||||
COPY nginx.conf.template /etc/nginx/conf.d/default.conf.template
|
||||
COPY docker-entrypoint.sh /docker-entrypoint.sh
|
||||
RUN chmod +x /docker-entrypoint.sh
|
||||
COPY --from=build /app/dist /usr/share/nginx/html
|
||||
EXPOSE 3001
|
||||
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||
Reference in new issue
Block a user