EventHub — Developer Documentation
This folder is the single source of truth for how this project is built.
Before writing any code, read the relevant doc.
Doc
What it covers
file-structure.md
Full folder layout and the why behind each folder
database.md
DB connection setup, query writing rules, pg-promise patterns
api-conventions.md
How to write Next.js API routes, handlers, errors
components.md
Component writing rules, naming, props, file placement
state-management.md
Redux Toolkit slices, thunks, selectors
auth-and-acl.md
NextAuth session, CASL permissions, guard components
pwa.md
Service worker, Web App Manifest, offline strategy
One feature, one slice — each domain (events, tickets, venues…) owns its Redux slice, API route folder, service file, and view folder.
All DB access goes through services/ — no raw db calls inside pages or components.
API routes validate first — every handler checks input with Zod before touching the DB.
Components are dumb by default — business logic lives in views or hooks, not in @core components.
Name things after what they do — useEventFilters.js is better than useFilters.js.
No magic numbers — use constants from src/configs/ or the Redux slice itself.
Layer
Technology
Framework
Next.js 15 (Pages Router)
UI
MUI v6 + Emotion
State
Redux Toolkit
Auth
NextAuth v4
Permissions
CASL
Database
PostgreSQL via pg-promise
Form validation
React Hook Form + Zod
PWA
Custom Service Worker
Localization
react-i18next (English)
Charts
Recharts / ApexCharts
Calendar
FullCalendar