Skip to content
/ yabudu Public

Event Registration App — Next.js + Prisma + NextAuth app for managing event participation. Register via Yandex ID, VK ID, Sber ID, or TBank ID; select places, join or leave events with waitlist handling. Chakra UI v3.

Notifications You must be signed in to change notification settings

sergeyt/yabudu

Repository files navigation

Event Registration App

License: MIT Next.js

Event Registration App — A modern Next.js + Prisma + NextAuth application for managing event participation.
Users can register via Yandex ID, VK ID, Sber ID, or TBank ID, select event places, and join or leave events with automatic waitlist handling.
Supports dual capacities (confirmed + reserved lists). Built with Chakra UI, fully deployable on Vercel.


🧭 Features

  • OAuth login: Yandex ID, VK ID, Sber ID, TBank ID (Tinkoff ID)
  • Event registration rules: only within 24h before event start
  • Dual capacities: confirmed + reserved waitlist
  • Prisma ORM with SQLite/Postgres support
  • NextAuth v5 with Prisma adapter
  • Chakra UI mobile-first responsive design
  • Deploy-ready on Vercel or any Node server

🧩 Tech Stack

  • Next.js (App Router) — modern routing, server actions, and auth
  • NextAuth.js — OAuth via Russian identity providers
  • Prisma ORM — schema-driven database access
  • SQLite (local) or PostgreSQL (production)
  • Chakra UI — clean, accessible component library
  • TypeScript — full typing and developer safety

⚙️ Setup

1. Clone and install

git clone https://github.com/sergeyt/yabudu.git
cd yabudu
pnpm install

2. Environment variables

Create .env.local:

# Database
DATABASE_URL="file:./dev.db"
# provider must be a literal string for IntelliJ
# provider = "sqlite" or "postgresql"

# NextAuth
AUTH_URL=http://localhost:3000
AUTH_SECRET=your_random_long_secret
AUTH_TRUST_HOST=true

# OAuth credentials
YANDEX_CLIENT_ID=...
YANDEX_CLIENT_SECRET=...
VK_CLIENT_ID=...
VK_CLIENT_SECRET=...
SBER_ISSUER=https://login.sber.ru/oidc/
SBER_CLIENT_ID=...
SBER_CLIENT_SECRET=...
TBANK_ISSUER=https://id.tinkoff.ru/oidc/
TBANK_CLIENT_ID=...
TBANK_CLIENT_SECRET=...

3. Prisma

pnpm install
pnpm db:migrate
pnpm db:seed

🗄️ Schema Overview

model User {
  id             String       @id @default(cuid())
  name           String?
  email          String?      @unique
  image          String?
  rttfProfileUrl String?
  role           UserRole     @default(USER)
  createdAt      DateTime     @default(now())
  accounts       Account[]
  sessions       Session[]
  registrations  Registration[]
  adminPlaces    PlaceAdmin[]
}

model Place {
  id          String       @id @default(cuid())
  name        String       @unique
  location    String?
  description String?
  infoUrl     String?
  createdAt   DateTime     @default(now())
  events      Event[]
  admins      PlaceAdmin[]
}

model PlaceAdmin {
  id        String   @id @default(cuid())
  userId    String
  placeId   String
  createdAt DateTime @default(now())
  user  User  @relation(fields: [userId], references: [id], onDelete: Cascade)
  place Place @relation(fields: [placeId], references: [id], onDelete: Cascade)
  @@unique([userId, placeId])
}

model Event {
  id              String   @id @default(cuid())
  title           String
  startAt         DateTime
  placeId         String
  place           Place    @relation(fields: [placeId], references: [id], onDelete: Cascade)
  capacity        Int?
  reserveCapacity Int?
  createdAt       DateTime @default(now())
  regs            Registration[]
}

enum RegistrationStatus {
  CONFIRMED
  RESERVED
}

model Registration {
  id        String              @id @default(cuid())
  userId    String
  eventId   String
  status    RegistrationStatus  @default(CONFIRMED)
  createdAt DateTime            @default(now())
  user  User  @relation(fields: [userId], references: [id], onDelete: Cascade)
  event Event @relation(fields: [eventId], references: [id], onDelete: Cascade)
  @@unique([userId, eventId])
}

enum UserRole {
  USER
  SUPERADMIN
}

🧪 Development

pnpm dev

App runs at http://localhost:3000


🚀 Deploy to Vercel

  • Add all environment variables in Vercel Dashboard → Settings → Environment Variables
  • Use PostgreSQL (e.g., Neon, Supabase) in production
  • Provider must be a literal ("postgresql") in schema.prisma
  • NextAuth works natively with Edge functions on Vercel

🛡️ Security Notes

  • All registration actions are protected by NextAuth sessions
  • Server actions only execute with authenticated users
  • No client-side access to Prisma or secrets
  • Use HTTPS + strong AUTH_SECRET in production

📜 License

MIT License © 2025 Sergey Todyshev

About

Event Registration App — Next.js + Prisma + NextAuth app for managing event participation. Register via Yandex ID, VK ID, Sber ID, or TBank ID; select places, join or leave events with waitlist handling. Chakra UI v3.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages