How shijuvtm/meetup works
Purpose and Deployment Shape
This is a containerized meetup/event RSVP tracker. A Next.js frontend calls an Express API, which persists users, events, and RSVP state in PostgreSQL/Neon. Docker Compose orchestrates frontend and backend containers via docker-compose.yml; backend startup and database setup are defined in backend/Dockerfile, backend/entrypoint.sh, and backend/init-db.js.
Backend API Entry and Composition
The Node process starts at backend/server.js, which loads the Express application from backend/src/app.js. The app composes API routes and shared middleware, separating HTTP wiring from domain handling. Backend dependencies and runtime scripts are declared in backend/package.json.
Authentication Boundary
Authentication is exposed through backend/src/routes/authRoutes.js and implemented in backend/src/controllers/authController.js. It uses bcrypt password hashing and JWT issuance. Protected requests cross the authorization boundary in backend/src/middleware/auth.js, which validates tokens and supplies authenticated identity for ownership-guarded event actions.
Event and RSVP Domain
Event lifecycle and RSVP operations are routed through backend/src/routes/eventRoutes.js and handled in backend/src/controllers/eventController.js. This layer owns creation, editing, deletion, retrieval/filtering, and RSVP status changes. Event mutation authorization depends on the authenticated user established by the auth middleware.
Persistence and Database Lifecycle
PostgreSQL access is centralized in backend/src/config/db.js, using the DATABASE_URL connection to a Neon-hosted database. The relational schema is defined in backend/schema.sql; initialization and optional initial data paths are backend/init-db.js and backend/seed.js. The database is an external managed service rather than a local Compose service.
Frontend Application and Client State
The Next.js application is rooted at frontend/app/layout.tsx and frontend/app/page.tsx. Authentication state is shared through frontend/context/AuthContext.tsx, while API requests are centralized in frontend/lib/api.ts, using the public backend URL environment variable. frontend/components/Navbar.tsx is the cross-page navigation/auth-facing UI boundary.
User Flows and Pages
The frontend maps event operations to App Router pages: event detail at frontend/app/events/[id]/page.tsx, event editing at frontend/app/events/[id]/edit/page.tsx, and creation at frontend/app/events/create/page.tsx. Login begins at frontend/app/login/page.tsx. These pages read/write through the API client; the backend enforces JWT identity and event ownership rather than trusting client state.
Main entry points: layout.tsx App shell · app.js Express app · eventRoutes.js Event & RSVP API · api.ts API client
Components 17
Next.js frontend
- App shell
frontend/app/layout.tsx - Home page
frontend/app/page.tsx - Event pages · Detail, creation, and editing flows.
frontend/app/events/[id]/page.tsx - Login page
frontend/app/login/page.tsx - Auth state
frontend/context/AuthContext.tsx - Navbar
frontend/components/Navbar.tsx - API client · Uses the public backend URL.
frontend/lib/api.ts
Express backend
- Server entry
backend/server.js - Express app · Composes routes and shared middleware.
backend/src/app.js - Auth API · Password authentication and JWT issuance.
backend/src/routes/authRoutes.js - Event & RSVP API · Event lifecycle and RSVP status operations.
backend/src/routes/eventRoutes.js - JWT authorization · Supplies identity for protected ownership checks.
backend/src/middleware/auth.js - Database access · Connects using DATABASE_URL.
backend/src/config/db.js
Data & deployment
- Docker Compose · Runs frontend and backend containers.
docker-compose.yml - Database startup · Initializes database during backend startup.
backend/entrypoint.sh - Relational schema
backend/schema.sql - Neon PostgreSQL · External persistent store for users, events, and RSVPs.
Connections 20
- Docker Compose → App shell: runs
- Docker Compose → Server entry: runs
- App shell → Home page: renders
- App shell → Event pages: routes to
- App shell → Login page: routes to
- App shell → Auth state: provides
- Navbar → Auth state: reads
- Login page → API client: auth requests
- Event pages → API client: event and RSVP requests
- API client → Express app: HTTP API
- Server entry → Express app: loads
- Express app → Auth API: mounts
- Express app → Event & RSVP API: mounts
- Event & RSVP API → JWT authorization: protects mutations
- JWT authorization → Event & RSVP API: authenticated identity
- Auth API → Database access: users
- Event & RSVP API → Database access: events and RSVPs
- Database access → Neon PostgreSQL: DATABASE_URL
- Database startup → Relational schema: applies
- Relational schema → Neon PostgreSQL: defines