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
π 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
.png)
Events page
.png)
Single event page
.png)
Download Android App page
.png)
Profile page (Logged In as a Board Member)
.png)
π― 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
-
π₯ Clone the repository
git clone https://github.com/MSP-Tech-Club-MIU/msp-miu-website.git cd msp-miu-website/main -
π¦ Install dependencies
npm run install:allThis will install dependencies for root, client, and server.
-
βοΈ Environment Configuration
Create a
.envfile 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 -
ποΈ Database Setup
Create a MySQL database and update the
.envfile with your database credentials. The application will automatically sync models on startup. -
π± Mobile App Setup (Optional)
For building the mobile app:
cd client npm install npx cap syncThis will sync the web app with native Android/iOS projects.
Note: The app includes
@capacitor/appplugin for Android back button handling. Make sure to runnpx cap syncafter 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
-
ποΈ Build the frontend:
npm run build -
π 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
/uploadsendpoint - 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 userPOST /api/auth/login- User loginPOST /api/auth/logout- User logoutPOST /api/auth/activate- Activate accountPOST /api/auth/verify-activation-token- Verify activation tokenPOST /api/auth/reset-password- Reset password with tokenPOST /api/auth/forgot-password- Request password reset email
Applications
POST /api/applications- Create applicationGET /api/applications- Get all applications (admin/board only)PUT /api/applications/:id/status- Update application statusPUT /api/applications/:id/comment- Update application commentDELETE /api/applications/:id- Delete application
Events
GET /api/events- Get all eventsGET /api/events/:id- Get event by IDPOST /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 eventPOST /api/events/:id/files- Upload file to event (admin/board/event-planning only)GET /api/events/:id/files- Get event filesDELETE /api/events/:id/files/:fileId- Delete event file
Attendance
POST /api/attendance/request- Submit attendance requestGET /api/attendance/requests- Get attendance requests (admin/board/event-planning only)PUT /api/attendance/requests/:id- Update attendance request statusGET /api/attendance/export- Export attendance to CSV
Members
- See
server/routes/members.jsfor member routes
Board
- See
server/routes/board.jsfor board routes
Users
GET /api/user/profile- Get current user profilePUT /api/user/profile- Update user profilePOST /api/user/profile/picture- Upload profile picturePOST /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 imagesGET /api/cloud/slides- Get slidesGET /api/cloud/videos- Get videosGET /api/cloud/documents- Get documentsGET /api/cloud/assets- Get assetsGET /api/cloud/assets/:type- Get assets by typeGET /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
- Create model in
server/models/ - Define routes in
server/routes/ - Implement controller in
server/controllers/ - Add associations in
server/models/index.js - Create frontend components in
client/src/ - 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/appplugin 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/appplugin - BackButton component is fixed-positioned and appears on all pages except Home
- Mobile app excludes DownloadAndroidApp page (only available on web)
π€ Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
π License
MIT License - See LICENSE file for details
π₯ Authors
MSP MIU Team
For more information, visit MSP MIU Website