A comprehensive MERN Stack University Campus Management System
Built for the German University in Cairo (GUC)
- Overview
- Features
- Tech Stack
- User Roles
- Project Structure
- Getting Started
- Environment Variables
- API Overview
- Documentation
- Scripts
- Contributors
Nazamly is a full-stack web application designed to streamline campus activities and event management at the German University in Cairo. The platform serves multiple user types including students, staff, professors, vendors, and administrators, providing a centralized hub for:
- π Event Management - Create, discover, and register for university events
- ποΈ Gym Sessions - Schedule and book gym classes
- π Sports Courts - Reserve basketball, tennis, and football courts
- πͺ Vendor Services - Booth applications for bazaars and loyalty programs
- π Polling System - Create and participate in campus polls
- π³ Integrated Payments - Wallet system with Stripe integration
- Multiple event types: Workshops, Trips, Bazaars, Conferences
- Event registration with payment support (Wallet/Stripe)
- QR code generation for external visitors
- Event ratings, comments, and favorites
- Attendance certificates (PDF generation)
- Excel export of registrations
- Gym session scheduling and management
- Multiple session types
- User registration and capacity management
- Sports court management (Basketball, Tennis, Football)
- Real-time slot availability checking
- Court reservation system
- Booth applications for bazaars
- Document uploads (tax cards, company logos)
- Loyalty program applications
- Payment processing for booth fees
- Poll creation by Events Office
- Secure voting system
- Results visualization
- User wallet balance management
- Stripe integration for card payments
- Transaction history
- Refund processing (14-day policy)
- In-app notification system
- Event reminders via cron jobs
- Email notifications
- Attendance reports
- Sales analytics
- Export to Excel functionality
| Technology | Version | Purpose |
|---|---|---|
| Node.js | 16.x+ | Runtime environment |
| Express.js | 5.1.0 | Web framework |
| MongoDB | 7.0.0 | Database (via Mongoose 8.19.0) |
| JWT | 9.0.2 | Authentication |
| bcrypt | 6.0.0 | Password hashing |
| Cloudinary | 1.41.3 | File/image storage |
| Stripe | 20.0.0 | Payment processing |
| nodemailer | 6.10.1 | Email service |
| qrcode | 1.5.4 | QR code generation |
| pdfkit | 0.17.2 | PDF generation (certificates) |
| xlsx | 0.18.5 | Excel export |
| node-cron | 4.2.1 | Scheduled tasks |
| helmet | 7.1.0 | Security headers |
| Joi | 17.11.0 | Validation |
| Technology | Version | Purpose |
|---|---|---|
| React | 18.2.0 | UI library |
| Vite | 7.1.7 | Build tool & dev server |
| React Router DOM | 6.20.1 | Client-side routing |
| TailwindCSS | 3.4.18 | Utility-first styling |
| Axios | 1.6.2 | HTTP client |
| Framer Motion | 10.18.0 | Animations |
| React Hook Form | 7.49.2 | Form handling |
| Zod | 3.22.4 | Schema validation |
| Stripe React | 5.4.1 | Payment UI components |
| Leaflet | 1.9.4 | Interactive maps |
| Lucide React | - | Icon library |
| Role | Description | Email Domain |
|---|---|---|
| Student | University students | @student.guc.edu.eg |
| Staff | University staff members | @guc.edu.eg |
| TA | Teaching assistants | Admin assigned |
| Professor | Professors, can create workshops | Admin assigned |
| Vendor | External companies for bazaars | Any email |
| Admin | System administrators | Admin created |
| EventOffice | Events office staff | Admin assigned |
Nazamly/
βββ π package.json # Root workspace configuration
βββ π README.md # Project documentation
βββ π ATTENDANCE_REPORT_FEATURE.md
β
βββ π backend/
β βββ π package.json
β βββ π README.md # Backend setup guide
β βββ π PAYMENT_SYSTEM_SUMMARY.md
β βββ π VENDOR_DOCUMENTS_SETUP.md
β βββ π CLOUDINARY_SETUP.md
β βββ π docs/
β β βββ API.md # Complete API documentation
β β βββ DATA_MODEL.md # Database schema docs
β β βββ VENDOR_PAYMENT_FLOW.md
β βββ π src/
β β βββ app.js # Express app configuration
β β βββ server.js # Server entry point
β β βββ π config/ # Database, Cloudinary, validation
β β βββ π constants/ # Roles, statuses, schedules
β β βββ π controllers/ # Route handlers (18 controllers)
β β βββ π middleware/ # Auth & upload middleware
β β βββ π models/ # Mongoose schemas (17 models)
β β βββ π routes/ # API route definitions
β β βββ π services/ # Business logic layer
β β βββ π validators/ # Input validation schemas
β β βββ π utils/ # Utility functions
β βββ π tools/ # Admin & seed scripts
β
βββ π frontend/
βββ π package.json
βββ π index.html
βββ π vite.config.js
βββ π tailwind.config.js
βββ π docs/ # Frontend theming guides
βββ π public/ # Static assets
βββ π src/
βββ App.jsx # Main app component
βββ main.jsx # Entry point
βββ index.css # Global styles (Tailwind)
βββ π components/ # Reusable UI components
β βββ Admin/
β βββ auth/
β βββ events/
β βββ EventsOffice/
β βββ landing/
βββ π pages/ # Page components
β βββ Admin/
β βββ Events/
β βββ EventsOffice/
β βββ Login/
β βββ Signup/
βββ π services/ # API service layer
βββ π hooks/ # Custom React hooks
βββ π utils/ # Utility functions
- Node.js 16.x or higher
- MongoDB 5.x+ (local installation or MongoDB Atlas)
- npm or yarn package manager
- Git
-
Clone the repository
git clone https://github.com/Advanced-Computer-Lab-2025/Nazamly.git cd Nazamly -
Install all dependencies
# Install root, frontend, and backend dependencies npm run install:allOr install manually:
npm install cd frontend && npm install cd ../backend && npm install
-
Set up environment variables
Create a
.envfile in thebackend/directory (see Environment Variables) -
Start MongoDB
Ensure MongoDB is running locally or configure your MongoDB Atlas connection string
-
Run the application
# Development mode (runs both backend and frontend) npm run dev
# Backend only (runs on port 5000)
npm run dev:backend
# Frontend only (runs on port 5173)
npm run dev:frontend# Build frontend for production
npm run build
# Start production server
npm run start:backendCreate a .env file in the backend/ directory with the following variables:
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# DATABASE
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
MONGO_URL=mongodb+srv://<username>:<password>@cluster.mongodb.net/nazamly
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# SERVER
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
PORT=5000
NODE_ENV=development
CLIENT_URL=http://localhost:5173
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# AUTHENTICATION (JWT)
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
JWT_SECRET=your-super-secret-jwt-key
JWT_EXPIRES_IN=1h
JWT_REMEMBER_ME_EXPIRES_IN=30d
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# EMAIL VALIDATION
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
PASSWORD_MIN_LENGTH=8
PASSWORD_MAX_LENGTH=128
STUDENT_EMAIL_DOMAIN=@student.guc.edu.eg
STAFF_EMAIL_DOMAIN=@guc.edu.eg
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# CLOUDINARY (File Uploads)
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
CLOUDINARY_CLOUD_NAME=your-cloud-name
CLOUDINARY_API_KEY=your-api-key
CLOUDINARY_API_SECRET=your-api-secret
MAX_FILE_SIZE_MB=5
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# STRIPE (Payments)
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
STRIPE_SECRET_KEY=sk_test_xxx
STRIPE_PUBLISHABLE_KEY=pk_test_xxx
STRIPE_WEBHOOK_SECRET=whsec_xxx
STRIPE_CURRENCY=egp
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# RATE LIMITING
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
RATE_LIMIT_WINDOW_MS=900000
RATE_LIMIT_MAX_REQUESTS=100
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# EMAIL (SMTP) - Optional
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your-email@gmail.com
SMTP_PASSWORD=your-app-passwordThe backend exposes a RESTful API. Here's an overview of the main endpoint categories:
| Method | Endpoint | Description |
|---|---|---|
| POST | /signup |
User registration |
| POST | /login |
User login |
| POST | /logout |
User logout |
| GET | /verify-email/:token |
Email verification |
| Method | Endpoint | Description |
|---|---|---|
| GET | / |
Get all events |
| POST | / |
Create event |
| GET | /:eventId |
Get event by ID |
| PATCH | /:eventId/archive |
Archive event |
| POST | /:eventId/qr |
Generate QR code |
| GET | /:eventId/export |
Export registrations |
| Method | Endpoint | Description |
|---|---|---|
| POST | /:eventId/register |
Register for event |
| DELETE | /:eventId/cancel |
Cancel registration |
| GET | /my-registrations |
User's registrations |
| POST | /:eventId/rate |
Rate an event |
| Method | Endpoint | Description |
|---|---|---|
| GET | /sessions |
Get gym sessions |
| POST | /sessions |
Create session |
| POST | /sessions/:sessionId/register |
Register for session |
| Method | Endpoint | Description |
|---|---|---|
| GET | / |
Get all courts |
| GET | /:courtId/available-slots |
Get available slots |
| POST | /:courtId/reserve |
Reserve court |
| Method | Endpoint | Description |
|---|---|---|
| GET | /bazaars |
Get upcoming bazaars |
| POST | /applications |
Apply for booth |
| POST | /loyalty-program/apply |
Apply to loyalty program |
| Method | Endpoint | Description |
|---|---|---|
| GET | /signup-requests |
View signup requests |
| PATCH | /signup-requests/:id |
Approve/reject requests |
| PATCH | /users/:userId/block |
Block/unblock user |
| Method | Endpoint | Description |
|---|---|---|
| POST | /stripe/create-intent |
Create payment intent |
| POST | /stripe/finalize |
Finalize payment |
π For complete API documentation, see
backend/docs/API.md
| Document | Location | Description |
|---|---|---|
| Backend README | backend/README.md |
Backend setup guide |
| API Documentation | backend/docs/API.md |
Complete API reference |
| Data Models | backend/docs/DATA_MODEL.md |
MongoDB schema docs |
| Vendor Payment Flow | backend/docs/VENDOR_PAYMENT_FLOW.md |
Payment workflow |
| Payment System | backend/PAYMENT_SYSTEM_SUMMARY.md |
Payment implementation |
| Cloudinary Setup | backend/CLOUDINARY_SETUP.md |
Image upload config |
| Frontend Theming | frontend/docs/ |
Theme and font guides |
| Script | Command | Description |
|---|---|---|
dev |
npm run dev |
Run both backend and frontend |
dev:backend |
npm run dev:backend |
Run backend with nodemon |
dev:frontend |
npm run dev:frontend |
Run Vite dev server |
build |
npm run build |
Build frontend for production |
install:all |
npm run install:all |
Install all dependencies |
# Create admin user
node backend/tools/create_admin_user.js
# Create test user
node backend/tools/create_test_user.js
# Seed courts data
node backend/tools/seed_courts.jsThis project was developed as part of the Advanced Computer Lab course at the German University in Cairo (GUC).
This project is developed for educational purposes as part of the GUC curriculum.
Made with β€οΈ at German University in Cairo