How krutikgadhiya/sgp-event-management works
Project Type and Purpose
• This is a full-stack university event-management system (“sgp-event-management”) comprised of:
• A ReactJS single-page application (SPA) as the front end
• A Node.js + Express backend as a RESTful API
• MongoDB as the data store
• Cloudinary for image storage
• Google OAuth for authentication
• PDF-generation modules for pre/post event reports
File Structure
• Top-level folders:
• client/ — React app, components, Redux reducer, build artifacts
• server/ — Express server, routes, middleware, Mongoose models, PDF logic
• client/src/components contains all UI screens (Dashboard, CreateEvent, SignIn, charts, PDF previews).
• client/src/reducers holds Redux state logic (userReducer).
• server/routes defines REST endpoints: auth, postEvent, preEvent, chartDetails, createPdf, getCount, updateDelete.
• server/models defines Mongoose schemas: user, postEvent, preEvent.
• server/middleware/requireLogin enforces JWT/session protection.
• server/documents contains PDF-building logic (fullPDF.js).
README Insights
• Features: CRUD on events, PDF generation (pre + post), analytics dashboard with charts.
• Stack: ReactJS, NodeJS/Express, MongoDB, Cloudinary, Google sign-in.
Main Components & Interactions
a. User Browser (React SPA)
– Renders UI, manages state with Redux
– Hosts components: Login, Dashboard, Event forms, Charts, PDF preview
b. API Server (Node/Express)
– Exposes REST endpoints (/auth, /preEvent, /postEvent, /chartDetails, /createPdf, /getCount, /updateDelete)
– Contains middleware for auth (requireLogin) and controllers that use Mongoose models
– Contains PDF generator module
c. Database (MongoDB)
– Stores user records, preEvent, postEvent documents
d. Cloudinary
– Stores event images uploaded by users
e. External Auth (Google OAuth)
– Used during sign-in/sign-up
f. PDF Engine
– Combines preEvent + postEvent data into result.pdf (server/documents/fullPDF.js)
Data flows:
1. User → React UI → dispatch Redux action → HTTP request
2. React → Express route → requireLogin middleware → controller → Mongoose → MongoDB
3. Express may call Cloudinary SDK for uploads
4. PDF endpoints → server/documents → PDF library → result.pdf → served back
5. React fetches chart data → Express → MongoDB → sends metrics → ChartJS components render
Architectural Patterns & Principles
• Client-server separation
• RESTful API design
• MVC-style modeling: routes → controllers → models
• Redux for state management in the front end
• Middleware for cross-cutting concerns (auth)
• Single Responsibility: separate modules for PDF logic, auth, CRUD, analytics