MSP-MIU-Website β€œForked from the official MSP-MIU site

May 25, 2026 Β· View on GitHub

Official MSP-MIU Club Website - A full-stack platform for managing members, sessions, events, exercises, and leaderboards with role-based admin dashboards.

πŸ› οΈ Built With

React Node.js Express MySQL JavaScript Vite Sequelize JWT Capacitor Capacitor App

πŸš€ Tech Stack

Frontend

  • βš›οΈ React 18 - UI library
  • ⚑ Vite - Build tool and dev server
  • πŸ›£οΈ React Router - Client-side routing
  • 🎬 Framer Motion - Animation library
  • πŸ“‘ Axios - HTTP client
  • 🎨 React Icons - Icon library
  • πŸ“± Capacitor - Cross-platform mobile app framework (Android & iOS)
  • πŸ”™ Android Back Button - Native Android navigation handling

Backend

  • 🟒 Node.js - Runtime environment
  • πŸš‚ Express - Web framework
  • πŸ—„οΈ Sequelize - ORM for MySQL
  • 🐬 MySQL - Database
  • πŸ”‘ JWT - Authentication
  • πŸ”’ bcrypt - Password hashing
  • πŸ“€ Multer - File upload handling
  • πŸ“§ Nodemailer - Email functionality

πŸ“ Project Structure

Back-End/
β”œβ”€β”€ app.js                 # Main application entry point
β”œβ”€β”€ package.json           # Root package configuration
β”œβ”€β”€ client/                # React frontend application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/    # Reusable React components
β”‚   β”‚   β”‚   β”œβ”€β”€ BackButton.jsx                    # Navigation back button (fixed top-left)
β”‚   β”‚   β”‚   β”œβ”€β”€ AndroidBackButtonHandler.jsx       # Android back button handler component
β”‚   β”‚   β”‚   β”œβ”€β”€ AndroidBackButtonSetup.jsx         # Android back button setup component
β”‚   β”‚   β”‚   └── ...                                # Other components
β”‚   β”‚   β”œβ”€β”€ pages/         # Page components (all include BackButton)
β”‚   β”‚   β”œβ”€β”€ hooks/         # Custom React hooks
β”‚   β”‚   β”‚   └── useAndroidBackButton.js  # Android back button hook
β”‚   β”‚   β”œβ”€β”€ services/      # API service layer
β”‚   β”‚   β”œβ”€β”€ layoutpages/   # Layout components (Navbar, Footer)
β”‚   β”‚   β”œβ”€β”€ utils/         # Utility functions
β”‚   β”‚   β”‚   └── androidBackButton.js    # Android back button utilities
β”‚   β”‚   └── assets/        # Static assets (images, CSS)
β”‚   β”œβ”€β”€ android/           # Android native app (Capacitor)
β”‚   β”œβ”€β”€ ios/               # iOS native app (Capacitor)
β”‚   β”œβ”€β”€ capacitor.config.json  # Capacitor configuration
β”‚   └── package.json
β”œβ”€β”€ server/                # Express backend application
β”‚   β”œβ”€β”€ config/            # Configuration files
β”‚   β”‚   └── db.js          # Database configuration
β”‚   β”œβ”€β”€ controllers/       # Route controllers
β”‚   β”‚   β”œβ”€β”€ auth.js        # Authentication logic
β”‚   β”‚   β”œβ”€β”€ applications.js
β”‚   β”‚   β”œβ”€β”€ board.js
β”‚   β”‚   β”œβ”€β”€ members.js
β”‚   β”‚   └── user.js
β”‚   β”œβ”€β”€ middlewares/       # Express middlewares
β”‚   β”‚   └── auth.js        # JWT authentication middleware
β”‚   β”œβ”€β”€ models/            # Sequelize models
β”‚   β”‚   β”œβ”€β”€ Application.js
β”‚   β”‚   β”œβ”€β”€ Attendance.js
β”‚   β”‚   β”œβ”€β”€ Board.js
β”‚   β”‚   β”œβ”€β”€ Department.js
β”‚   β”‚   β”œβ”€β”€ Event.js
β”‚   β”‚   β”œβ”€β”€ Leaderboard.js
β”‚   β”‚   β”œβ”€β”€ Member.js
β”‚   β”‚   β”œβ”€β”€ PasswordToken.js
β”‚   β”‚   β”œβ”€β”€ Session.js
β”‚   β”‚   β”œβ”€β”€ Sponsor.js
β”‚   β”‚   β”œβ”€β”€ Suggestion.js
β”‚   β”‚   β”œβ”€β”€ User.js
β”‚   β”‚   └── index.js       # Model associations
β”‚   β”œβ”€β”€ routes/            # API routes
β”‚   β”‚   β”œβ”€β”€ auth.js
β”‚   β”‚   β”œβ”€β”€ applications.js
β”‚   β”‚   β”œβ”€β”€ board.js
β”‚   β”‚   β”œβ”€β”€ members.js
β”‚   β”‚   └── user.js
β”‚   β”œβ”€β”€ scripts/           # Utility scripts
β”‚   β”‚   β”œβ”€β”€ sendAcceptanceEmails.mjs
β”‚   β”‚   β”œβ”€β”€ sendActivationEmails.mjs
β”‚   β”‚   β”œβ”€β”€ sendBoardActivationEmails.mjs
β”‚   β”‚   └── MemberInsertion.js
β”‚   β”œβ”€β”€ utils/             # Utility functions
β”‚   β”‚   β”œβ”€β”€ email.mjs      # Email service
β”‚   β”‚   β”œβ”€β”€ jwt.js         # JWT utilities
β”‚   β”‚   β”œβ”€β”€ logger.js      # Logging utility
β”‚   β”‚   └── upload.js      # File upload utility
β”‚   β”œβ”€β”€ uploads/           # Uploaded files directory
β”‚   └── server.js          # Server route definitions
β”œβ”€β”€ scripts/               # Root-level scripts
β”‚   └── pdfparse.py        # PDF parsing utility
└── uploads/               # Root uploads directory

πŸ“· Screenshots

Landing page

Landing page screenshot

Events page

Events page screenshot

Single event page

Single event screenshot

Download Android App page

Download Android App screenshot

Profile page (Logged In as a Board Member)

Profile page screenshot

🎯 Features

  • πŸ” User Authentication: JWT-based authentication with account activation
  • πŸ‘₯ Member Management: Registration, applications, and member profiles
  • πŸŽ–οΈ Board Management: Board member profiles and department assignments
  • πŸ“… Event Management: Create and manage club events with file attachments
  • βœ… Session & Attendance: Track sessions and member attendance requests
  • πŸ† Leaderboard: Member ranking system
  • πŸ’‘ Suggestions: Member suggestion system
  • 🀝 Sponsors: Sponsor management
  • πŸ’ͺ Exercises: Exercise tracking and management
  • πŸŽ›οΈ Admin Dashboard: Role-based admin interface with application management
  • πŸ“¨ Email Notifications: Automated emails for activation, acceptance, etc.
  • πŸ“Ž File Uploads: Profile pictures and document uploads with cloud storage support
  • πŸ“± Mobile App: Native Android and iOS apps built with Capacitor
  • πŸ”™ Android Navigation: Native Android back button handling with modal/drawer support
  • πŸ“² Responsive Design: Fully responsive UI optimized for all screen sizes (mobile, tablet, desktop)
  • 🎨 Consistent Navigation: Back buttons on all pages with fixed top-left positioning
  • 🎯 Mobile-First UX: Optimized mobile experience with touch-friendly interactions

πŸ“‹ Prerequisites

  • 🟒 Node.js >= 18.0.0
  • πŸ“¦ npm >= 8.0.0
  • 🐬 MySQL database
  • πŸ“§ SMTP email server (for email functionality)
  • πŸ“± For Mobile Development:
    • Android: Android Studio with Android SDK (API level 24+)
    • iOS: Xcode 14+ (macOS only)
    • Capacitor CLI: npm install -g @capacitor/cli
    • Java JDK: Version 11 or higher (for Android)
    • Gradle: Included with Android project

