diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000..be7bc3d7
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,45 @@
+# Dependencies
+node_modules/
+frontend/node_modules/
+backend/node_modules/
+
+# Build outputs
+frontend/dist/
+frontend/build/
+backend/dist/
+backend/build/
+
+# Logs
+logs
+*.log
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+pnpm-debug.log*
+lerna-debug.log*
+
+# OS files
+.DS_Store
+Thumbs.db
+
+# IDE files
+.vscode/
+.idea/
+*.swp
+*.swo
+*~
+
+# Uploads (if you don't want to commit user uploads)
+backend/uploads/*
+!backend/uploads/.gitkeep
+
+# Test coverage
+coverage/
+.nyc_output/
+
+# Temporary files
+*.tmp
+.cache/
+
+# Other
+backend/CON/
diff --git a/ANALYTICS_DASHBOARD.md b/ANALYTICS_DASHBOARD.md
new file mode 100644
index 00000000..454df8ab
--- /dev/null
+++ b/ANALYTICS_DASHBOARD.md
@@ -0,0 +1,370 @@
+# Event Impact & Feedback Analytics Dashboard
+
+## Overview
+
+A comprehensive, visually rich analytics dashboard for the Agora university event-management platform. This enterprise-grade dashboard provides event organizers, professors, and administrators with data-driven insights into event performance, attendee engagement, and vendor effectiveness.
+
+## Features
+
+### 📊 Key Performance Indicators (KPIs)
+- **Total Events**: Track all events in the system
+- **Total Registrations**: Monitor registration volumes
+- **Attendance Rate**: Real-time attendance tracking with trend indicators
+- **Average Rating**: Aggregate feedback scores with review counts
+
+### 📈 Comprehensive Analytics
+
+#### 1. Attendance Statistics
+- Registration vs actual attendance comparison
+- Attendance rate calculation per event
+- Visual bar charts for easy comparison
+- Historical trends and patterns
+
+#### 2. Engagement Heatmap
+- Time-series visualization of user interactions
+- Track event views, check-ins, and feedback submissions
+- Configurable granularity (hour/day/week)
+- Identify peak engagement periods
+
+#### 3. Rating Analytics
+- Rating distribution (1-5 stars) pie chart
+- Average rating calculation
+- Top positive feedback showcase
+- Critical feedback highlighting for action items
+
+#### 4. Attendee Demographics
+- Breakdown by role (Student/Staff/TA/Professor)
+- Faculty distribution
+- Year/age group analysis
+- Helps target future events effectively
+
+#### 5. Vendor Performance Metrics
+- Booth visit tracking
+- Favorite/bookmark counts
+- Lead generation metrics
+- Engagement score calculation (weighted: visits×1 + favorites×3 + leads×5)
+- Vendor rankings with podium display
+
+#### 6. Drop-off Funnel
+- Conversion visualization: View → Register → Attend → Feedback
+- Percentage conversion at each stage
+- Identifies bottlenecks in the user journey
+- Supports optimization strategies
+
+#### 7. Registration Trends
+- Time-series line chart
+- Daily/weekly/monthly patterns
+- Helps predict future registration volumes
+
+### 🎨 User Experience
+
+#### Professional Design
+- Dark theme with gradient backgrounds
+- Glass-morphism effects
+- Smooth animations using Framer Motion
+- Responsive grid layouts
+
+#### Interactive Elements
+- Hover tooltips on all charts
+- Custom styled chart tooltips
+- Filter controls for date range and event selection
+- Export functionality placeholders
+
+#### AI-Generated Insights
+- Automatic insight generation based on data patterns
+- Performance benchmarking
+- Actionable recommendations
+- Trend identification
+
+## Technical Architecture
+
+### Backend (Node.js + Express + MongoDB)
+
+#### Models
+- **AnalyticsEvent**: Tracks all user interactions
+ - EVENT_VIEW: User viewed event details
+ - EVENT_REGISTER: Registration action
+ - EVENT_CHECKIN: QR code check-in
+ - EVENT_FEEDBACK: Feedback submission
+ - VENDOR_BOOTH_VISIT: Vendor booth interaction
+ - VENDOR_FAVORITE: Vendor favorited
+ - VENDOR_LEAD: Contact information shared
+
+#### Controllers (`analyticsController.js`)
+Implements 9 comprehensive analytics endpoints:
+
+1. `GET /api/analytics/overview` - Dashboard KPIs
+2. `GET /api/analytics/attendance` - Attendance statistics
+3. `GET /api/analytics/engagement-heatmap` - Time-series engagement
+4. `GET /api/analytics/ratings` - Rating distribution and comments
+5. `GET /api/analytics/demographics` - Attendee demographics
+6. `GET /api/analytics/vendor-performance` - Vendor metrics
+7. `GET /api/analytics/funnel` - Drop-off funnel data
+8. `GET /api/analytics/events` - Event list for filters
+9. `GET /api/analytics/time-series` - Trend data
+
+#### MongoDB Aggregation Pipelines
+- Complex multi-stage aggregations
+- $lookup for cross-collection joins
+- $facet for parallel aggregations
+- Efficient indexed queries
+- Real-time data processing
+
+#### Authentication & Authorization
+- Protected routes using JWT middleware
+- Role-based access control (RBAC)
+- Accessible only to: ADMIN, EVENTS_OFFICE, PROFESSOR
+- Request validation and error handling
+
+### Frontend (React + Recharts + Tailwind CSS)
+
+#### Components
+- **KPICard**: Animated metric cards with trend indicators
+- **ChartContainer**: Reusable chart wrapper with consistent styling
+- **CustomTooltip**: Branded chart tooltips
+- **InsightBanner**: AI-generated insights display
+
+#### Charts (Recharts Library)
+- **BarChart**: Attendance comparison
+- **LineChart**: Registration trends
+- **PieChart**: Rating distribution & demographics
+- **AreaChart**: Engagement heatmap with gradients
+- **FunnelChart**: Conversion funnel visualization
+
+#### State Management
+- React hooks (useState, useEffect)
+- Parallel API fetching with Promise.all
+- Filter-based data refresh
+- Loading states and error handling
+
+## Installation & Setup
+
+### Prerequisites
+- Node.js 16+ and npm
+- MongoDB 5.0+
+- Existing Agora platform setup
+
+### Backend Setup
+
+1. **Install dependencies** (if not already installed):
+```bash
+cd backend
+npm install
+```
+
+2. **Seed demo analytics data**:
+```bash
+node scripts/seed_analytics.js
+```
+
+This will create:
+- 15 sample events
+- 30+ sample users across different roles
+- 10 vendor profiles
+- Hundreds of registrations
+- Realistic check-in patterns (70% attendance rate)
+- Varied feedback (mix of positive and critical)
+- Vendor interaction analytics
+
+3. **Verify API endpoints**:
+```bash
+# Start the server
+npm start
+
+# Test analytics endpoint (requires authentication)
+curl -H "Authorization: Bearer YOUR_JWT_TOKEN" \
+ http://localhost:4000/api/analytics/overview
+```
+
+### Frontend Setup
+
+1. **Dependencies are already installed** (Recharts is in package.json)
+
+2. **Run the development server**:
+```bash
+cd frontend
+npm run dev
+```
+
+3. **Access the dashboard**:
+ - Login as Admin: `admin@guc.edu.eg`
+ - Login as Events Office: Create via admin panel
+ - Login as Professor: Use existing professor account
+ - Navigate to: `/analytics`
+
+## Usage Guide
+
+### For Event Organizers
+
+1. **Monitor Event Performance**
+ - Check attendance rates for past events
+ - Identify well-performing events to replicate
+ - Review critical feedback to improve future events
+
+2. **Filter by Date Range**
+ - Select start and end dates to analyze specific periods
+ - Compare performance across semesters
+ - Generate reports for stakeholders
+
+3. **Vendor Management**
+ - Review vendor engagement metrics
+ - Identify top-performing vendors for future collaboration
+ - Track lead generation effectiveness
+
+### For Professors
+
+1. **Workshop Analytics**
+ - Filter by your specific workshops
+ - Review attendee demographics
+ - Analyze feedback to improve content
+
+2. **Engagement Insights**
+ - Identify optimal event timing
+ - Understand student preferences
+ - Plan future workshops based on data
+
+### For Administrators
+
+1. **Platform-wide Insights**
+ - Track overall platform usage
+ - Identify trends across all events
+ - Make data-driven policy decisions
+
+2. **Performance Benchmarking**
+ - Compare events across different faculties
+ - Identify best practices
+ - Resource allocation optimization
+
+## API Reference
+
+### Query Parameters (All Endpoints)
+
+- `eventId` (optional): Filter by specific event ID
+- `startDate` (optional): Filter start date (ISO 8601)
+- `endDate` (optional): Filter end date (ISO 8601)
+
+### Response Formats
+
+#### Overview Endpoint
+```json
+{
+ "overview": {
+ "totalEvents": 15,
+ "totalRegistrations": 450,
+ "totalCheckins": 315,
+ "attendanceRate": 70.0,
+ "avgRating": 4.2,
+ "totalFeedback": 189
+ },
+ "trends": {
+ "events": 12.5,
+ "registrations": 8.3,
+ "attendance": -2.1,
+ "rating": 5.0
+ }
+}
+```
+
+#### Attendance Stats
+```json
+{
+ "data": [
+ {
+ "_id": "event123",
+ "title": "AI Workshop",
+ "type": "WORKSHOP",
+ "startDateTime": "2024-12-10T10:00:00Z",
+ "registrationCount": 50,
+ "attendanceCount": 42,
+ "attendanceRate": 84.0
+ }
+ ]
+}
+```
+
+## Data Privacy & Security
+
+- **Authentication Required**: All endpoints protected by JWT
+- **Role-Based Access**: Only authorized roles can access analytics
+- **Data Anonymization**: User PII not exposed in aggregations
+- **Audit Logging**: All analytics queries logged for compliance
+- **GDPR Compliant**: Data retention policies respected
+
+## Performance Optimization
+
+### Backend Optimizations
+- MongoDB indexes on frequently queried fields
+- Aggregation pipeline optimization
+- Caching strategies for expensive queries
+- Pagination support for large datasets
+
+### Frontend Optimizations
+- Parallel API requests with Promise.all
+- React memo for expensive components
+- Lazy loading for chart libraries
+- Responsive image handling
+
+## Troubleshooting
+
+### Common Issues
+
+1. **Empty Charts**
+ - Run seed script: `node scripts/seed_analytics.js`
+ - Check MongoDB connection
+ - Verify JWT token is valid
+
+2. **Slow Loading**
+ - Add database indexes (see analyticsEventModel.js)
+ - Reduce date range filter
+ - Check network tab for slow requests
+
+3. **Permission Denied**
+ - Verify user role (must be ADMIN, EVENTS_OFFICE, or PROFESSOR)
+ - Check JWT token expiration
+ - Review backend logs for authorization errors
+
+## Future Enhancements
+
+### Planned Features
+- [ ] PDF/Excel export functionality
+- [ ] Email scheduled reports
+- [ ] Real-time dashboard updates (WebSockets)
+- [ ] Custom date range presets (Last 7 days, Last month, etc.)
+- [ ] Event comparison tool (side-by-side)
+- [ ] Predictive analytics (ML-based attendance forecasting)
+- [ ] Mobile-responsive optimizations
+- [ ] Dark/Light theme toggle
+- [ ] Custom KPI widgets
+- [ ] Advanced filtering (multi-event, multi-faculty)
+
+### Potential Integrations
+- Google Analytics integration
+- Power BI/Tableau connectors
+- Slack/Teams notifications for anomalies
+- Calendar integration for automated reports
+
+## Contributing
+
+When adding new analytics features:
+
+1. **Backend**: Add new aggregation pipeline to `analyticsController.js`
+2. **Route**: Register endpoint in `routes/analytics.js`
+3. **Model**: Update `analyticsEventModel.js` if new event types needed
+4. **Frontend**: Create chart component in `AnalyticsDashboard.jsx`
+5. **Seed Data**: Update `seed_analytics.js` to generate test data
+6. **Documentation**: Update this README
+
+## License
+
+This analytics module is part of the Agora platform. Internal use only.
+
+## Support
+
+For issues or questions:
+- Backend: Check `backend/controllers/analyticsController.js` inline comments
+- Frontend: Review `frontend/src/pages/AnalyticsDashboard.jsx` component documentation
+- Seed Data: See `backend/scripts/seed_analytics.js` for data generation logic
+
+---
+
+**Built with ❤️ for data-driven decision making in university event management**
diff --git a/CERTIFICATE_FEATURE.md b/CERTIFICATE_FEATURE.md
new file mode 100644
index 00000000..0db44ab7
--- /dev/null
+++ b/CERTIFICATE_FEATURE.md
@@ -0,0 +1,139 @@
+# Workshop Certificate Feature
+
+## Overview
+Automated certificate generation system for workshop attendance with QR code verification.
+
+## Features
+
+### 1. Individual Certificate Download
+- **Available for:** Workshop events only
+- **When:** After workshop end date
+- **Who:** Students/Staff/TAs who registered and attended
+- **Access:** "My Registrations → Past" section → "Download Certificate" button
+
+### 2. Combined CV Export
+- **Feature:** Export all workshop certificates in one PDF
+- **Access:** "Export All Certificates" button in Past registrations section
+- **Format:**
+ - Cover page with total workshops count
+ - Table of contents
+ - Individual certificate page for each workshop
+
+### 3. Certificate Verification
+- **Public URL:** `/verify-certificate/{registrationId}`
+- **QR Code:** Embedded on each certificate
+- **Verification Shows:**
+ - Workshop name
+ - Student name
+ - Date range
+ - Campus location
+ - Issue date
+ - Issuer information
+
+## Certificate Design
+
+### Visual Elements
+- **Colors:** Gold (#d4af37, #e6c76a) and Indigo (#5b6bd5) matching app theme
+- **Layout:** A4 Landscape
+- **Branding:** "German University in Cairo" header
+- **Security:** QR code for verification (bottom left)
+- **Signature:** Authorized signature line (bottom right)
+- **Footer:** "This certificate verifies attendance." (small, bottom center)
+
+### Certificate Content
+- Workshop title (centered, prominent)
+- Student name (centered, highlighted)
+- Date range (formatted)
+- Faculty and campus location
+- List of instructors/professors
+- Unique certificate number
+- QR verification code
+
+## API Endpoints
+
+### Backend Routes (`/api/certificates`)
+
+#### `GET /api/certificates/registration/:registrationId`
+Generate and download certificate for a single workshop.
+- **Auth:** Required (user must own the registration)
+- **Response:** PDF file download
+
+#### `GET /api/certificates/cv`
+Generate combined CV with all workshop certificates.
+- **Auth:** Required
+- **Response:** PDF file download with all certificates
+
+#### `GET /api/certificates/verify/:registrationId`
+Verify certificate authenticity (public endpoint).
+- **Auth:** Not required
+- **Response:** JSON with certificate details
+
+#### `GET /api/certificates/available`
+List all available certificates for current user.
+- **Auth:** Required
+- **Response:** Array of certificates with metadata
+
+## Implementation Details
+
+### Backend
+- **PDF Generation:** PDFKit library
+- **QR Codes:** qrcode npm package
+- **Controller:** `backend/controllers/certificatesController.js`
+- **Utils:** `backend/utils/certificateGenerator.js`
+- **Routes:** `backend/routes/certificates.js`
+
+### Frontend
+- **Verification Page:** `frontend/src/pages/CertificateVerification.jsx`
+- **Integration:** Student/Staff/TA dashboards
+- **Icons:** lucide-react (Download, FileCheck)
+
+### Database
+- **Model:** Uses existing `Registration` model
+- **Tracking:** `certificateSentAt` field (timestamp when first generated)
+
+## Usage Examples
+
+### For Students
+1. Navigate to dashboard → "My Registrations" tab
+2. Scroll to "Past" section
+3. Find completed workshops (marked with "Workshop" badge)
+4. Click "Download Certificate" from dropdown menu
+5. PDF downloads automatically
+
+### For Verification
+1. Scan QR code on certificate
+2. Opens: `yourapp.com/verify-certificate/{registrationId}`
+3. Public page shows certificate details
+4. Validates authenticity against database
+
+## Configuration
+
+### Environment Variables
+```env
+FRONTEND_URL=http://localhost:5173 # Used for QR code verification URLs
+```
+
+### Certificate Number Format
+```
+GUC-{eventId}-{registrationId}
+Example: GUC-507F1F77-A1B2C3
+```
+
+## Notes
+
+- Certificates only available for `type: 'WORKSHOP'` events
+- Workshop must have ended (`endDate < now`)
+- Registration must be active (`status: 'REGISTERED'`)
+- Certificate generation is idempotent (tracks first generation time)
+- QR codes use error correction level 'M' for reliability
+- PDF files use A4 landscape for certificates, portrait for CV cover
+
+## Future Enhancements
+
+Potential additions:
+- Digital signatures
+- Blockchain verification
+- Email delivery on workshop completion
+- Certificate templates for different workshop types
+- Multi-language support
+- Certificate expiry/renewal system
diff --git a/GAMIFICATION_FEATURE.md b/GAMIFICATION_FEATURE.md
new file mode 100644
index 00000000..71bebf06
--- /dev/null
+++ b/GAMIFICATION_FEATURE.md
@@ -0,0 +1,381 @@
+# Gamification System - Implementation Guide
+
+## Overview
+Complete points, badges, and level-up system where users earn rewards for attending events and can redeem them for perks.
+
+## Features Implemented
+
+### 1. **Points System**
+Users earn points by:
+- **Attending Events:**
+ - Workshops: 50 points
+ - Trips: 75 points
+ - Conferences: 100 points
+ - Bazaars: 30 points
+ - Booth Setups: 40 points
+ - Gym Sessions: 20 points
+- **Engagement:**
+ - Submitting reviews: 10 points
+ - Adding comments: 5 points
+- **Streak Bonuses:**
+ - 3 events in a row: 20 points
+ - 5 events in a row: 50 points
+ - 10 events in a row: 100 points
+
+### 2. **Level System** (6 Levels)
+- **Level 1:** Newcomer (0+ points)
+- **Level 2:** Explorer (100+ points)
+- **Level 3:** Regular (300+ points)
+- **Level 4:** Enthusiast (600+ points)
+- **Level 5:** Champion (1000+ points)
+- **Level 6:** Legend (1500+ points)
+
+Users automatically level up when reaching point thresholds. Notifications are sent on level-up.
+
+### 3. **Badge System** (10 Badges)
+
+#### Attendance Badges:
+- **First Steps** 🎯 - Attended first event (COMMON, +25 points)
+- **Regular Attendee** ⭐ - Attended 5 events (RARE, +50 points)
+- **Social Butterfly** 🦋 - Attended 10 events (EPIC, +100 points)
+- **Campus Legend** 👑 - Attended 20 events (LEGENDARY, +200 points)
+
+#### Engagement Badges:
+- **Reviewer** 📝 - Submitted 5 reviews (COMMON, +50 points)
+- **Workshop Warrior** 🎓 - Attended 5 workshops (RARE, +75 points)
+- **Adventurer** 🗺️ - Attended 3 trips (EPIC, +100 points)
+
+#### Achievement Badges:
+- **Century Club** 💯 - Earned 100 points (RARE, +50 points)
+- **High Achiever** 🏆 - Earned 500 points (EPIC, +100 points)
+- **Streak Master** 🔥 - 5 event attendance streak (EPIC, +75 points)
+
+Badges are automatically awarded when requirements are met. Notifications are sent on badge earn.
+
+### 4. **Perks Marketplace**
+- Users can redeem points for loyalty partner perks
+- **Point costs:** 50-500 range
+- **Redemption limit:** Once per perk per user
+- **No expiration dates**
+- Unique redemption codes generated for each redemption
+- 10 sample loyalty partners created with various categories
+
+### 5. **Leaderboard**
+- Global rankings showing top users
+- Displays: rank, name, points, level, badge count
+- Shows current user's rank even if not in top 50
+- Medal emojis for top 3 (🥇🥈🥉)
+
+## Database Structure
+
+### New Models Created:
+
+#### **Badge Model** (`badgeModel.js`)
+```javascript
+{
+ name: String,
+ description: String,
+ icon: String,
+ category: String, // ATTENDANCE, ENGAGEMENT, ACHIEVEMENT
+ requirement: {
+ type: String, // EVENT_COUNT, POINTS_THRESHOLD, REVIEW_COUNT, STREAK
+ value: Number,
+ eventType: String // optional
+ },
+ pointsReward: Number,
+ rarity: String, // COMMON, RARE, EPIC, LEGENDARY
+ color: String,
+ isActive: Boolean
+}
+```
+
+#### **PerkRedemption Model** (`perkRedemptionModel.js`)
+```javascript
+{
+ user: ObjectId,
+ partner: ObjectId,
+ pointsCost: Number,
+ redemptionCode: String, // unique
+ status: String, // ACTIVE, USED, EXPIRED
+ usedAt: Date,
+ metadata: {
+ userName: String,
+ userEmail: String,
+ partnerName: String
+ }
+}
+```
+
+### Updated Models:
+
+#### **User Model** - Added gamification field:
+```javascript
+gamification: {
+ points: Number,
+ level: Number,
+ badges: [{
+ badgeId: ObjectId,
+ earnedAt: Date,
+ eventId: ObjectId
+ }],
+ pointsHistory: [{
+ amount: Number,
+ reason: String,
+ eventId: ObjectId,
+ reviewId: ObjectId,
+ createdAt: Date
+ }],
+ redeemedPerks: [{
+ partnerId: ObjectId,
+ redemptionId: ObjectId,
+ pointsSpent: Number,
+ redeemedAt: Date
+ }],
+ attendanceStreak: Number,
+ lastAttendanceDate: Date
+}
+```
+
+#### **LoyaltyPartner Model** - Added redemption fields:
+```javascript
+pointsCost: Number, // 50-500
+maxRedemptionsPerUser: Number, // default 1
+totalRedemptions: Number // tracking
+```
+
+## Backend Implementation
+
+### Controllers:
+
+#### **gamificationController.js**
+- `getUserStats()` - Get user's points, level, badges, streak
+- `getPointsHistory()` - Detailed points transaction history
+- `getLeaderboard()` - Global rankings with pagination
+- `getAllBadges()` - All available badges with earned status
+- `getUserBadges()` - User's earned badges
+- `getLevelInfo()` - Level thresholds and requirements
+
+#### **perkRedemptionController.js**
+- `getAvailablePerks()` - Perks with affordability info
+- `redeemPerk()` - Spend points to redeem a perk
+- `getUserRedemptions()` - User's redemption history
+- `validateRedemptionCode()` - Verify redemption codes
+- `markRedemptionUsed()` - Mark as used by vendor
+
+### Utilities:
+
+#### **gamificationHelpers.js**
+Core logic for:
+- Point calculation and awarding
+- Level calculation and progression
+- Badge requirement checking
+- Automatic badge awarding
+- Streak tracking
+- Event attendance point awarding
+
+### Routes:
+
+#### `/api/gamification`
+- `GET /stats` - User statistics
+- `GET /history` - Points history
+- `GET /leaderboard` - Global rankings
+- `GET /badges` - All badges
+- `GET /badges/user` - User's badges
+- `GET /levels` - Level information
+
+#### `/api/loyalty-partners/perks`
+- `GET /available` - Available perks
+- `POST /redeem/:partnerId` - Redeem perk
+- `GET /my-redemptions` - User's redemptions
+- `POST /validate-code` - Validate code
+- `PATCH /redemptions/:id/use` - Mark as used
+
+## Frontend Implementation
+
+### Pages Created:
+
+#### **GamificationDashboard.jsx** (`/progress`)
+- Overview of user's gamification stats
+- Points, level, badges, streak display
+- Level progress bar with percentage
+- Recent badges showcase
+- Points history timeline
+- Quick stats summary
+
+#### **Leaderboard.jsx** (`/leaderboard`)
+- Top 3 podium display
+- Full rankings list (top 50)
+- Current user's rank highlighted
+- Medal system for top 3
+- Level and badge count display
+
+#### **BadgesCollection.jsx** (`/badges`)
+- All badges grid view
+- Filter: All / Earned / Locked
+- Progress bar for collection completion
+- Rarity-based styling
+- Requirement descriptions
+- Category breakdown
+
+#### **PerksMarketplace.jsx** (`/perks`)
+- Two tabs: Available / Redeemed
+- Category-based color coding
+- Affordability indicators
+- Redemption code display
+- Success messages with codes
+- Locked perks with requirements
+
+### Components:
+
+#### **GamificationWidget.jsx**
+- Compact navbar widget
+- Shows: points, level, badge count
+- Dropdown with detailed stats
+- Quick links to all gamification pages
+- Level progress indicator
+
+### Routes Added:
+All gamification routes accessible to: STUDENT, STAFF, TA, PROFESSOR
+- `/progress` - Dashboard
+- `/leaderboard` - Rankings
+- `/badges` - Badge collection
+- `/perks` - Perks marketplace
+
+## Scripts
+
+### Seeding Dummy Data:
+
+#### **Run: `node backend/scripts/seed_gamification.js`**
+
+This script creates:
+1. **10 badges** (all requirements and rarities)
+2. **10 loyalty partners** (various categories, point costs 50-250)
+3. **Updates up to 50 users** with random gamification data:
+ - Points: 0-2000 (distributed across all levels)
+ - Levels: 1-6 based on points
+ - Random badges based on points
+ - Random attendance streaks
+ - Points history entries
+
+Distribution:
+- 40% users: 0-200 points (Levels 1-2)
+- 30% users: 200-600 points (Levels 2-4)
+- 20% users: 600-1200 points (Levels 4-5)
+- 10% users: 1200-2000 points (Levels 5-6)
+
+### Resetting Data:
+
+#### **Run: `node backend/scripts/reset_gamification.js`**
+
+This script:
+1. Deletes all badges
+2. Deletes all perk redemptions
+3. Resets all users' gamification data to zero
+
+## Integration with Existing Features
+
+### Automatic Points Awarding:
+
+To award points when a user attends an event, add this to your event attendance logic:
+
+```javascript
+const { awardEventAttendancePoints } = require('../utils/gamificationHelpers');
+
+// After confirming attendance:
+await awardEventAttendancePoints(userId, eventId, event.type);
+```
+
+### Awarding Review Points:
+
+Add to your review submission logic:
+
+```javascript
+const { awardPoints } = require('../utils/gamificationHelpers');
+
+// After review is saved:
+await awardPoints(userId, 10, 'Submitted event review', { reviewId });
+```
+
+### Notifications:
+
+The system automatically sends notifications for:
+- Level ups
+- Badge earning
+- Perk redemption
+
+Uses existing notification system via `notificationHelpers.js`
+
+## Testing the System
+
+### 1. Seed the database:
+```bash
+cd backend
+node scripts/seed_gamification.js
+```
+
+### 2. Check the data:
+- View badges at `/badges`
+- Check leaderboard at `/leaderboard`
+- Browse perks at `/perks`
+- See your progress at `/progress`
+
+### 3. Test redemption:
+- Users with enough points can redeem perks
+- Redemption codes are displayed
+- Points are deducted
+- Redemption appears in history
+
+### 4. Test badge earning:
+- Badges are automatically awarded based on activity
+- Notifications are sent when earned
+- Progress tracked in badge collection
+
+## Future Enhancements (Not Implemented)
+
+Potential additions you can build:
+- Special level unlocks/perks
+- Hidden/secret badges
+- Leaderboard filters (by faculty, role)
+- Periodic leaderboard resets
+- Perk expiration dates
+- Multiple redemptions per perk
+- Social features (share achievements)
+- Badge trading/gifting
+- Seasonal events/challenges
+- Team competitions
+- Achievement animations
+
+## Files Created/Modified
+
+### Backend (11 files):
+- ✅ `models/badgeModel.js` (new)
+- ✅ `models/perkRedemptionModel.js` (new)
+- ✅ `models/userModel.js` (modified)
+- ✅ `models/loyaltyPartnerModel.js` (modified)
+- ✅ `controllers/gamificationController.js` (new)
+- ✅ `controllers/perkRedemptionController.js` (new)
+- ✅ `routes/gamification.js` (new)
+- ✅ `routes/loyaltyPartners.js` (modified)
+- ✅ `utils/gamificationHelpers.js` (new)
+- ✅ `scripts/seed_gamification.js` (new)
+- ✅ `scripts/reset_gamification.js` (new)
+- ✅ `server.js` (modified)
+
+### Frontend (6 files):
+- ✅ `pages/GamificationDashboard.jsx` (new)
+- ✅ `pages/Leaderboard.jsx` (new)
+- ✅ `pages/BadgesCollection.jsx` (new)
+- ✅ `pages/PerksMarketplace.jsx` (new)
+- ✅ `components/GamificationWidget.jsx` (new)
+- ✅ `App.jsx` (modified)
+
+## Usage Tips
+
+1. **Navbar Integration**: Add `` to your main navbar component to display points/level
+2. **Dashboard Links**: Add quick links to gamification pages from user dashboards
+3. **Event Pages**: Show potential points earned on event detail pages
+4. **Profile Pages**: Display gamification stats in user profiles
+
+## Support
+
+The system is fully functional and ready to use. Run the seed script to populate test data and start exploring!
diff --git a/PAYMENT_AND_CERTIFICATES.md b/PAYMENT_AND_CERTIFICATES.md
new file mode 100644
index 00000000..0d6206cd
--- /dev/null
+++ b/PAYMENT_AND_CERTIFICATES.md
@@ -0,0 +1,244 @@
+# Payment Receipts and Attendance Certificates
+
+This document describes the automated email features for payment receipts and attendance certificates.
+
+## Payment Receipts
+
+### Overview
+When students, staff, TAs, or professors register for a **TRIP** event that has a price, they automatically receive a payment receipt via email.
+
+### Implementation Details
+
+#### Backend Changes
+
+1. **Registration Model** (`backend/models/registrationModel.js`)
+ - Added `paymentAmount: Number` - stores the amount paid
+ - Added `paidAt: Date` - stores the payment timestamp
+
+2. **Email Utility** (`backend/utils/mailer.js`)
+ - Added `sendEventPaymentReceiptEmail(userEmail, userName, eventDetails)` function
+ - Professional HTML email template with:
+ - Gradient header with "Payment Receipt" title
+ - Event details (title, type, amount, dates)
+ - Formatted payment amount in green
+ - Confirmation badge
+
+3. **Registration Controller** (`backend/controllers/registrationsController.js`)
+ - Modified `registerToEvent` function to:
+ - Check if event is a TRIP with a price > 0
+ - Store payment amount and timestamp in registration
+ - Send payment receipt email automatically
+ - Continue registration even if email fails (logged as error)
+
+### Email Template
+The payment receipt email includes:
+- Event title and type
+- Amount paid (displayed prominently in green)
+- Registration date
+- Event start date
+- Confirmation badge
+- Professional gradient design matching the application theme
+
+### Usage
+No manual action required. When a user registers for a paid trip:
+1. Registration is created
+2. Payment fields are populated
+3. Email is sent automatically
+4. User receives professional receipt in their inbox
+
+---
+
+## Attendance Certificates
+
+### Overview
+After a workshop ends, Events Office or Admin can send attendance certificates to all registered participants.
+
+### Implementation Details
+
+#### Backend Changes
+
+1. **Email Utility** (`backend/utils/mailer.js`)
+ - Added `sendAttendanceCertificateEmail(userEmail, userName, workshopDetails)` function
+ - Formal certificate-style HTML email template with:
+ - Large "Certificate of Attendance" header
+ - Participant name prominently displayed
+ - Workshop title and details
+ - Start/end dates and duration
+ - Instructor names
+ - "Attendance Verified" badge
+ - GUC branding
+
+2. **Events Controller** (`backend/controllers/eventsController.js`)
+ - Added `sendWorkshopCertificates` function to:
+ - Validate event is a workshop that has ended
+ - Fetch all registered participants
+ - Calculate workshop duration
+ - Send certificate email to each participant
+ - Return summary of successful/failed sends
+
+3. **Routes** (`backend/routes/events.js`)
+ - Added `POST /events/:id/send-certificates` endpoint
+ - Restricted to Events Office and Admin roles only
+
+### Certificate Template
+The attendance certificate email includes:
+- "German University in Cairo" branding
+- Certificate of Attendance header with gradient
+- Participant name (large, centered)
+- Workshop title (highlighted)
+- Start and end dates
+- Duration (calculated in days)
+- Instructor name(s)
+- "Attendance Verified" badge
+- Issuance date in footer
+
+### Usage
+
+#### Manual Trigger (Current Implementation)
+Events Office or Admin can send certificates after a workshop ends:
+
+```bash
+POST /events/:workshopId/send-certificates
+Headers:
+ Authorization: Bearer
+
+Response:
+{
+ "message": "Certificates sent: 15 successful, 0 failed",
+ "results": [
+ { "email": "student@guc.edu.eg", "status": "sent" },
+ ...
+ ]
+}
+```
+
+#### Validation
+- Only WORKSHOP events can have certificates
+- Workshop must have ended (endAt < current time)
+- Only Events Office or Admin can trigger
+- At least one registered participant must exist
+
+#### Future Enhancement Options
+You could add automated certificate sending by:
+1. Creating a cron job that runs daily
+2. Finding workshops that ended in the last 24 hours
+3. Automatically sending certificates to participants
+4. Logging results for admin review
+
+Example cron implementation (not included):
+```javascript
+// In a separate cron job file
+const cron = require('node-cron');
+
+// Run daily at 9 AM
+cron.schedule('0 9 * * *', async () => {
+ const yesterday = new Date(Date.now() - 24 * 60 * 60 * 1000);
+ const workshops = await Event.find({
+ type: 'WORKSHOP',
+ endAt: { $gte: yesterday, $lt: new Date() }
+ });
+
+ for (const workshop of workshops) {
+ // Call sendWorkshopCertificates logic here
+ }
+});
+```
+
+---
+
+## Testing
+
+### Testing Payment Receipts
+
+1. Create a TRIP event with a price:
+ ```json
+ {
+ "type": "TRIP",
+ "tripDetails": {
+ "price": 250,
+ "destination": "Alexandria"
+ },
+ ...
+ }
+ ```
+
+2. Register for the trip as a student/staff/TA/professor
+3. Check email inbox for payment receipt
+4. Verify registration in database has `paymentAmount` and `paidAt` fields
+
+### Testing Attendance Certificates
+
+1. Create a WORKSHOP event with past end date (for testing):
+ ```json
+ {
+ "type": "WORKSHOP",
+ "startAt": "2024-01-10T10:00:00Z",
+ "endAt": "2024-01-10T14:00:00Z",
+ ...
+ }
+ ```
+
+2. Register participants for the workshop
+3. Wait for workshop to end (or manually set endAt to past)
+4. As Events Office/Admin, send certificates:
+ ```
+ POST /events/:workshopId/send-certificates
+ ```
+5. Check participant email inboxes for certificates
+
+---
+
+## Email Configuration
+
+Ensure your `.env` file has the correct SMTP settings:
+
+```env
+SMTP_HOST=smtp.gmail.com
+SMTP_PORT=587
+SMTP_SECURE=false
+SMTP_USER=your-email@gmail.com
+SMTP_PASS=your-app-password
+MAIL_FROM="Agora Events "
+```
+
+For Gmail, use an [App Password](https://support.google.com/accounts/answer/185833) instead of your regular password.
+
+---
+
+## Error Handling
+
+### Payment Receipts
+- If email sending fails, registration still completes successfully
+- Error is logged to console but doesn't block the user
+- User can contact support for manual receipt
+
+### Certificates
+- Each participant's email is sent individually
+- If one fails, others continue
+- Response includes detailed status for each email
+- Failed emails are logged with error messages
+
+---
+
+## Security Considerations
+
+1. **Payment Receipts**: Automatically sent on registration - no additional permissions needed
+2. **Certificates**: Only Events Office and Admin can trigger certificate sending
+3. **Email Privacy**: Emails are sent individually (no CC/BCC lists exposed)
+4. **Data Validation**: All inputs are validated before processing
+5. **Error Handling**: Email failures don't expose sensitive information
+
+---
+
+## Future Enhancements
+
+1. **Payment Gateway Integration**: Replace automatic payment with actual payment processing
+2. **Payment Confirmation**: Add payment status (PENDING, PAID, REFUNDED)
+3. **Refund Receipts**: Send refund confirmation emails when canceling paid trips
+4. **Certificate Customization**: Allow admins to customize certificate templates
+5. **Automated Certificates**: Cron job to send certificates automatically after workshops end
+6. **Certificate Downloads**: Add PDF generation and attachment to emails
+7. **Attendance Tracking**: Track actual attendance vs registration for more accurate certificates
+8. **Multiple Professors**: Support multiple instructors for workshops
+9. **Certificate Numbering**: Add unique certificate IDs for verification
+10. **QR Code Verification**: Add QR codes to certificates for authenticity verification
diff --git a/UNIFIED_EVENT_CALENDAR_FEATURE.md b/UNIFIED_EVENT_CALENDAR_FEATURE.md
new file mode 100644
index 00000000..54bbc915
--- /dev/null
+++ b/UNIFIED_EVENT_CALENDAR_FEATURE.md
@@ -0,0 +1,285 @@
+# Unified Event Calendar Feature - Implementation Guide
+
+## Overview
+This document describes the implementation of the **Unified Event Calendar** feature for the Agora university event platform. This feature provides a centralized calendar view accessible to all user roles (Students, Staff, TAs, Professors, Events Office, Admins, and Vendors).
+
+## Features Implemented
+
+### 1. Backend Components
+
+#### Calendar Controller (`backend/controllers/calendarController.js`)
+- **Endpoint**: `GET /api/calendar/events`
+- **Functionality**:
+ - Fetches published events with dynamic filtering
+ - Supports filters: faculty, event type, mode (online/offline/hybrid), date range
+ - Returns events with color-coded type identifiers
+ - Automatically excludes events older than 3 months (unless overridden)
+
+#### Calendar Routes (`backend/routes/calendar.js`)
+- Protected route requiring authentication
+- Accessible to all logged-in users regardless of role
+
+#### Server Integration
+- Added calendar routes to `server.js`
+- Route prefix: `/api/calendar`
+
+### 2. Frontend Components
+
+#### Main Calendar Page (`frontend/src/pages/UnifiedEventCalendarPage.jsx`)
+- Full-page calendar view using `react-big-calendar`
+- Features:
+ - **Month and Week views** with toggle capability
+ - **Color-coded events** by type:
+ - Workshop: Blue (#3b82f6)
+ - Trip: Purple (#8b5cf6)
+ - Bazaar: Orange (#f97316)
+ - Conference: Green (#10b981)
+ - Booth Setup: Red (#ef4444)
+ - Gym Session: Pink (#ec4899)
+ - **Interactive events** - click to view details
+ - **Loading states** with spinner
+ - **Error handling** with retry capability
+ - **Custom styling** matching the dark theme aesthetic
+
+#### Calendar Filters (`frontend/src/components/CalendarFilters.jsx`)
+- Collapsible filter panel
+- Filter options:
+ - **Faculty**: All faculties or specific (MET, IET, DMET, etc.)
+ - **Event Type**: All types or specific (Workshop, Trip, Bazaar, etc.)
+ - **Mode**: All, Online, Offline, or Hybrid
+ - **Date Range**: Quick presets (This Month, Next 30 Days, Next 90 Days)
+- Active filter indicator
+- Clear all filters button
+
+#### Calendar Legend (`frontend/src/components/CalendarLegend.jsx`)
+- Visual reference for event type colors
+- Displays all event types with corresponding colors
+
+#### Event Details Modal (`frontend/src/components/CalendarEventModal.jsx`)
+- Opens when clicking calendar events
+- Displays:
+ - Event name with color-coded type badge
+ - Faculty (if applicable)
+ - Start and end date/time
+ - Location
+ - Mode (Online/Offline/Hybrid)
+- Actions:
+ - **View Event Page** - navigates to full event details
+ - **Add to Google Calendar** - opens Google Calendar with pre-filled event
+ - **Download ICS** - downloads .ics file for Outlook/iCal import
+- Keyboard accessible (ESC to close)
+- Click overlay to close
+
+### 3. Navigation Integration
+
+#### Sidebar Updates (`frontend/src/components/Sidebar.jsx`)
+- Added "Event Calendar" link to all role menus:
+ - Students
+ - Staff
+ - TAs
+ - Professors
+ - Events Office
+ - Admins
+ - Vendors
+- Uses calendar icon (FaCalendarAlt)
+- Route: `/calendar`
+
+#### Routing (`frontend/src/App.jsx`)
+- Added calendar route for all protected role sections
+- Route: `/calendar`
+- Component: `UnifiedEventCalendarPage`
+- Protected: Yes (requires authentication)
+- Accessible by: All roles
+
+## Dependencies Added
+
+### Frontend
+```json
+{
+ "react-big-calendar": "^1.x.x",
+ "date-fns": "^2.x.x"
+}
+```
+
+Installation:
+```bash
+cd frontend
+npm install react-big-calendar date-fns
+```
+
+### Backend
+No new dependencies required - uses existing Mongoose and Express setup.
+
+## API Documentation
+
+### GET /api/calendar/events
+
+**Authentication**: Required (JWT token)
+
+**Query Parameters**:
+- `startDate` (optional, ISO string): Filter events starting on or after this date
+- `endDate` (optional, ISO string): Filter events starting on or before this date
+- `faculty` (optional, string): Filter by faculty (or "ALL")
+- `type` (optional, string): Filter by event type (or "ALL")
+- `mode` (optional, string): Filter by mode - "online", "offline", "hybrid", or "ALL"
+
+**Response**:
+```json
+{
+ "success": true,
+ "events": [
+ {
+ "_id": "event123",
+ "name": "AI Workshop",
+ "type": "WORKSHOP",
+ "faculty": "MET",
+ "mode": "OFFLINE",
+ "startDate": "2025-12-15T10:00:00.000Z",
+ "endDate": "2025-12-15T12:00:00.000Z",
+ "location": "GUC_CAIRO",
+ "colorKey": "blue",
+ "createdBy": "user456"
+ }
+ ]
+}
+```
+
+**Error Response**:
+```json
+{
+ "success": false,
+ "message": "Failed to fetch calendar events",
+ "error": "Error details"
+}
+```
+
+## Usage Instructions
+
+### For End Users
+
+1. **Access Calendar**:
+ - Log in to your dashboard
+ - Click "Event Calendar" in the sidebar menu
+
+2. **View Events**:
+ - Calendar loads with current month view
+ - Events are color-coded by type (see legend)
+ - Switch between Month/Week views using toolbar buttons
+
+3. **Filter Events**:
+ - Click "Filters" button
+ - Select desired faculty, event type, mode, or date range
+ - Clear filters with "Clear All" button
+
+4. **View Event Details**:
+ - Click any event on the calendar
+ - Modal opens with full details
+ - Click "View Event Page" for complete information
+ - Add to your personal calendar using Google/iCal buttons
+
+5. **Navigate Calendar**:
+ - Use "Today", "Back", "Next" buttons in toolbar
+ - Click month/week header to change view period
+
+### For Developers
+
+#### Extending Filters
+
+To add new filter options, modify:
+1. `CalendarFilters.jsx` - Add UI controls
+2. `calendarController.js` - Add query logic
+
+#### Adding New Event Types
+
+1. Update `EVENT_TYPES` in Event model
+2. Add color mapping in `calendarController.js` (getEventColorKey function)
+3. Update `LEGEND_ITEMS` in `CalendarLegend.jsx`
+4. Update `EVENT_COLORS` in `CalendarEventModal.jsx` and `UnifiedEventCalendarPage.jsx`
+
+#### Customizing Calendar Appearance
+
+Modify the `