How abhinavb20/meetup-sync works
Purpose and deployment
MeetupSync is a Docker-compose full-stack meetup manager: users authenticate, manage events they own, and submit/view RSVPs. Compose starts the Next.js frontend, Express API, and MySQL 8.4 database: docker-compose.yml, backend/server.js, mysql/init/01-schema.sql.
Client application and entry points
The Next.js App Router frontend is the user-facing entry point at port 3000. The root layout and guest landing page establish the application shell; navigation conditionally reflects authentication state. Core user flows are dashboard, event creation/editing, and event detail/RSVP views.
• frontend/app/layout.js
• frontend/app/page.js
• frontend/app/dashboard/page.js
• frontend/components/NavbarWrapper.js
Frontend API boundary
Next route handlers form a backend-for-frontend boundary between browser UI and Express. They cover auth, event CRUD, RSVP mutation, and attendee retrieval, likely forwarding cookies/auth context rather than exposing backend concerns directly to pages.
• frontend/app/api/auth/login/route.js
• frontend/app/api/events/route.js
• frontend/app/api/events/[id]/rsvp/route.js
• frontend/app/api/events/[id]/rsvps/route.js
Express API and request routing
The Node/Express server at port 5000 is the authoritative application API. It composes separate authentication and event route modules; event routes own event lifecycle, ownership enforcement, RSVP operations, capacity checks, and attendee queries.
• backend/server.js
• backend/routes/authRoutes.js
• backend/routes/eventRoutes.js
Identity and authorization
Login verifies bcrypt-hashed credentials, produces a JWT, and uses an HTTP-only authentication cookie. Protected Express operations pass through JWT verification middleware; ownership checks in event handling restrict edits/deletes to the event creator. Logout and current-user endpoints complete session lifecycle.
• backend/middleware/auth.js
• backend/utils/jwt.js
• frontend/app/api/auth/me/route.js
• frontend/app/api/auth/logout/route.js
Persistence and domain constraints
MySQL is the system of record for users, events, and RSVPs. The initialization schema establishes relationships, seeded accounts/event, and database constraints; Express accesses it through a shared MySQL2 pool. Application/database rules prevent duplicate RSVPs, and RSVP processing accounts for event capacity.
• mysql/init/01-schema.sql
• backend/db/pool.js
• backend/routes/eventRoutes.js
Primary flow
Browser pages call same-origin Next API handlers; handlers communicate with Express; Express authenticates requests and reads/writes MySQL. Login establishes the cookie consumed by subsequent protected calls. Event creation associates an authenticated creator; detail views fetch event and attendees; RSVP creates, updates, or removes the caller’s response while enforcing duplicate/capacity rules. The primary runtime boundary is Next.js ↔ Express, and the trust boundary is JWT middleware before protected database mutations.
Main entry points: server.js Express server · docker-compose.yml Docker Compose · layout.js App shell & landing · authRoutes.js Authentication routes
Components 14
Next.js frontend
Browser UI and same-origin backend-for-frontend.
- App shell & landing · Root layout, guest landing page, and auth-aware navigation.
frontend/app/layout.js - Dashboard · Authenticated event management view.
frontend/app/dashboard/page.js - Auth-aware navbar
frontend/components/NavbarWrapper.js - Auth BFF handlers · Login, current-user, and logout boundary.
frontend/app/api/auth/login/route.js - Event BFF handlers · Event CRUD, RSVP, and attendee requests.
frontend/app/api/events/route.js
Express API
Authoritative application API.
- Express server · Composes authentication and event routing.
backend/server.js - Authentication routes · Verifies credentials and manages session lifecycle.
backend/routes/authRoutes.js - Event routes · Owns event lifecycle, RSVPs, attendee queries, and capacity rules.
backend/routes/eventRoutes.js - JWT middleware · Protects authenticated operations before mutation.
backend/middleware/auth.js - JWT utility · Creates and verifies authentication tokens.
backend/utils/jwt.js - MySQL2 pool · Shared connection pool for Express routes.
backend/db/pool.js
MySQL
Persistent system of record.
- MySQL 8.4 · Stores users, events, and RSVPs.
mysql/init/01-schema.sql - Schema & seed data · Defines relationships, constraints, and seeded records.
mysql/init/01-schema.sql
Other components
- Docker Compose · Starts frontend, API, and MySQL services.
docker-compose.yml
Connections 17
- Docker Compose → App shell & landing: starts
- Docker Compose → Express server: starts
- Docker Compose → MySQL 8.4: starts
- App shell & landing → Auth-aware navbar: renders
- Dashboard → Event BFF handlers: same-origin API calls
- App shell & landing → Auth BFF handlers: login/session calls
- Auth BFF handlers → Express server: forwards auth context
- Event BFF handlers → Express server: forwards protected requests
- Express server → Authentication routes: routes auth requests
- Express server → Event routes: routes event requests
- Authentication routes → JWT utility: issues JWT
- Event routes → JWT middleware: protected operations
- JWT middleware → JWT utility: verifies JWT
- Authentication routes → MySQL2 pool: reads users
- Event routes → MySQL2 pool: reads/writes events and RSVPs
- MySQL2 pool → MySQL 8.4: queries
- Schema & seed data → MySQL 8.4: initializes