Skip to content

SammyBoy-09/Event-Management-Mini-Project

Repository files navigation

πŸŽ“ CampusConnect Event Management App

A comprehensive full-stack event management system designed for college campuses, built with React Native (Expo) and Node.js + Express + MongoDB. Features include event creation, RSVP management, push notifications, QR code tickets, admin approval system, and real-time updates.

Version React Native Node.js MongoDB Push Notifications Android License

πŸ“‹ Table of Contents

✨ Features

🎨 Frontend Features (React Native + Expo)

Authentication & Authorization

  • πŸ“± Student registration with comprehensive validation
  • πŸ” Separate login for Students, Class Representatives (CR), and Admins
  • πŸ”‘ JWT token-based authentication with AsyncStorage
  • πŸšͺ Auto-login on app restart
  • πŸ”’ Secure password change functionality

Event Management

  • πŸ“‹ Browse all approved events with pull-to-refresh
  • πŸ” Search events by title, description, or organizer
  • 🏷️ Filter by category (Technical, Cultural, Sports, Workshop, etc.)
  • πŸ“… Calendar view with visual event markers
  • πŸ“ Create events with image upload, date/time pickers
  • ✏️ Edit/delete own created events
  • βœ… RSVP to events with capacity tracking
  • ❌ Cancel RSVP before event
  • πŸ‘₯ View attendee lists
  • πŸ“Š "My Events" - Track created events and RSVPs

Push Notifications

  • πŸ”” Firebase Cloud Messaging (FCM) v1 API integration
  • πŸ”” Automated event reminders (24 hours and 1 hour before)
  • πŸ“£ New event notifications
  • βœ… Event approval/rejection alerts
  • πŸ“’ Event update notifications
  • πŸ”• In-app notification center with read/unread status
  • βœ… Production-ready push notifications with google-services.json

QR Code System

  • 🎟️ Generate QR code tickets for registered events
  • πŸ“Έ Scan QR codes for attendance marking (Admin/CR)
  • ✨ Visual ticket modal with event details

User Profile & Settings

  • πŸ‘€ View and edit profile information
  • πŸ“ž Update contact details
  • πŸ” Change password securely
  • πŸ”” Manage push notification tokens
  • βš™οΈ Settings screen with notification preferences
  • πŸ§ͺ Test notification feature for debugging
  • πŸ”’ Privacy controls and app preferences

Admin/CR Panel

  • ⚑ Event approval dashboard
  • βœ… Approve pending events
  • ❌ Reject events with reason
  • πŸ“Š Event statistics (pending, approved, rejected)
  • πŸ“Έ QR scanner for attendance
  • πŸ‘₯ View all registered users

UI/UX

  • 🎨 Modern, polished interface with consistent theme
  • 🌈 Centralized color palette and typography
  • πŸ’« Smooth animations and transitions
  • ⏳ Loading states with ActivityIndicator
  • ❗ User-friendly error messages
  • πŸ“± Responsive design for all screen sizes
  • πŸ”„ Pull-to-refresh on all list screens
  • πŸ–ΌοΈ Image preview and caching

Sharing & Integration

  • πŸ“€ Share event details via native share sheet
  • πŸ—ΊοΈ Open event location in Maps app
  • πŸ“§ Contact organizer via email/phone

πŸ–₯️ Backend Features (Node.js + Express + MongoDB)

API & Architecture

  • ⚑ RESTful API with 35+ endpoints
  • πŸ—οΈ MVC architecture (Models, Controllers, Routes)
  • πŸ” JWT middleware for protected routes
  • πŸ›‘οΈ Role-based access control (Student, CR, Admin)
  • βœ… Comprehensive input validation
  • ❌ Centralized error handling
  • 🌐 CORS enabled for cross-origin requests

Database (MongoDB Atlas)

  • πŸ“Š 3 main collections (Students, Events, Notifications)
  • πŸ”— Mongoose ODM with schema validation
  • πŸ” Indexed fields for faster queries
  • πŸ—‘οΈ Auto-delete old notifications (30 days TTL)
  • πŸ“ˆ Population for referenced documents

Authentication & Security

  • πŸ” bcryptjs password hashing (10 salt rounds)
  • 🎫 JWT token generation and verification
  • ⏰ 30-day token expiration
  • 🚫 Protected routes with auth middleware
  • πŸ‘€ Role-based authorization checks

Event Management System

  • ✍️ CRUD operations for events
  • πŸ”„ Event approval workflow (pending β†’ approved/rejected)
  • πŸ‘₯ RSVP management with capacity tracking
  • 🚫 Prevent double RSVPs
  • βœ… Only admins/CRs can approve events
  • πŸ”” Notifications on event status changes

Push Notification Service

  • πŸ“± Expo Push Notifications with Firebase Cloud Messaging (FCM) v1 API
  • πŸ”₯ google-services.json configured for production builds
  • πŸ€– Automated reminders via cron jobs
  • ⏰ Hourly cron job checks upcoming events
  • πŸ“¬ Send notifications to all event attendees
  • πŸ”• Handle invalid/expired push tokens
  • βœ… Tested and working on physical devices

Cron Job Scheduler

  • ⏱️ Runs every hour (0 * * * *)
  • πŸ” Checks events in next 24 hours and 1 hour
  • πŸ“€ Sends push notifications via Expo
  • βœ… Tracks sent reminders (prevents duplicates)
  • πŸ“Š Logs notification sending status

Image Upload (Cloudinary)

  • πŸ“Έ Multer middleware for file handling
  • ☁️ Cloudinary CDN for image storage
  • πŸ–ΌοΈ Image optimization and transformation
  • πŸ”— Returns CDN URL for database storage

Notification System

  • πŸ“¬ In-app notification creation
  • πŸ”” Push notification sending
  • πŸ“Š Track read/unread status
  • πŸ—‘οΈ Auto-delete after 30 days
  • πŸ” Query by user and read status

Deployment (Render)

  • 🌐 Hosted on Render.com
  • πŸ”„ Auto-deploy on git push
  • πŸ“Š Environment variable management
  • πŸ“ˆ Health check endpoints
  • πŸš€ Production-ready configuration

🧩 Tech Stack

Frontend

  • React Native (0.72+) - Cross-platform mobile framework
  • Expo (SDK 49+) - Development platform and build tool
  • React Navigation (v6) - Stack, tab, and drawer navigation
  • Axios - HTTP client for API calls
  • AsyncStorage - Persistent local storage
  • Expo Vector Icons - 10,000+ icons (Ionicons)
  • Expo Notifications - Push notification handling
  • Expo Image Picker - Camera and gallery access
  • React Native Modal - Custom modal components
  • Date/Time Pickers - Native date/time selection

Backend

  • Node.js (18+) - JavaScript runtime
  • Express.js (4.18+) - Web application framework
  • MongoDB Atlas - Cloud NoSQL database
  • Mongoose (7.0+) - MongoDB object modeling
  • Render - Backend hosting platform (deployed)
  • jsonwebtoken - JWT generation and verification
  • bcryptjs - Password hashing with salt
  • dotenv - Environment variable management
  • cors - Cross-Origin Resource Sharing
  • multer - Multipart form-data handling
  • cloudinary - Cloud image storage and CDN
  • expo-server-sdk - Push notification sending
  • node-cron - Scheduled task automation

Cloud Services

  • MongoDB Atlas - Database hosting
  • Render - Backend API hosting
  • Cloudinary - Image CDN and storage
  • Firebase - Push notification infrastructure (FCM v1 API)
  • Expo - Push notification delivery and app builds

πŸ—οΈ Architecture

System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     Mobile Application                      β”‚
β”‚                    (React Native + Expo)                    β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Screens  β”‚  Components  β”‚  Navigation  β”‚  API Client       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                      β”‚ HTTP/HTTPS (Axios)
                      β”‚ JWT Auth Headers
                      β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   Backend API Server                        β”‚
β”‚                 (Node.js + Express.js)                      β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Routes  β”‚  Controllers  β”‚  Middleware  β”‚  Services         β”‚
β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
      β”‚           β”‚               β”‚                β”‚
      β–Ό           β–Ό               β–Ό                β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ MongoDB β”‚ β”‚Cloudinaryβ”‚  β”‚Expo Push APIβ”‚  β”‚  Cron Jobs  β”‚
β”‚  Atlas  β”‚ β”‚  (CDN)   β”‚  β”‚(Notif. Send)β”‚  β”‚ (Scheduler) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Data Flow

Authentication Flow:

  1. User registers/logs in β†’ Frontend sends credentials
  2. Backend validates β†’ Generates JWT token
  3. Token stored in AsyncStorage
  4. All subsequent requests include JWT in headers
  5. Middleware verifies token before processing

Event Creation Flow:

  1. User fills event form β†’ Image picked from gallery
  2. Image uploaded to Cloudinary β†’ URL received
  3. Event data + image URL β†’ Backend API
  4. Event saved to MongoDB with "pending" status
  5. Admin receives notification for approval
  6. Upon approval β†’ All users receive push notification

Push Notification Flow:

  1. User grants notification permissions β†’ Expo token generated
  2. Token sent to backend β†’ Stored in user profile
  3. Cron job runs hourly β†’ Checks upcoming events
  4. Notifications sent via Expo Push API β†’ User devices receive

Database Schemas

Student/User Schema

{
  _id: ObjectId,                    // MongoDB auto-generated ID
  name: {
    type: String,
    required: true,
    trim: true
  },
  email: {
    type: String,
    required: true,
    unique: true,
    lowercase: true
  },
  password: {
    type: String,
    required: true,
    minlength: 6                    // Hashed with bcryptjs
  },
  phone: {
    type: String,
    required: true
  },
  department: {
    type: String,
    required: true
  },
  year: {
    type: String,
    required: true                  // 1, 2, 3, 4
  },
  rollNumber: {
    type: String,
    required: true,
    unique: true
  },
  role: {
    type: String,
    enum: ['student', 'cr', 'admin'],
    default: 'student'
  },
  expoPushToken: {
    type: String,                   // Expo push notification token
    default: null
  },
  createdAt: {
    type: Date,
    default: Date.now
  },
  updatedAt: {
    type: Date,
    default: Date.now
  }
}

Event Schema

{
  _id: ObjectId,
  title: {
    type: String,
    required: true,
    trim: true,
    maxlength: 200
  },
  description: {
    type: String,
    required: true,
    minlength: 20
  },
  category: {
    type: String,
    required: true,
    enum: ['Technical', 'Cultural', 'Sports', 'Workshop', 'Seminar', 'Competition', 'Other']
  },
  date: {
    type: Date,
    required: true
  },
  time: {
    type: String,
    required: true                  // Format: "10:00 AM"
  },
  location: {
    type: String,
    required: true
  },
  organizer: {
    type: String,
    required: true
  },
  capacity: {
    type: Number,
    required: true,
    min: 1
  },
  image: {
    type: String,                   // Cloudinary URL
    default: null
  },
  attendees: [{
    type: mongoose.Schema.Types.ObjectId,
    ref: 'Student'
  }],
  createdBy: {
    type: mongoose.Schema.Types.ObjectId,
    ref: 'Student',
    required: true
  },
  status: {
    type: String,
    enum: ['pending', 'approved', 'rejected'],
    default: 'pending'
  },
  rejectionReason: {
    type: String,
    default: null
  },
  remindersSent: {
    day: { type: Boolean, default: false },    // 24h reminder sent
    hour: { type: Boolean, default: false }    // 1h reminder sent
  },
  createdAt: {
    type: Date,
    default: Date.now
  },
  updatedAt: {
    type: Date,
    default: Date.now
  }
}

Notification Schema

{
  _id: ObjectId,
  user: {
    type: mongoose.Schema.Types.ObjectId,
    ref: 'Student',
    required: true
  },
  title: {
    type: String,
    required: true
  },
  message: {
    type: String,
    required: true
  },
  type: {
    type: String,
    enum: ['event_approved', 'event_rejected', 'event_reminder', 'event_updated', 'new_event', 'rsvp_confirmation'],
    required: true
  },
  event: {
    type: mongoose.Schema.Types.ObjectId,
    ref: 'Event',
    default: null
  },
  read: {
    type: Boolean,
    default: false
  },
  createdAt: {
    type: Date,
    default: Date.now,
    expires: 2592000                // Auto-delete after 30 days
  }
}

Indexes:

  • Student: email (unique), rollNumber (unique)
  • Event: date, status, category, createdBy
  • Notification: user, createdAt, read

πŸ“š Libraries & Dependencies

Frontend Dependencies

{
  "@react-navigation/native": "^6.1.7",
  "@react-navigation/stack": "^6.3.17",
  "@react-navigation/bottom-tabs": "^6.5.8",
  "axios": "^1.4.0",
  "expo": "~49.0.0",
  "expo-image-picker": "~14.3.2",
  "expo-notifications": "~0.20.1",
  "react": "18.2.0",
  "react-native": "0.72.3",
  "react-native-modal": "^13.0.1",
  "@react-native-async-storage/async-storage": "1.18.2",
  "@expo/vector-icons": "^13.0.0"
}

Backend Dependencies

{
  "express": "^4.18.2",
  "mongoose": "^7.0.0",
  "bcryptjs": "^2.4.3",
  "jsonwebtoken": "^9.0.0",
  "dotenv": "^16.0.3",
  "cors": "^2.8.5",
  "multer": "^1.4.5-lts.1",
  "cloudinary": "^1.37.3",
  "expo-server-sdk": "^3.7.0",
  "node-cron": "^3.0.2"
}

πŸ“ Project Structure

app2/
β”œβ”€β”€ backend/                      # Node.js Backend
β”‚   β”œβ”€β”€ config/
β”‚   β”‚   └── database.js          # MongoDB connection setup
β”‚   β”œβ”€β”€ controllers/
β”‚   β”‚   β”œβ”€β”€ authController.js    # Authentication logic
β”‚   β”‚   β”œβ”€β”€ eventController.js   # Event CRUD operations
β”‚   β”‚   └── notificationController.js  # Notification handling
β”‚   β”œβ”€β”€ middleware/
β”‚   β”‚   └── authMiddleware.js    # JWT verification middleware
β”‚   β”œβ”€β”€ models/
β”‚   β”‚   β”œβ”€β”€ Student.js           # User/Student schema
β”‚   β”‚   β”œβ”€β”€ Event.js             # Event schema
β”‚   β”‚   └── Notification.js      # Notification schema
β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”œβ”€β”€ authRoutes.js        # Auth API endpoints
β”‚   β”‚   β”œβ”€β”€ eventRoutes.js       # Event API endpoints
β”‚   β”‚   └── notificationRoutes.js # Notification endpoints
β”‚   β”œβ”€β”€ .env                     # Environment variables
β”‚   β”œβ”€β”€ .gitignore
β”‚   β”œβ”€β”€ package.json
β”‚   β”œβ”€β”€ server.js                # Express server entry
β”‚   β”œβ”€β”€ createAdmin.js           # Admin creation script
β”‚   └── README.md
β”‚
β”œβ”€β”€ frontend/                     # React Native App
β”‚   β”œβ”€β”€ api/
β”‚   β”‚   └── api.js               # Axios API client
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ Button.js            # Custom button component
β”‚   β”‚   β”œβ”€β”€ InputField.js        # Form input component
β”‚   β”‚   β”œβ”€β”€ LoadingSpinner.js    # Loading indicator
β”‚   β”‚   └── QRTicketModal.js     # QR code modal
β”‚   β”œβ”€β”€ config/
β”‚   β”‚   └── environment.js       # API URL configuration
β”‚   β”œβ”€β”€ constants/
β”‚   β”‚   └── theme.js             # Colors, spacing, typography
β”‚   β”œβ”€β”€ screens/
β”‚   β”‚   β”œβ”€β”€ LandingPage.js       # Welcome screen
β”‚   β”‚   β”œβ”€β”€ LoginScreen.js       # Student login
β”‚   β”‚   β”œβ”€β”€ RegisterScreen.js    # Student registration
β”‚   β”‚   β”œβ”€β”€ AdminLoginScreen.js  # Admin/CR login
β”‚   β”‚   β”œβ”€β”€ DashboardScreen.js   # Main event listing
β”‚   β”‚   β”œβ”€β”€ EventDetailsScreen.js # Event details view
β”‚   β”‚   β”œβ”€β”€ CreateEventScreen.js # Event creation form
β”‚   β”‚   β”œβ”€β”€ ProfileScreen.js     # User profile
β”‚   β”‚   β”œβ”€β”€ NotificationsScreen.js # Notification list
β”‚   β”‚   β”œβ”€β”€ CalendarScreen.js    # Calendar view
β”‚   β”‚   β”œβ”€β”€ MyEventsScreen.js    # User's events
β”‚   β”‚   β”œβ”€β”€ AdminPanelScreen.js  # Admin dashboard
β”‚   β”‚   β”œβ”€β”€ QRScannerScreen.js   # QR scanner
β”‚   β”‚   └── SettingsScreen.js    # App settings
β”‚   β”œβ”€β”€ .gitignore
β”‚   β”œβ”€β”€ app.json                 # Expo configuration
β”‚   β”œβ”€β”€ eas.json                 # EAS Build configuration
β”‚   β”œβ”€β”€ package.json
β”‚   β”œβ”€β”€ App.js                   # Root component
β”‚   └── README.md
β”‚
β”œβ”€β”€ DOCS.md                      # Comprehensive documentation
β”œβ”€β”€ README.md                    # This file
β”œβ”€β”€ GETTING_STARTED.md          # Setup guide
β”œβ”€β”€ BUILD_APK_GUIDE.md          # Build instructions
└── ARCHITECTURE.md             # System architecture
    β”‚   └── api.js               # API configuration & methods
    β”œβ”€β”€ components/
    β”‚   β”œβ”€β”€ Button.js            # Custom button component
    β”‚   β”œβ”€β”€ InputField.js        # Custom input component
    β”‚   └── LoadingSpinner.js    # Loading component
    β”œβ”€β”€ constants/
    β”‚   └── theme.js             # Colors, typography, spacing
    β”œβ”€β”€ screens/
    β”‚   β”œβ”€β”€ LandingPage.js       # Welcome screen
    β”‚   β”œβ”€β”€ LoginScreen.js       # Login form
    β”‚   β”œβ”€β”€ RegisterScreen.js    # Registration form
    β”‚   └── HomeScreen.js        # Dashboard
    β”œβ”€β”€ .gitignore
    β”œβ”€β”€ App.js                   # Main app with navigation
    β”œβ”€β”€ app.json                 # Expo configuration
    β”œβ”€β”€ babel.config.js
    └── package.json

βš™οΈ Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js (v18 or higher) - Download
  • npm or yarn - Package manager
  • Git - Version control
  • Expo CLI - npm install -g expo-cli
  • Android Studio or Xcode (for mobile emulators)
  • MongoDB Atlas Account - Sign up

πŸš€ Installation

1. Clone the Repository

git clone <repository-url>
cd "Event Management/app2"

2. Install Backend Dependencies

cd backend
npm install

3. Install Frontend Dependencies

cd ../frontend
npm install

πŸ”§ Configuration

Backend Configuration

  1. Update .env file in backend/ directory:
# MongoDB Connection
MONGO_URI=mongodb+srv://samuel272lazar:root@123@cluster0.wpnllx4.mongodb.net/campusconnect?retryWrites=true&w=majority&appName=Cluster0

# JWT Secret Key (Change in production!)
JWT_SECRET=campusconnect_secret_key_2025_secure

# Server Configuration
PORT=5000
NODE_ENV=development

⚠️ Important: In production, use a strong, random JWT secret and secure MongoDB credentials.

Frontend Configuration

  1. Update API URL in frontend/api/api.js:
// For Android Emulator
const API_BASE_URL = 'http://10.0.2.2:5000/api';

// For iOS Simulator
const API_BASE_URL = 'http://localhost:5000/api';

// For Physical Device (replace with your computer's IP)
const API_BASE_URL = 'http://192.168.1.x:5000/api';

// For Production (Render deployment)
const API_BASE_URL = 'https://event-management-mini-project.onrender.com/api';

To find your IP address:

  • Windows: ipconfig in Command Prompt
  • Mac/Linux: ifconfig in Terminal
  1. Firebase Configuration (βœ… Already configured):
    • Firebase project: CampusConnect
    • Package name: com.campusconnect.app
    • google-services.json placed in frontend/ directory
    • FCM configured in app.json with notification permissions
    • Push notifications tested and working on physical devices

πŸƒ Running the Application

Start Backend Server

cd backend
npm start

You should see:

πŸš€ ==========================================
πŸš€ Server running in development mode
πŸš€ Server started on port 5000
πŸš€ API URL: http://localhost:5000
πŸš€ ==========================================
βœ… MongoDB Connected: cluster0.wpnllx4.mongodb.net
πŸ“Š Database: campusconnect

Start Frontend App

cd frontend
npm start

This will open Expo DevTools in your browser.

Run on Device/Emulator

  • Android: Press a or scan QR code with Expo Go app
  • iOS: Press i or scan QR code with Camera app
  • Web: Press w (limited functionality)

πŸ“‘ API Documentation

Base URL

Production: https://your-app.onrender.com/api
Development: http://localhost:5000/api

Authentication Endpoints

1. Register Student

POST /api/auth/register

Request Body:

{
  "name": "John Doe",
  "email": "john@college.edu",
  "password": "SecurePass123",
  "phone": "9876543210",
  "department": "Computer Science",
  "year": "2",
  "rollNumber": "CS2021001"
}

Response (201):

{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "user": {
    "id": "507f1f77bcf86cd799439011",
    "name": "John Doe",
    "email": "john@college.edu",
    "role": "student"
  }
}

2. Login (Student/Admin/CR)

POST /api/auth/login

Request Body:

{
  "email": "john@college.edu",
  "password": "SecurePass123"
}

3. Logout

POST /api/auth/logout
Authorization: Bearer <token>

4. Get Profile

GET /api/auth/profile
Authorization: Bearer <token>

5. Update Profile

PUT /api/auth/profile
Authorization: Bearer <token>
Content-Type: application/json

{
  "name": "John Updated",
  "phone": "9876543210",
  "department": "Computer Science"
}

6. Change Password

PUT /api/auth/change-password
Authorization: Bearer <token>

{
  "currentPassword": "OldPass123",
  "newPassword": "NewPass456"
}

7. Update Push Token

PUT /api/auth/push-token
Authorization: Bearer <token>

{
  "expoPushToken": "ExponentPushToken[xxxxxxxxxxxxxxxxxxxxxx]"
}

Event Endpoints

1. Get All Events (Approved)

GET /api/events
GET /api/events?category=Technical
GET /api/events?search=hackathon

2. Get Event by ID

GET /api/events/:id

3. Create Event

POST /api/events
Authorization: Bearer <token>
Content-Type: multipart/form-data

{
  "title": "Tech Fest 2025",
  "description": "Annual technical festival",
  "category": "Technical",
  "date": "2025-12-15",
  "time": "10:00 AM",
  "location": "Main Auditorium",
  "capacity": 200,
  "organizer": "CS Department",
  "image": <file>
}

4. Update Event

PUT /api/events/:id
Authorization: Bearer <token>

5. Delete Event

DELETE /api/events/:id
Authorization: Bearer <token>

6. RSVP to Event

POST /api/events/:id/rsvp
Authorization: Bearer <token>

7. Cancel RSVP

DELETE /api/events/:id/rsvp
Authorization: Bearer <token>

8. Get My Events (Created)

GET /api/events/my-events
Authorization: Bearer <token>

9. Get My RSVPs

GET /api/events/my-rsvps
Authorization: Bearer <token>

Admin Endpoints

1. Get Pending Events

GET /api/events/admin/pending
Authorization: Bearer <admin-token>

2. Approve Event

PUT /api/events/:id/approve
Authorization: Bearer <admin-token>

3. Reject Event

PUT /api/events/:id/reject
Authorization: Bearer <admin-token>

{
  "reason": "Does not meet guidelines"
}

4. Get All Users

GET /api/auth/admin/users
Authorization: Bearer <admin-token>

Notification Endpoints

1. Get User Notifications

GET /api/notifications
Authorization: Bearer <token>

2. Mark as Read

PUT /api/notifications/:id/read
Authorization: Bearer <token>

3. Mark All as Read

PUT /api/notifications/read-all
Authorization: Bearer <token>

4. Delete Notification

DELETE /api/notifications/:id
Authorization: Bearer <token>

Error Responses

400 Bad Request:

{
  "message": "Please provide all required fields"
}

401 Unauthorized:

{
  "message": "Not authorized, no token"
}

403 Forbidden:

{
  "message": "Not authorized as admin"
}

404 Not Found:

{
  "message": "Event not found"
}

500 Internal Server Error:

{
  "message": "Server error",
  "error": "Error details..."
}

🎨 Color Palette

The app uses a professional and modern color scheme:

Color Hex Code Usage
Primary Purple #6C63FF Primary buttons, headers
Coral Pink #FF6584 Accent elements
Teal #4ECDC4 Success states
Light Background #F8F9FE App background
White #FFFFFF Cards, surfaces
Dark Text #2D3748 Primary text
Light Text #A0AEC0 Secondary text

πŸ“± App Status & Testing

βœ… Production Ready

  • Backend deployed on Render and operational
  • MongoDB Atlas database connected
  • Push notifications configured with Firebase FCM
  • google-services.json integrated for Android builds
  • Tested successfully on physical Android devices
  • All core features working (authentication, events, notifications)

πŸ“Έ Key Screens

Landing Page

  • Welcome screen with animated features
  • Login and Register buttons

Login Screen

  • Email and password fields
  • Form validation
  • Role-based authentication

Register Screen

  • Comprehensive registration form
  • All student details (Name, USN, Email, etc.)
  • Dropdown selectors for Year, Semester, Gender, Department
  • Password strength validation

Home Screen

  • User profile card with statistics
  • Quick action buttons
  • Upcoming events section
  • Real-time event updates

Admin Panel

  • Event approval dashboard
  • User management
  • Event statistics
  • QR code scanner for attendance

πŸ” Security Features

  1. Password Hashing: bcryptjs with 10 salt rounds
  2. JWT Authentication: Secure token-based auth with 30-day expiration
  3. Input Validation: Comprehensive server-side and client-side validation
  4. CORS Protection: Configured for specific origins
  5. Environment Variables: Sensitive data in .env files
  6. Error Handling: No sensitive information exposed in error messages
  7. Firebase Security: google-services.json for secure push notifications
  8. Role-Based Access Control: Student, CR, and Admin authorization levels

πŸ§ͺ Testing

Test Registration

  1. Open the app
  2. Click "Create Account"
  3. Fill in all fields with valid data
  4. Submit and verify success

Test Login

  1. Use registered credentials
  2. Verify token storage
  3. Check automatic navigation to Home

Test Protected Routes

  1. Try accessing /api/auth/profile without token
  2. Verify 401 response
  3. Add valid token and verify success

🚧 Future Enhancements

Planned Features

  • Certificate Generation - Auto-generate participation certificates
  • Analytics Dashboard - Detailed event analytics and insights
  • Email Notifications - Nodemailer integration for email alerts
  • SMS Notifications - Twilio integration for SMS reminders
  • Social Media Integration - Share to Facebook, Twitter, LinkedIn
  • Event Feedback System - Post-event ratings and reviews
  • Attendance Tracking - QR code check-in/out system
  • Event Chat - Real-time chat for event attendees
  • Event Polls - Create polls for event attendees

UI/UX Improvements

  • Dark Mode - System-wide dark theme
  • Multi-language Support - i18n for regional languages
  • Offline Mode - Cache events for offline viewing
  • Advanced Filters - Filter by date range, location, etc.
  • Map Integration - Google Maps for event locations

Admin Features

  • Advanced Analytics - Charts and graphs for event data
  • Bulk Operations - Bulk approve/reject events
  • User Management - Ban/suspend users
  • Event Templates - Reusable event templates
  • Automated Reports - Weekly/monthly event reports
  • Role Management - Custom roles and permissions

Technical Improvements

  • GraphQL API - Replace REST with GraphQL
  • WebSocket - Real-time updates without polling
  • Redis Cache - Cache frequently accessed data
  • Microservices - Split into independent services
  • Docker - Containerize application
  • CI/CD Pipeline - Automated testing and deployment
  • Unit Tests - Jest/Mocha test coverage
  • API Rate Limiting - Prevent API abuse
  • CDN Integration - Faster static content delivery

🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

οΏ½ Building Android APK

Want to create an installable APK for distribution? Follow our comprehensive guide:

πŸ“– BUILD_APK_GUIDE.md - Complete APK building instructions

Quick Build Steps:

# Install EAS CLI (if not installed)
npm install -g eas-cli

# Navigate to frontend directory
cd frontend

# Login to Expo account
eas login

# Build production APK
eas build --platform android --profile production

# Download APK from Expo dashboard when complete
# https://expo.dev/accounts/YOUR_USERNAME/projects

Build Profiles:

  • development - Development build with debugging
  • preview - Preview APK for testing
  • production - Production-ready signed APK

Important Notes:

  1. Backend is deployed on Render - Production API is live
  2. Update frontend/config/environment.js with Render API URL
  3. Build typically takes 10-20 minutes
  4. APK will be available on Expo dashboard for download

Deployment Stack:

  • Backend Hosting: Render (https://render.com)
  • Database: MongoDB Atlas
  • Image Storage: Cloudinary CDN
  • Push Notifications: Expo Push API

πŸ“– BUILD_APK_GUIDE.md - Detailed build instructions
πŸ“– DOCS.md - Complete documentation

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ‘¨β€πŸ’» Author

Samuel Lazar (SammyBoy-09)
πŸ“§ Email: [Your Email]
πŸ”— GitHub: @SammyBoy-09
πŸ“¦ Repository: Event-Management-Mini-Project

πŸ™ Acknowledgments

  • React Native & Expo - Cross-platform mobile development
  • MongoDB Atlas - Cloud database hosting
  • Cloudinary - Image CDN and storage
  • Expo Push Notifications - Push notification service
  • Express.js Community - Backend framework
  • Open Source Contributors - All the amazing libraries

πŸ“ž Support & Documentation

For detailed guides and troubleshooting:

Need help? Open an issue in the GitHub repository!


Built with ❀️ for Campus Event Management
Last Updated: December 4, 2025

πŸŽ‰ Recent Updates (v1.0.3 - December 4, 2025)

  • βœ… Notification Config Fixed - Removed deprecated useNextNotificationsApi, updated to Android API 34
  • βœ… Backend Validation Updated - Removed 20-character minimum from event descriptions
  • βœ… UI Improvements - Moved test notification button to Settings screen for cleaner UX
  • βœ… Backend Health Endpoint - Added server warmup during splash screen for faster cold starts
  • βœ… Custom App Icon - Updated with professional branding (1024x1024)
  • βœ… Production Build v1.0.3 - All features tested and ready for deployment
  • βœ… Push Notifications - Working correctly in standalone APK builds with FCM
  • βœ… Auto-deploy - Backend updates automatically deploy to Render from GitHub

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors