A comprehensive Enterprise Resource Planning (ERP) system for colleges built with React.js, Express.js, and Firebase. Features include student management, faculty management, admin controls, staff management, and QR code-based attendance tracking.
- Student dashboard with course overview
- QR code scanning for attendance marking
- View attendance records and statistics
- Grade viewing and academic progress tracking
- Profile management
- Faculty dashboard with course management
- Generate QR codes for attendance sessions
- View and manage student attendance
- Grade management and submission
- Student enrollment tracking
- Comprehensive admin dashboard
- User management (students, faculty, staff)
- Course creation and management
- System-wide reports and analytics
- Bulk operations and data management
- Staff dashboard with task management
- Time tracking and attendance
- Work schedule management
- Profile and task updates
- Real-time QR code generation for attendance sessions
- Mobile-friendly QR code scanning
- Automatic attendance marking with location tracking
- Session-based attendance with expiration times
- Comprehensive attendance reports and statistics
- React.js - User interface framework
- React Router - Client-side routing
- Axios - HTTP client for API calls
- React QR Code - QR code generation
- QR Scanner - QR code scanning functionality
- Express.js - Web application framework
- Firebase Admin SDK - Database and authentication
- Firebase Firestore - NoSQL database
- JWT - JSON Web Tokens for authentication
- bcryptjs - Password hashing
- QRCode - Server-side QR code generation
- UUID - Unique identifier generation
- Firebase Firestore - Cloud NoSQL database
- Firebase Authentication - User authentication service
- Firebase Storage - File storage (for future use)
erp/
├── src/
│ ├── backend/
│ │ ├── middleware/
│ │ │ └── auth.js # Authentication middleware
│ │ └── routes/
│ │ ├── authRoutes.js # Authentication routes
│ │ ├── studentRoutes.js # Student management routes
│ │ ├── facultyRoutes.js # Faculty management routes
│ │ ├── adminRoutes.js # Admin management routes
│ │ ├── staffRoutes.js # Staff management routes
│ │ └── attendanceRoutes.js # Attendance management routes
│ ├── components/
│ │ ├── common/
│ │ │ └── LoadingSpinner.jsx # Loading component
│ │ └── attendance/
│ │ └── QRScanner.jsx # QR code scanner component
│ ├── contexts/
│ │ └── AuthContext.jsx # Authentication context
│ ├── pages/
│ │ ├── auth/ # Authentication pages
│ │ ├── student/ # Student dashboard
│ │ ├── faculty/ # Faculty dashboard
│ │ ├── admin/ # Admin dashboard
│ │ ├── staff/ # Staff dashboard
│ │ └── ... # Other pages
│ ├── services/
│ │ └── api.js # API service layer
│ ├── config/
│ │ └── firebase.js # Firebase configuration
│ └── App.jsx # Main application component
├── server.js # Express server entry point
├── package.json # Dependencies and scripts
└── .env # Environment variables
- Node.js (v16 or higher)
- npm or yarn
- Firebase project with Firestore enabled
git clone <repository-url>
cd erpnpm install- Go to Firebase Console
- Create a new project
- Enable Firestore Database
- Enable Authentication (Email/Password)
- Go to Project Settings > General
- Scroll down to "Your apps" section
- Click on "Web app" and copy the config object
- Go to Project Settings > Service Accounts
- Click "Generate new private key"
- Download the JSON file
Create a .env file in the root directory:
# Firebase Web Configuration
VITE_FIREBASE_API_KEY=your_api_key_here
VITE_FIREBASE_AUTH_DOMAIN=your_project_id.firebaseapp.com
VITE_FIREBASE_PROJECT_ID=your_project_id
VITE_FIREBASE_STORAGE_BUCKET=your_project_id.appspot.com
VITE_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
VITE_FIREBASE_APP_ID=your_app_id
VITE_FIREBASE_MEASUREMENT_ID=your_measurement_id
# API Configuration
VITE_API_BASE_URL=http://localhost:5000/api
# Backend Configuration
PORT=5000
NODE_ENV=development
JWT_SECRET=your_super_secret_jwt_key_here
# Firebase Admin SDK Configuration
FIREBASE_PROJECT_ID=your_project_id
FIREBASE_PRIVATE_KEY_ID=your_private_key_id
FIREBASE_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\nyour_private_key\n-----END PRIVATE KEY-----\n"
FIREBASE_CLIENT_EMAIL=firebase-adminsdk-xxxxx@your_project_id.iam.gserviceaccount.com
FIREBASE_CLIENT_ID=your_client_id
FIREBASE_AUTH_URI=https://accounts.google.com/o/oauth2/auth
FIREBASE_TOKEN_URI=https://oauth2.googleapis.com/token
FIREBASE_AUTH_PROVIDER_X509_CERT_URL=https://www.googleapis.com/oauth2/v1/certs
FIREBASE_CLIENT_X509_CERT_URL=https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-xxxxx%40your_project_id.iam.gserviceaccount.comUpdate your Firestore security rules:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
// Users can read/write their own data
match /users/{userId} {
allow read, write: if request.auth != null && request.auth.uid == userId;
}
// Students collection
match /students/{studentId} {
allow read: if request.auth != null;
allow write: if request.auth != null &&
(request.auth.uid == studentId ||
get(/databases/$(database)/documents/users/$(request.auth.uid)).data.role in ['admin', 'faculty']);
}
// Faculty collection
match /faculty/{facultyId} {
allow read: if request.auth != null;
allow write: if request.auth != null &&
(request.auth.uid == facultyId ||
get(/databases/$(database)/documents/users/$(request.auth.uid)).data.role == 'admin');
}
// Staff collection
match /staff/{staffId} {
allow read: if request.auth != null;
allow write: if request.auth != null &&
(request.auth.uid == staffId ||
get(/databases/$(database)/documents/users/$(request.auth.uid)).data.role == 'admin');
}
// Courses collection
match /courses/{courseId} {
allow read: if request.auth != null;
allow write: if request.auth != null &&
get(/databases/$(database)/documents/users/$(request.auth.uid)).data.role in ['admin', 'faculty'];
}
// Attendance collections
match /attendance/{attendanceId} {
allow read, write: if request.auth != null;
}
match /attendance_sessions/{sessionId} {
allow read, write: if request.auth != null;
}
// Enrollments
match /enrollments/{enrollmentId} {
allow read, write: if request.auth != null;
}
// Allow admin full access
match /{document=**} {
allow read, write: if request.auth != null &&
get(/databases/$(database)/documents/users/$(request.auth.uid)).data.role == 'admin';
}
}
}# Start the backend server
npm run server:dev
# In another terminal, start the frontend
npm run dev# Build the frontend
npm run build
# Start the production server
npm run server- Frontend: http://localhost:5173 (development) or http://localhost:5000 (production)
- Backend API: http://localhost:5000/api
- Health Check: http://localhost:5000/api/health
The system includes demo accounts for testing:
| Role | Password | |
|---|---|---|
| Admin | admin@college.edu | admin123 |
| Faculty | faculty@college.edu | faculty123 |
| Student | student@college.edu | student123 |
| Staff | staff@college.edu | staff123 |
POST /api/auth/register- User registrationPOST /api/auth/login- User loginGET /api/auth/profile- Get user profilePUT /api/auth/profile- Update user profilePUT /api/auth/change-password- Change password
GET /api/students- Get all students (Admin)GET /api/students/:id- Get student by IDGET /api/students/:id/courses- Get student's coursesGET /api/students/:id/attendance- Get student's attendanceGET /api/students/:id/grades- Get student's grades
GET /api/faculty- Get all faculty (Admin)GET /api/faculty/:id- Get faculty by IDGET /api/faculty/:id/courses- Get faculty's coursesPOST /api/faculty/:id/courses- Create new courseGET /api/faculty/:id/students- Get faculty's students
POST /api/attendance/generate-qr- Generate QR code (Faculty)POST /api/attendance/mark-attendance- Mark attendance (Student)GET /api/attendance/sessions- Get attendance sessionsGET /api/attendance/statistics- Get attendance statistics
GET /api/admin/dashboard- Get admin dashboard dataGET /api/admin/users- Get all usersPUT /api/admin/users/:id/status- Update user statusGET /api/admin/reports- Get system reports
The QR code attendance system works as follows:
- Faculty generates QR code: Faculty selects a course and creates an attendance session with a specified duration
- QR code contains session data: The QR code includes session ID, course ID, timestamp, and other metadata
- Students scan QR code: Students use their mobile devices to scan the QR code through the web application
- Automatic attendance marking: The system verifies the session, checks enrollment, and marks attendance
- Real-time updates: Attendance counts are updated in real-time for faculty to monitor
- JWT-based authentication
- Role-based access control
- Password hashing with bcrypt
- Firebase security rules
- Input validation and sanitization
- CORS protection
- Rate limiting (can be added)
The application is fully responsive and works on:
- Desktop computers
- Tablets
- Mobile phones
- QR code scanning works on mobile devices with camera access
Update the following for production:
NODE_ENV=production
VITE_API_BASE_URL=https://your-domain.com/apinpm run buildThe built files will be in the dist directory. You can deploy to:
- Vercel
- Netlify
- Firebase Hosting
- Heroku
- AWS
- Any other hosting service
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License.
For support and questions:
- Create an issue in the repository
- Check the documentation
- Review the code comments
- Email notifications
- SMS integration
- Advanced reporting and analytics
- Mobile app (React Native)
- Offline support
- File upload and management
- Calendar integration
- Push notifications
- Multi-language support
- Dark mode theme