How brajbhujel/event-planner works
Event Planner is a split Next.js UI and Express REST API for account-secured event creation, discovery, invitations, and RSVP. The main user journey is authenticate, browse or manage events, then inspect details or RSVP; the API validates and applies visibility rules before serving event and dashboard data. The README documents OTP email verification, optional TOTP, cookie-based JWT sessions, normalized tags/invitations, and cached UI lists. Some frontend implementation links and event-service internals are unsampled, so those relationships are shown only where documented or evidenced by the index.
Main entry points: auth.ts Account and session logic · db.ts Knex database access · auth.controller.ts Auth controller · app.ts Express API app
Components 24
Next.js workspace
- Sign-in and signup
frontend/src/components/auth/auth-form.tsx - Workspace pages
frontend/src/components/workspace/dashboard-page.tsx - Event management
frontend/src/components/workspace/event-form.tsx - Event details and RSVP
frontend/src/components/workspace/event-detail-page.tsx - Profile and 2FA settings
frontend/src/components/workspace/profile-page.tsx - Auth API client
frontend/src/services/auth.service.ts - Event API client
frontend/src/services/events.service.ts - Workspace cache
frontend/src/stores/workspace-store.ts
REST API
- Express API app
backend/src/app.ts - Auth routes
backend/src/routes/auth.ts - Event routes
backend/src/routes/events.ts - Auth controller
backend/src/controllers/auth.controller.ts - Event controller
backend/src/controllers/events.controller.ts
Application services
- Account and session logic
backend/src/services/auth.ts - Event visibility and operations
backend/src/services/events.ts - Request validation
backend/src/validations/index.ts - Email OTP
backend/src/services/otp.ts - TOTP and backup codes
backend/src/services/two-factor.ts
State and security
- JWT issuance
backend/src/services/tokens.ts - Session authentication
backend/src/middleware/auth.ts - HttpOnly cookies
backend/src/utils/cookies.ts - Knex database access
backend/src/config/db.ts
Other components
- Event planner
- PostgreSQL
Connections 29
- Event planner → Sign-in and signup: signs in
- Event planner → Workspace pages: plans events
- Sign-in and signup → Auth API client: submits auth
- Workspace pages → Workspace cache: uses cache
- Event management → Event API client: submits changes
- Event details and RSVP → Event API client: loads details
- Profile and 2FA settings → Auth API client: updates account
- Auth API client → Express API app: calls REST API
README.md - Event API client → Express API app: calls REST API
README.md - Express API app → Auth routes: mounts routes
backend/src/app.ts - Express API app → Event routes: mounts routes
backend/src/app.ts - Auth routes → Auth controller: dispatches
backend/src/routes/auth.ts - Event routes → Event controller: dispatches
backend/src/routes/events.ts - Auth controller → Account and session logic: calls auth logic
backend/src/controllers/auth.controller.ts - Event controller → Event visibility and operations: calls event logic
backend/src/controllers/events.controller.ts - Auth controller → Request validation: validates input
backend/src/controllers/auth.controller.ts - Event controller → Request validation: validates input
backend/src/controllers/events.controller.ts - Account and session logic → Email OTP: issues and checks OTP
backend/src/services/auth.ts - Account and session logic → TOTP and backup codes: delegates 2FA
backend/src/services/auth.ts - Account and session logic → JWT issuance: issues sessions
backend/src/services/auth.ts - Auth controller → HttpOnly cookies: sets session cookies
backend/src/controllers/auth.controller.ts - Session authentication → JWT issuance: verifies access token
backend/src/middleware/auth.ts - Session authentication → HttpOnly cookies: reads session cookie
backend/src/middleware/auth.ts - Auth routes → Session authentication: guards account routes
backend/src/routes/auth.ts - Account and session logic → Knex database access: reads and writes users
backend/src/services/auth.ts - Event visibility and operations → Knex database access: reads and writes events
backend/src/services/events.ts - Email OTP → Knex database access: stores OTP state
backend/src/services/otp.ts - TOTP and backup codes → Knex database access: stores 2FA state
backend/src/services/two-factor.ts - Knex database access → PostgreSQL: connects
backend/src/config/db.ts