A complete, professional team management system for MPL 2K25 with proper authentication,.
- Complete User Authentication: JWT-based auth with role management (Admin, Mentor, Player)
- Multi-page Frontend: Professional navigation with Dashboard, Teams, Players, and Profile pages
- Team Management: Create, edit, and delete teams with logo selection
- Player Management: Add up to 10 players per team with detailed information
- Google Sheets Integration: Automatic data synchronization and backup
- Real-time Statistics: Live dashboard with team and player analytics
- Advanced Search & Filtering: Find teams and players quickly
- MongoDB Atlas Integration: Cloud database with proper models and relationships
- Role-based Access Control: Different permissions for different user types
- Data Export: Export teams and users data to CSV
- Responsive Design: Works perfectly on all devices
- Professional UI: Modern design with smooth animations and toast notifications
- Multi-page Architecture: Separate HTML files for Dashboard, Teams, Players, Profile
- Modern CSS: CSS Variables, Grid Layout, Flexbox, Animations
- JavaScript Modules: ES6+ with class-based architecture
- Font Awesome Icons: Professional icon set
- Inter Font Family: Modern typography
- Responsive Design: Mobile-first approach
- Node.js & Express.js: RESTful API server
- MongoDB with Mongoose: Database with proper models and relationships
- JWT Authentication: Secure token-based auth
- bcryptjs: Password hashing
- Google Sheets API: Data synchronization
- Helmet: Security headers
- Rate Limiting: API protection
- CORS: Cross-origin resource sharing
- Node.js (v14 or higher)
- MongoDB Atlas account
- Git
git clone <repository-url>
cd RMC-MPL25
# Backend
cd backend
npm install
# Frontend
cd ../frontend
npm installCreate backend/.env file:
PORT=5000
MONGO_URI=mongodb+srv://username:password@cluster.mongodb.net/mpl2k25?retryWrites=true&w=majority
FRONTEND_URL=http://localhost:8000
JWT_SECRET=your-super-secret-jwt-key-change-this-in-production# Terminal 1 - Backend
cd backend
npm start
# Terminal 2 - Frontend
cd frontend
npm start- Frontend: http://localhost:8000
- Backend API: http://localhost:5000
- Health Check: http://localhost:5000/health
- Full system access
- Manage all teams and players
- Manage user roles
- Google Sheets integration
- Data export
- Create and manage teams
- Add/edit/delete players
- View all teams and players
- View teams and players
- Update own profile
- Cannot create teams
POST /auth/register- Register new userPOST /auth/login- Login userGET /auth/profile- Get current user profilePUT /auth/profile- Update user profile
GET /teams- Get all teamsGET /teams/:id- Get team by IDPOST /teams- Create new team (mentor/admin only)PUT /teams/:id- Update team (mentor/admin only)DELETE /teams/:id- Delete team (admin only)
GET /admin/users- Get all users (admin only)PUT /admin/users/:id/role- Update user role (admin only)GET /admin/google-sheets/auth-url- Get Google Sheets auth URL (admin only)POST /admin/google-sheets/callback- Handle Google Sheets callback (admin only)
GET /health- Server health status
- Statistics overview (teams, players, users)
- Recent teams display
- Quick action cards
- Real-time data updates
- Team grid with search functionality
- Create/edit/delete teams
- Player management within teams
- Logo selection system
- All players view with filtering
- Table and grid view options
- Search by name, roll, department
- Player details modal
- Personal information management
- Password change functionality
- Created teams overview
- Admin panel (admin only)
{
username: String (unique, required),
email: String (unique, required),
password: String (hashed, required),
firstName: String (required),
lastName: String (required),
role: String (admin/mentor/player),
phone: String (optional),
rollNumber: String (optional),
department: String (optional),
section: String (optional),
year: String (1-4, optional),
isActive: Boolean (default: true),
lastLogin: Date,
googleSheetsId: String (optional)
}{
name: String (unique, required),
players: [PlayerSchema] (max 10),
logo: {
name: String,
emoji: String,
color: String
},
createdBy: ObjectId (ref: User),
isActive: Boolean (default: true),
googleSheetsRowId: String (optional)
}{
name: String (required),
phone: String (optional),
roll: String (optional),
department: String (optional),
section: String (optional),
year: String (1-4, optional)
}- Create a MongoDB Atlas account
- Create a new cluster
- Create a database user
- Whitelist your IP address
- Get the connection string
- Update the
MONGO_URIin your.envfile
The backend is configured to accept requests from http://localhost:8000 by default. Update the FRONTEND_URL in your .env file if needed.
-
MongoDB Connection Failed
- Check your MongoDB Atlas connection string
- Ensure your IP is whitelisted
- Verify your database user credentials
-
Authentication Issues
- Check JWT_SECRET is set in
.env - Verify token expiration settings
- Clear browser localStorage if needed
- Check JWT_SECRET is set in
-
CORS Errors
- Update
FRONTEND_URLin.env - Ensure frontend is running on the correct port
- Update
-
Google Sheets Not Working
- Verify credentials.json is in backend directory
- Check service account has access to the sheet
- Ensure Google Sheets API is enabled
-
Port Already in Use
- Change the
PORTin.env - Kill existing processes on the port
- Change the
- Use
npm run devfor backend auto-restart - Check browser console for JavaScript errors
- Use
/healthendpoint to verify server status - Check MongoDB Atlas dashboard for connection status
The application is fully responsive and works on:
- Desktop computers (1200px+)
- Tablets (768px - 1199px)
- Mobile phones (320px - 767px)
- JWT token authentication
- Password hashing with bcrypt
- Input validation and sanitization
- CORS protection
- Rate limiting
- Role-based access control
- Secure headers with Helmet
- Set up production MongoDB Atlas cluster
- Configure production environment variables
- Deploy to platforms like Heroku, Railway, or DigitalOcean
- Set up SSL certificates
- Build static files
- Deploy to platforms like Netlify, Vercel, or GitHub Pages
- Configure environment variables
- Set up custom domain
For detailed setup instructions, see SETUP_GUIDE.md
For support and questions:
- Check the troubleshooting section
- Review the API documentation
- Check browser console for errors
- Verify all environment variables are set correctly