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,219 @@
|
||||
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
|
||||
:root {
|
||||
--bg: #f0f2f6; --surface: #ffffff; --surface-2: #f4f5f9;
|
||||
--line: #e4e6ee; --text: #423c3c; --muted: #8a8484;
|
||||
--accent: #d50000; --accent-2: #20b2aa; --accent-soft: rgba(213,0,0,.08);
|
||||
--cyan: #20b2aa; --amber: #f59e0b; --green: #059669; --red: #d50000;
|
||||
--sidebar: #1f1b1b; --sidebar-2: #2a2424;
|
||||
}
|
||||
html, body, #root { height: 100%; }
|
||||
body {
|
||||
background: radial-gradient(1100px 700px at 80% -10%, rgba(213,0,0,.05) 0%, var(--bg) 55%);
|
||||
font-family: 'Poppins', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
/* ---------- App shell (sidebar + content) ---------- */
|
||||
.app { display: flex; height: 100dvh; overflow: hidden; }
|
||||
|
||||
.sidebar {
|
||||
width: 248px; flex-shrink: 0; background: var(--sidebar); color: #fff;
|
||||
display: flex; flex-direction: column; padding: 22px 16px; gap: 6px;
|
||||
}
|
||||
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 20px; }
|
||||
.brand .logo {
|
||||
width: 44px; height: 44px; border-radius: 13px; display: flex; align-items: center; justify-content: center;
|
||||
font-size: 22px; font-weight: 900; background: linear-gradient(135deg, var(--accent), #ff5a4e);
|
||||
box-shadow: 0 8px 20px rgba(213,0,0,.4); color: #fff;
|
||||
}
|
||||
.brand .name { font-weight: 800; font-size: 17px; letter-spacing: -.3px; }
|
||||
.brand .sub { font-size: 11px; color: rgba(255,255,255,.5); font-weight: 600; }
|
||||
|
||||
.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
|
||||
.nav-item {
|
||||
display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px;
|
||||
background: none; border: none; color: rgba(255,255,255,.62); font-size: 14.5px; font-weight: 600;
|
||||
cursor: pointer; font-family: inherit; text-align: left; transition: background .12s, color .12s;
|
||||
}
|
||||
.nav-item .ico { font-size: 19px; width: 22px; text-align: center; }
|
||||
.nav-item:hover { background: var(--sidebar-2); color: #fff; }
|
||||
.nav-item.active { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(213,0,0,.35); }
|
||||
|
||||
.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.1); }
|
||||
.admin-card { display: flex; align-items: center; gap: 10px; padding: 8px; }
|
||||
.admin-card .who { min-width: 0; }
|
||||
.admin-card .who .n { font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
||||
.admin-card .who .e { font-size: 11px; color: rgba(255,255,255,.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
||||
.signout {
|
||||
margin-top: 10px; width: 100%; padding: 10px; border-radius: 10px; border: 1px solid rgba(255,255,255,.16);
|
||||
background: none; color: rgba(255,255,255,.7); font-weight: 700; font-size: 13px; cursor: pointer; font-family: inherit;
|
||||
}
|
||||
.signout:hover { background: rgba(255,255,255,.08); color: #fff; }
|
||||
|
||||
.content { flex: 1; overflow-y: auto; padding: 30px 34px 60px; }
|
||||
.content::-webkit-scrollbar { width: 10px; }
|
||||
.content::-webkit-scrollbar-thumb { background: #d5d8e2; border-radius: 8px; }
|
||||
|
||||
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; gap: 16px; flex-wrap: wrap; }
|
||||
.page-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -.6px; }
|
||||
.page-head .sub { color: var(--muted); font-size: 14px; margin-top: 3px; }
|
||||
|
||||
/* ---------- Primitives ---------- */
|
||||
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: 0 8px 24px rgba(66,60,60,.06); }
|
||||
.muted { color: var(--muted); }
|
||||
.small { font-size: 12.5px; }
|
||||
.h2 { font-size: 16px; font-weight: 700; }
|
||||
.row { display: flex; align-items: center; gap: 10px; }
|
||||
.row.between { justify-content: space-between; }
|
||||
.grow { flex: 1; min-width: 0; }
|
||||
.btn {
|
||||
display: inline-flex; align-items: center; justify-content: center; gap: 8px;
|
||||
padding: 11px 18px; border-radius: 12px; border: 1px solid var(--line);
|
||||
background: var(--surface-2); color: var(--text); font-size: 14px; font-weight: 700;
|
||||
cursor: pointer; transition: transform .08s ease, opacity .15s; font-family: inherit; white-space: nowrap;
|
||||
}
|
||||
.btn:active { transform: scale(.98); }
|
||||
.btn.primary { background: var(--accent); border: none; color: #fff; box-shadow: 0 8px 20px rgba(213,0,0,.22); }
|
||||
.btn.ghost { background: transparent; }
|
||||
.btn.danger { background: rgba(213,0,0,.08); border-color: rgba(213,0,0,.35); color: var(--red); }
|
||||
.btn.small { padding: 8px 12px; font-size: 12.5px; border-radius: 10px; }
|
||||
.btn:disabled { opacity: .45; cursor: not-allowed; }
|
||||
.icon-btn {
|
||||
width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
|
||||
color: var(--muted); font-size: 15px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
|
||||
}
|
||||
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
|
||||
.pill {
|
||||
display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px;
|
||||
font-size: 11.5px; font-weight: 700; background: var(--surface-2); border: 1px solid var(--line); text-transform: capitalize;
|
||||
}
|
||||
.pill.attendee { background: rgba(148,163,184,.14); border-color: rgba(148,163,184,.4); color: #64748b; }
|
||||
.pill.staff { background: rgba(32,178,170,.13); border-color: rgba(32,178,170,.4); color: #0f766e; }
|
||||
.pill.admin { background: var(--accent-soft); border-color: rgba(213,0,0,.35); color: var(--accent); }
|
||||
.pill.amber { background: rgba(245,158,11,.14); border-color: rgba(245,158,11,.4); color: #b45309; }
|
||||
.pill.green { background: rgba(5,150,105,.12); border-color: rgba(5,150,105,.35); color: var(--green); }
|
||||
.pill.violet { background: var(--accent-soft); border-color: rgba(213,0,0,.35); color: var(--accent); }
|
||||
.pill.cyan { background: rgba(32,178,170,.13); border-color: rgba(32,178,170,.4); color: #0f766e; }
|
||||
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; font-weight: 800; color: #fff; flex-shrink: 0; }
|
||||
.input, select.input {
|
||||
width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
|
||||
background: var(--surface-2); color: var(--text); font-size: 14px; outline: none; font-family: inherit;
|
||||
}
|
||||
.input:focus { border-color: var(--accent); }
|
||||
textarea.input { resize: none; min-height: 84px; }
|
||||
.field { display: flex; flex-direction: column; gap: 6px; }
|
||||
.field label { font-size: 12.5px; font-weight: 700; color: var(--muted); }
|
||||
.divider { height: 1px; background: var(--line); margin: 4px 0; }
|
||||
|
||||
/* ---------- Stat cards ---------- */
|
||||
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
|
||||
.stat {
|
||||
background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px;
|
||||
box-shadow: 0 8px 24px rgba(66,60,60,.06); display: flex; flex-direction: column; gap: 6px;
|
||||
}
|
||||
.stat .ico { font-size: 22px; }
|
||||
.stat .val { font-size: 30px; font-weight: 900; letter-spacing: -1px; }
|
||||
.stat .lbl { color: var(--muted); font-size: 13px; font-weight: 600; }
|
||||
.stat.accent { background: linear-gradient(135deg, rgba(213,0,0,.1), rgba(32,178,170,.08)); border-color: rgba(213,0,0,.3); }
|
||||
|
||||
/* ---------- Table ---------- */
|
||||
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: 0 8px 24px rgba(66,60,60,.06); }
|
||||
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
|
||||
table.data th {
|
||||
text-align: left; padding: 13px 16px; font-size: 11.5px; font-weight: 800; text-transform: uppercase;
|
||||
letter-spacing: .4px; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line);
|
||||
}
|
||||
table.data td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
|
||||
table.data tr:last-child td { border-bottom: none; }
|
||||
table.data tr:hover td { background: rgba(244,245,249,.6); }
|
||||
.cell-person { display: flex; align-items: center; gap: 11px; }
|
||||
.cell-person .n { font-weight: 700; }
|
||||
.cell-person .e { font-size: 12px; color: var(--muted); }
|
||||
.pts { font-weight: 800; color: #b45309; }
|
||||
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
|
||||
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
|
||||
|
||||
/* ---------- Modal ---------- */
|
||||
.backdrop { position: fixed; inset: 0; background: rgba(5,5,10,.6); backdrop-filter: blur(3px); z-index: 70; display: flex; align-items: center; justify-content: center; padding: 20px; }
|
||||
.modal {
|
||||
width: 100%; max-width: 460px; background: var(--surface); border-radius: 20px;
|
||||
border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(66,60,60,.35);
|
||||
max-height: 88dvh; overflow-y: auto; animation: pop .18s ease;
|
||||
}
|
||||
@keyframes pop { from { transform: scale(.96); opacity: .4 } to { transform: none; opacity: 1 } }
|
||||
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 0; }
|
||||
.modal-head h3 { font-size: 18px; font-weight: 800; letter-spacing: -.3px; }
|
||||
.modal-body { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
|
||||
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 0 20px 20px; }
|
||||
.modal-foot .btn { width: auto; }
|
||||
|
||||
/* ---------- Segmented control ---------- */
|
||||
.seg { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 4px; }
|
||||
.seg button {
|
||||
flex: 1; padding: 10px; border: none; border-radius: 10px; background: none; color: var(--muted);
|
||||
font-weight: 700; font-size: 13.5px; cursor: pointer; font-family: inherit; white-space: nowrap;
|
||||
}
|
||||
.seg button.active { background: var(--accent-soft); color: var(--accent); }
|
||||
|
||||
/* ---------- QR ---------- */
|
||||
.qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
|
||||
.qr-frame { background: #fff; border-radius: 12px; padding: 12px; border: 1px solid var(--line); }
|
||||
.token-big { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 20px; font-weight: 800; letter-spacing: 1px; color: var(--accent); }
|
||||
|
||||
/* ---------- Login ---------- */
|
||||
.login-wrap { height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 20px; }
|
||||
.login-card {
|
||||
width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line);
|
||||
border-radius: 24px; padding: 34px 30px; box-shadow: 0 30px 80px rgba(66,60,60,.2);
|
||||
display: flex; flex-direction: column; gap: 18px;
|
||||
}
|
||||
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
|
||||
.login-brand .logo {
|
||||
width: 72px; height: 72px; border-radius: 20px; display: flex; align-items: center; justify-content: center;
|
||||
font-size: 32px; font-weight: 900; background: linear-gradient(135deg, var(--accent), #ff5a4e);
|
||||
box-shadow: 0 16px 40px rgba(213,0,0,.35); color: #fff;
|
||||
}
|
||||
.login-brand h1 { font-size: 24px; font-weight: 900; letter-spacing: -.5px; }
|
||||
.login-brand p { color: var(--muted); font-size: 13.5px; }
|
||||
.login-form { display: flex; flex-direction: column; gap: 14px; }
|
||||
.login-err { color: var(--red); font-size: 13px; font-weight: 600; text-align: center; }
|
||||
|
||||
/* ---------- Misc ---------- */
|
||||
.spinner {
|
||||
width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--accent);
|
||||
border-radius: 50%; animation: spin .8s linear infinite;
|
||||
}
|
||||
@keyframes spin { to { transform: rotate(360deg); } }
|
||||
.center { display: flex; align-items: center; justify-content: center; }
|
||||
.loading-screen { height: 100dvh; display: flex; align-items: center; justify-content: center; }
|
||||
.empty {
|
||||
text-align: center; padding: 40px 20px; color: var(--muted); font-size: 14px;
|
||||
border: 1.5px dashed var(--line); border-radius: 16px;
|
||||
}
|
||||
.empty .big { font-size: 34px; margin-bottom: 10px; }
|
||||
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
|
||||
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }
|
||||
|
||||
/* ---------- Toast ---------- */
|
||||
.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: flex; flex-direction: column; gap: 10px; }
|
||||
.toast {
|
||||
background: #fff; border: 1px solid var(--line); border-radius: 14px;
|
||||
padding: 13px 18px; font-size: 13.5px; font-weight: 600; min-width: 240px; max-width: 360px;
|
||||
box-shadow: 0 12px 30px rgba(66,60,60,.22); animation: toast-in .25s ease; cursor: pointer;
|
||||
}
|
||||
@keyframes toast-in { from { transform: translateY(12px); opacity: 0 } to { transform: none; opacity: 1 } }
|
||||
.toast-success { border-color: rgba(5,150,105,.5); }
|
||||
.toast-error { border-color: rgba(213,0,0,.55); }
|
||||
.toast-info { border-color: rgba(32,178,170,.5); }
|
||||
|
||||
/* ---------- Responsive: collapse sidebar to top bar on narrow screens ---------- */
|
||||
@media (max-width: 760px) {
|
||||
.app { flex-direction: column; }
|
||||
.sidebar { width: 100%; flex-direction: row; align-items: center; padding: 12px 14px; gap: 10px; overflow-x: auto; }
|
||||
.brand { padding: 0 8px 0 0; }
|
||||
.brand .sub { display: none; }
|
||||
.nav { flex-direction: row; margin-top: 0; }
|
||||
.nav-item { padding: 9px 12px; white-space: nowrap; }
|
||||
.sidebar-foot { display: none; }
|
||||
.content { padding: 20px 16px 50px; }
|
||||
}
|
||||
Reference in new issue
Block a user