An internal attendance system for managing events, issuing token-based check-in links, and tracking engagement from a private admin dashboard.
- Admin login backed by a signed session cookie.
- Event management for creating, editing, deleting, and regenerating attendance tokens.
- Public attendance check-in pages at
/attend/[token]. - Community leaderboard grouped by attendee email and ordered by total event reward points.
- Attendance records are unique per event and email.
- Next.js 16 App Router
- React 19
- Prisma 7 with PostgreSQL
- Tailwind CSS 4
- Zod for form validation
- bcryptjs for admin password hashing
/redirects to/login/loginadmin sign-in page/adminevent dashboard/admin/events/newcreate a new event/admin/events/[eventId]event details and attendance token view/admin/events/[eventId]/editedit an event/admin/communitycommunity leaderboard/attend/[token]public attendance form for an event token
Create a .env file with at least:
DATABASE_URL="postgresql://user:password@localhost:5432/attendance_tracker"Optional variables:
ADMIN_SESSION_SECRET="some-long-random-secret"
ADMIN_EMAIL="admin@example.com"
ADMIN_PASSWORD="adminpassword123"If ADMIN_SESSION_SECRET is not set, the app falls back to a development-only default session secret.
- Install dependencies.
npm install- Run the database migrations.
npx prisma migrate dev- Seed the default admin user.
npx prisma db seed- Start the development server.
npm run devOpen http://localhost:3000 and sign in at /login.
The seed script creates one admin user if it does not already exist.
- Email:
admin@example.com - Password:
adminpassword123
You can override both values with ADMIN_EMAIL and ADMIN_PASSWORD before running the seed.
- Events have a generated 16-character attendance token.
- Check-in is allowed only while the event is between
startsAtandendsAt. - Each attendance submission stores name, email, and answers to configured event questions.
- A single email can only check in once per event.
- Leaderboard points come from each event's
rewardPointsvalue.
npm run dev
npm run build
npm run start
npm run lint- The app uses
Poppinsfor the UI typography. - Authentication is handled with a signed, HTTP-only cookie named
admin_session. - Prisma is configured for PostgreSQL in
prisma/schema.prismaandlib/prisma.ts.