βš™οΈ Installation

  1. πŸ“₯ Clone the repository

    git clone https://github.com/MSP-Tech-Club-MIU/msp-miu-website.git
    cd msp-miu-website/main
    
  2. πŸ“¦ Install dependencies

    npm run install:all
    

    This will install dependencies for root, client, and server.

  3. βš™οΈ Environment Configuration

    Create a .env file in the root directory with the following variables:

    # Server Configuration
    PORT=3000
    NODE_ENV=development
    
    # Database Configuration
    DB_HOST=localhost
    DB_PORT=3306
    DB_NAME=msp_miu_db
    DB_USER=your_db_user
    DB_PASS=your_db_password
    
    # JWT Configuration
    JWT_SECRET=your_jwt_secret_key
    
    # Email Configuration (SMTP)
    SMTP_HOST=smtp.gmail.com
    SMTP_PORT=587
    SMTP_SECURE=false
    SMTP_USER=your_email@gmail.com
    SMTP_PASS=your_email_password
    SMTP_FROM_NAME=MSP MIU Website
    
    # Website URLs
    WEBSITE_URL=http://localhost:3000
    FRONTEND_URL=http://localhost:5173
    
    # Cloud Storage (R2) - Optional, for file uploads and CDN
    R2_ACCOUNT_ID=your_r2_account_id
    R2_ACCESS_KEY_ID=your_r2_access_key
    R2_SECRET_ACCESS_KEY=your_r2_secret_key
    R2_BUCKET_NAME=your_bucket_name
    R2_PUBLIC_DOMAIN=https://your-r2-domain.com
    VITE_R2_PUBLIC_DOMAIN=https://your-r2-domain.com
    
    # Cloud Storage (R2) - Optional, for file uploads
    R2_ACCOUNT_ID=your_r2_account_id
    R2_ACCESS_KEY_ID=your_r2_access_key
    R2_SECRET_ACCESS_KEY=your_r2_secret_key
    R2_BUCKET_NAME=your_bucket_name
    R2_PUBLIC_DOMAIN=https://your-r2-domain.com
    VITE_R2_PUBLIC_DOMAIN=https://your-r2-domain.com
    
  4. πŸ—„οΈ Database Setup

    Create a MySQL database and update the .env file with your database credentials. The application will automatically sync models on startup.

  5. πŸ“± Mobile App Setup (Optional)

    For building the mobile app:

    cd client
    npm install
    npx cap sync
    

    This will sync the web app with native Android/iOS projects.

    Note: The app includes @capacitor/app plugin for Android back button handling. Make sure to run npx cap sync after installing dependencies to sync the plugin with native projects.

πŸƒ Running the Application

Development Mode

Run both frontend and backend concurrently:

npm run dev

This will start:

  • πŸ”§ Backend server on http://localhost:3000
  • 🎨 Frontend dev server on http://localhost:5173

Run Separately

πŸ”§ Backend only:

npm run dev:server

🎨 Frontend only:

npm run dev:client

Production Mode

  1. πŸ—οΈ Build the frontend:

    npm run build
    
  2. πŸš€ Start the server:

    npm start
    

πŸ“œ Available Scripts

Root Scripts

  • πŸš€ npm run dev - Run both client and server in development mode
  • πŸ”§ npm run dev:server - Run server in development mode with nodemon
  • 🎨 npm run dev:client - Run client in development mode
  • πŸ—οΈ npm run build - Build client for production
  • πŸ“¦ npm run build:client - Build client with dev dependencies
  • ▢️ npm start - Start production server
  • πŸ”§ npm run start:server - Start server only
  • πŸ“₯ npm run install:all - Install all dependencies
  • 🧹 npm run clean - Remove all node_modules
  • πŸš€ npm run deploy - Build and start production server
  • πŸ§ͺ npm test - Run client tests
  • πŸ” npm run lint - Lint client code

Server Scripts

  • πŸ“§ npm run send-activation-emails - Send account activation emails
  • βœ… npm run send-acceptance-emails - Send acceptance emails
  • πŸŽ–οΈ npm run send-board-activation-emails - Send board activation emails

πŸ—„οΈ Database Models

  • πŸ‘€ User - User accounts and authentication
  • πŸ‘₯ Member - Club members
  • πŸŽ–οΈ Board - Board members
  • 🏒 Department - Club departments
  • πŸ“ Application - Member applications
  • πŸ“… Event - Club events
  • πŸŽ“ Session - Training sessions
  • βœ… Attendance - Session attendance records
  • πŸ† Leaderboard - Member rankings
  • 🀝 Sponsor - Club sponsors
  • πŸ’‘ Suggestion - Member suggestions
  • πŸ”‘ PasswordToken - Password reset tokens

πŸ” Authentication

The application uses JWT (JSON Web Tokens) for authentication. Protected routes require a valid JWT token in the Authorization header:

Authorization: Bearer <token>

πŸ“§ Email Functionality

The application supports automated emails for:

  • Account activation
  • Acceptance notifications
  • Board activation
  • Password reset (if implemented)

Configure SMTP settings in the .env file to enable email functionality.

πŸ“ File Uploads

Uploaded files (profile pictures, documents, event files) are stored in:

  • Cloud Storage (R2): Primary storage for production (configured via environment variables)
  • Local Storage: server/uploads/ - Fallback for development
  • Files are served via CDN when R2 is configured, otherwise at /uploads endpoint
  • Supported file types: Images (PNG, JPG, JPEG, GIF, SVG), Documents (PDF, DOCX, PPTX), Videos, and more

πŸ”Œ API Routes

Authentication

  • POST /api/auth/register - Register new user
  • POST /api/auth/login - User login
  • POST /api/auth/logout - User logout
  • POST /api/auth/activate - Activate account
  • POST /api/auth/verify-activation-token - Verify activation token
  • POST /api/auth/reset-password - Reset password with token
  • POST /api/auth/forgot-password - Request password reset email

Applications

  • POST /api/applications - Create application
  • GET /api/applications - Get all applications (admin/board only)
  • PUT /api/applications/:id/status - Update application status
  • PUT /api/applications/:id/comment - Update application comment
  • DELETE /api/applications/:id - Delete application

Events

  • GET /api/events - Get all events
  • GET /api/events/:id - Get event by ID
  • POST /api/events - Create event (admin/board/event-planning only)
  • PUT /api/events/:id - Update event (admin/board/event-planning only)
  • DELETE /api/events/:id - Delete event (admin/board/event-planning only)
  • POST /api/events/:id/register - Register for event
  • POST /api/events/:id/files - Upload file to event (admin/board/event-planning only)
  • GET /api/events/:id/files - Get event files
  • DELETE /api/events/:id/files/:fileId - Delete event file

Attendance

  • POST /api/attendance/request - Submit attendance request
  • GET /api/attendance/requests - Get attendance requests (admin/board/event-planning only)
  • PUT /api/attendance/requests/:id - Update attendance request status
  • GET /api/attendance/export - Export attendance to CSV

Members

  • See server/routes/members.js for member routes

Board

  • See server/routes/board.js for board routes

Users

  • GET /api/user/profile - Get current user profile
  • PUT /api/user/profile - Update user profile
  • POST /api/user/profile/picture - Upload profile picture
  • POST /api/user/profile/schedule - Upload schedule file

File Uploads

  • POST /api/upload/:type - Upload files (images, documents) - admin/board only
  • Files are stored in cloud storage (R2) and served via CDN
  • Supported types: images, documents, videos, assets, etc.

Cloud Storage

  • GET /api/cloud/images - Get all images
  • GET /api/cloud/slides - Get slides
  • GET /api/cloud/videos - Get videos
  • GET /api/cloud/documents - Get documents
  • GET /api/cloud/assets - Get assets
  • GET /api/cloud/assets/:type - Get assets by type
  • GET /api/cloud/event-thumbnails - Get event thumbnails

πŸ› οΈ Development

Code Structure

  • Controllers: Handle business logic and database operations
  • Routes: Define API endpoints and middleware
  • Models: Define database schema and relationships
  • Middlewares: Handle authentication and request processing
  • Utils: Utility functions for common operations

Adding New Features

  1. Create model in server/models/
  2. Define routes in server/routes/
  3. Implement controller in server/controllers/
  4. Add associations in server/models/index.js
  5. Create frontend components in client/src/
  6. Add API calls in client/src/services/api.js

πŸ“± Mobile App Features

Android Back Button Handling

The app includes comprehensive Android back button handling:

  • Automatic Modal/Drawer Closing: Closes navigation drawer and login modal first
  • Navigation History: Navigates back through React Router history
  • App Exit: Exits app when on home page
  • Priority-Based Handlers: Components can register custom handlers with priorities
  • Capacitor Integration: Uses @capacitor/app plugin for native Android support

Setup:

cd client
npm install  # Installs @capacitor/app
npx cap sync  # Syncs with native projects

BackButton Component

All pages include a consistent BackButton component:

  • Fixed Position: Top-left corner, overlaying content
  • Responsive: Icon-only on mobile (≀480px), full button on larger screens
  • Consistent Styling: Same appearance across all pages
  • Smart Navigation: Navigates to appropriate page based on context

Responsive Design

The app is fully responsive with breakpoints:

  • Desktop: >1180px - Full navigation menu
  • Tablet: 680px-1180px - Collapsible menu
  • Mobile: 480px-680px - Mobile-optimized layouts
  • Small Mobile: <480px - Compact layouts, icon-only buttons

πŸ“ Notes

  • The application uses Sequelize for database operations
  • Database models are automatically synchronized on server start
  • File uploads use Multer for handling multipart/form-data
  • Email functionality requires SMTP configuration
  • JWT tokens are used for stateless authentication
  • Android back button handling requires @capacitor/app plugin
  • BackButton component is fixed-positioned and appears on all pages except Home
  • Mobile app excludes DownloadAndroidApp page (only available on web)

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

πŸ“„ License

MIT License - See LICENSE file for details

πŸ‘₯ Authors

MSP MIU Team


For more information, visit MSP MIU Website