📚 Student Management System (SMS)
A comprehensive Student Management System built with Django, featuring multi-role access, real-time notifications, and secure authentication.
📑 Table of Contents
- 💻 Tech Stack
- 👥 Role System
- ✨ Key Features
- 🎯 Project Architecture
- 🌍 Feasibility
- 🚀 Getting Started
- 🔧 Configuration
- 📦 Dependencies
- 🔐 Security Features
- 📊 Database Schema
- 🔌 API Endpoints
- 📱 Frontend Features
- 🔍 Testing
- 📈 Performance
- 🤝 Contributing
- 📄 License
- 🙏 Credits
- 🔄 Recent Improvements
💻 Tech Stack
🔥 Core Technologies
| Technology | Version | Purpose | Documentation |
|---|---|---|---|
| Python | 3.8+ | Backend Development | Python Docs |
| Django | 5.2 | Web Framework | Django Docs |
| Django REST Framework | 3.16.0 | API Development | DRF Docs |
| Firebase Admin | 6.7.0 | Real-time Features | Firebase Docs |
| Google Cloud Storage | 3.1.0 | File Storage | GCS Docs |
⚡ Frontend Technologies
| Technology | Version | Purpose | Documentation |
|---|---|---|---|
| Bootstrap | 5.3.0 | UI Framework | Bootstrap Docs |
| jQuery | Latest | DOM Manipulation | jQuery Docs |
| Firebase Web SDK | 9.22.0 | Real-time Updates | Firebase Web Docs |
| Font Awesome | 6.0.0 | Icons | Font Awesome Docs |
🛠️ Development Tools
| Tool | Version | Purpose | Documentation |
|---|---|---|---|
| Git | Latest | Version Control | Git Docs |
| WhiteNoise | 6.9.0 | Static File Serving | WhiteNoise Docs |
| PyOTP | 2.9.0 | OTP Generation | PyOTP Docs |
| Django Jazzmin | 3.0.1 | Admin Interface | Jazzmin Docs |
| Django Mathfilters | 1.0.0 | Math Operations | Mathfilters Docs |
| Django Model Utils | 5.0.0 | Model Utilities | Model Utils Docs |
🖥️ Development Environment
| Component | Details |
|---|---|
| Operating System | Arch Linux |
| Window Manager | Hyprland |
| Status Bar | Modus |
| Editor | Neovim |
| Terminal | Kitty |
| Shell | Zsh |
👥 Role System
🎓 User Roles and Permissions
| Role | Description | Key Features |
|---|---|---|
| Super Admin | System administrator with full access | - Full system control - User management - System configuration |
| HOD (Head of Department) | Department head with elevated privileges | - Course management - Staff supervision - Department analytics |
| Admission Officer | Handles student admissions | - Student registration - Document verification - Admission tracking |
| Teacher | Academic staff member | - Class management - Attendance tracking - Grade management |
| Student | Primary system user | - Course access - Attendance tracking - Grade viewing |
| Parent | Student guardian | - Student progress tracking - Communication with teachers - Fee management |
🔐 Authentication System
-
Multi-factor Authentication
- Phone-based OTP verification
- TOTP (Time-based One-Time Password)
- Password reset tokens
- Session management
-
Role-based Access Control
- Granular permissions per role
- Custom permission groups
- Access level restrictions
- Activity logging
✨ Key Features
👥 User Management
- Multi-role System: Comprehensive role hierarchy
- Secure Authentication: OTP and TOTP-based verification
- Role-based Access Control: Detailed permission system
- User Profiles: Complete user information management
📚 Academic Management
- Course Management: Create and manage courses
- Subject Management: Organize subjects with materials
- Class Scheduling: Advanced timetable system
- Grade Management: Comprehensive grading system
- Exam Management: Complete exam workflow
📊 Attendance System
- Real-time Tracking: Live attendance monitoring
- Automated Reports: Detailed attendance analytics
- Notification System: Real-time alerts
- Bulk Operations: Efficient batch processing
📝 Leave Management
- Multi-level Approval: Role-based approval workflow
- Leave History: Complete leave tracking
- Automated Notifications: Status updates
- Documentation: Leave record management
👨👩👧👦 Parent-Teacher Interaction
- Meeting Scheduling: Online/offline meeting management
- Progress Tracking: Student performance monitoring
- Communication: Direct messaging system
- Feedback System: Comprehensive feedback mechanism
📈 Course Progress Tracking
- Progress Monitoring: Real-time course progress
- Completion Tracking: Detailed completion metrics
- Performance Analytics: Student performance analysis
- Automated Updates: Progress notifications
🔄 Feedback System
- Multi-level Feedback: Student, parent, and staff feedback
- Rating System: Detailed rating mechanism
- Anonymous Feedback: Option for anonymous submissions
- Feedback Analytics: Comprehensive feedback analysis
🔐 Security Features
- OTP Verification: Two-factor authentication
- Session Management: Secure session handling
- CSRF Protection: Cross-site request forgery prevention
- XSS Protection: Cross-site scripting prevention
- SQL Injection Prevention: Secure database queries
📱 Mobile Features
- Responsive Design: Mobile-first approach
- Push Notifications: Real-time updates
- Offline Support: Basic functionality without internet
- Mobile Optimization: Touch-friendly interface
🎯 Project Architecture
SMS/
├── app/ # Main application
│ ├── admin/ # Admin interface
│ ├── api/ # REST API endpoints
│ ├── models/ # Database models
│ ├── views/ # View logic
│ └── templates/ # HTML templates
├── static/ # Static files
│ ├── css/ # Stylesheets
│ ├── js/ # JavaScript files
│ └── img/ # Images
├── media/ # User uploaded files
├── templates/ # Base templates
└── student_management_system/ # Project settings
🔄 Recent Improvements
🧹 Code Reorganization
- Reduced Redundancy: Consolidated duplicate code in view functions
- Improved Structure: Created common view utilities and helper functions
- Better Code Reuse: Implemented common handlers for common operations
- Standardized Response Format: Created consistent API response formats
⚡ Performance Optimizations
- Dependency Management: Updated and optimized package requirements
- Firebase Integration: Enhanced Firebase functionality and error handling
- View Efficiency: Reduced redundant database queries
- API Improvements: Standardized API response formats for better client handling
🔧 Technical Enhancements
- Role-based Access: Improved role verification with utility functions
- Error Handling: Better error detection and user feedback
- File Upload Handling: Centralized file upload handling with validation
- Password Security: Enhanced password strength validation
🧹 Code Cleanup
- Removed Print Statements: Eliminated unnecessary print debug statements
- Standardized Views: Consistent view behavior across the application
- Simplified Middleware: Streamlined HTTP error handling
- Better Exception Handling: More graceful error handling throughout the app
These improvements make the codebase more maintainable, easier to extend, and more efficient in its operation, while maintaining all the original functionality.
🚀 Getting Started
📋 Prerequisites
Before you begin, ensure you have the following installed:
- Python (3.8 or higher)
- Git
- Firebase Account (for notifications)
- Google Cloud Account (for storage)
🛠️ Installation Steps
1️⃣ Clone the Repository
# Clone the repository
git clone https://github.com/S4NKALP/Student-Management-System-In-Django.git
# Navigate to the project directory
cd Student-Management-System-In-Django
2️⃣ Set Up Virtual Environment
# Create a virtual environment
python -m venv venv
# Activate the virtual environment
# For Linux/Mac:
source venv/bin/activate
# For Windows:
.\venv\Scripts\activate
3️⃣ Install Dependencies
# Install Python dependencies
pip install -r requirements.txt
4️⃣ Configure Environment Variables
# Copy the example environment file
cp .env.example .env
# Edit the .env file with your settings
# Required settings:
# - SECRET_KEY
# - DEBUG
# - ALLOWED_HOSTS
# - Firebase credentials
# - Google Cloud credentials
5️⃣ Set Up Firebase
- Go to Firebase Console
- Create a new project or select an existing one
- Enable the following services:
- Authentication
- Cloud Firestore
- Cloud Storage
- Cloud Messaging
2️⃣ Service Account Key (firebase-key.json)
- In Firebase Console, go to Project Settings > Service Accounts
- Click "Generate New Private Key"
- Save the downloaded JSON file as
firebase-key.jsonin your project root - Add the file to
.gitignoreto prevent committing sensitive data:firebase-key.json
3️⃣ Firebase Configuration Files
-
Copy the example files and rename them:
# Copy Firebase config example cp static/js/firebase-config.example.js static/js/firebase-config.js # Copy Firebase messaging service worker example cp static/firebase-messaging-sw.example.js static/firebase-messaging-sw.js -
Update the configuration in both files with your Firebase project details:
- Replace
YOUR_API_KEYwith your Firebase API key - Replace
YOUR_PROJECT_IDwith your Firebase project ID - Replace other placeholder values with your actual Firebase configuration
- Replace
4️⃣ Firebase Cloud Messaging (FCM) Setup
- In Firebase Console, go to Project Settings > Cloud Messaging
- Generate a new Server Key
- Add the key to your
.envfile:FIREBASE_SERVER_KEY=your_server_key_here
5️⃣ Testing Firebase Setup
- Run the development server
- Open the browser console
- Check for any Firebase-related errors
- Test push notifications using the Firebase Console
📱 Accessing the Application
Once everything is set up, you can access:
- Admin Panel: http://localhost:8000/admin
- Main Application: http://localhost:8000
🚨 Troubleshooting Guide
🔧 Common Issues
- Firebase Setup: Ensure proper configuration in
firebase-config.jsandfirebase-key.json - Static Files: Run
python manage.py collectstaticif static files are not loading - Database Issues: Check database settings in
.envfile - OTP Not Working: Verify email settings in
.envfile
🔧 Configuration
Environment Variables
Create a .env file in the project root:
# Django Settings
DEBUG=True
SECRET_KEY=your-secret-key
ALLOWED_HOSTS=localhost,127.0.0.1
# Database
DB_NAME=sms_db
DB_USER=your_db_user
DB_PASSWORD=your_db_password
DB_HOST=localhost
# Firebase Settings
FIREBASE_CREDENTIALS=path/to/firebase-key.json
FIREBASE_DATABASE_URL=your-firebase-database-url
# Google Cloud Settings
GOOGLE_CLOUD_PROJECT=your-project-id
GOOGLE_CLOUD_CREDENTIALS=path/to/google-cloud-key.json
# Email Settings
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_USE_TLS=True
EMAIL_HOST_USER=your-email@gmail.com
EMAIL_HOST_PASSWORD=your-email-password
# SMS Configuration
SMS_API_KEY=your_sms_api_key_here
SMS_SENDER_ID=SMSSYS
# OTP Settings
OTP_EXPIRY=300 # OTP expiry time in seconds
📦 Dependencies
Backend
- Django 5.2
- Django REST Framework 3.16.0
- Firebase Admin 6.7.0
- Google Cloud Storage 3.1.0
- PyOTP 2.9.0
- WhiteNoise 6.9.0
- Django Jazzmin 3.0.1
- Django Mathfilters 1.0.0
- Django Model Utils 5.0.0
Frontend
- Bootstrap 5.3.0
- jQuery Latest
- Firebase Web SDK 9.22.0
- Font Awesome 6.0.0
🔐 Security Features
Authentication
- OTP and TOTP-based authentication
- Session management
- Password hashing
- Password reset tokens
Data Protection
- CSRF protection
- XSS prevention
- SQL injection prevention
- Input validation
- File upload security
📊 Database Schema
Core Models
Institute
name,phone,email,address,pan_no,reg_no,logo,description
Course
name,code,duration,duration_type,description,is_active
Subject
name,code,course,period_or_year,syllabus_pdf,files
Student
name,status,gender,birth_date,email,phone,addressesmarital_status,parent_name,parent_phone,citizenship_nobatches,image,course,current_period,joining_date,fcm_token
Staff
name,phone,designation,gender,birth_date,email,addressesmarital_status,parent_name,parent_phone,citizenship_no,passportimage,joining_date,fcm_token,course
Parent
name,phone,email,address,students,image,fcm_token
Routine
course,subject,teacher,start_time,end_time,period_or_year,is_active
Attendance
date,routine,teacher,teacher_attend,class_status
Leave Management
StaffLeave:staff,start_date,end_date,message,statusStudentLeave:student,start_date,end_date,message,status
Feedback System
StudentFeedback: Student feedback for teachersParentFeedback: Parent feedback for teachersInstituteFeedback: Student feedback for instituteStaffInstituteFeedback: Staff feedback for instituteParentInstituteFeedback: Parent feedback for institute
Course Tracking
student,course,enrollment_date,start_date,expected_end_dateactual_end_date,progress_status,completion_percentage,current_periodperiod_start_date,period_end_date,notes
Teacher-Parent Meeting
meeting_date,meeting_time,duration,status,agenda,notescancellation_reason,meeting_link,is_online
Security Models
TOTPSecret: OTP secret keysResetToken: Password reset tokens
🔌 API Endpoints
Authentication & Security
POST /password-reset/- Password reset optionsPOST /password-reset/phone/- Phone-based password resetPOST /password-reset/phone/verify/- Verify phone OTPPOST /password-reset/email/- Email-based password resetPOST /password-reset/email/verify/- Verify email codePOST /password-reset/set/- Set new passwordPOST /check-weak-password/- Password strength check
Dashboard & Profile
GET /dashboard/- Main dashboardGET /student-dashboard/- Student dashboardGET /teacher-dashboard/- Teacher dashboardGET /parent-dashboard/- Parent dashboardGET /hod-dashboard/- HOD dashboardGET /admission-officer-dashboard/- Admission officer dashboardPOST /update-profile/- Update user profilePOST /change-password/- Change password
Leave Management
POST /request-leave/- Request student leavePOST /request-staff-leave/- Request staff leavePOST /approve-student-leave/<int:leave_id>/- Approve student leavePOST /reject-student-leave/<int:leave_id>/- Reject student leavePOST /approve-staff-leave/<int:leave_id>/- Approve staff leavePOST /reject-staff-leave/<int:leave_id>/- Reject staff leave
Feedback System
POST /submit-feedback/- Submit general feedbackPOST /submit-institute-feedback/- Submit institute feedbackPOST /submit-staff-institute-feedback/- Submit staff institute feedbackPOST /submit-parent-feedback/- Submit parent feedbackPOST /submit-parent-institute-feedback/- Submit parent institute feedback
Subject & Course Management
GET /subject/<int:subject_id>/files/- Get subject filesGET /subject/<int:subject_id>/syllabus/- View subject syllabusGET /get-subjects/- Get all subjectsGET /get-teachers/- Get all teachersGET /get-course-duration/- Get course durationGET /get-subject-schedule/- Get subject schedulePOST /manage-subject-files/- Manage subject filesPOST /delete-subject-file/- Delete subject fileGET /get-teacher-subjects/- Get teacher's subjects
Attendance Management
POST /save-attendance/- Save attendanceGET /get-attendance-form/- Get attendance formGET /get-students/- Get student list
Notice Management
POST /add-notice/- Add new noticePOST /delete-notice/<int:notice_id>/- Delete notice
Parent-Teacher Meeting
POST /schedule-meeting/- Schedule a meetingPOST /update-meeting/<int:meeting_id>/- Update meeting detailsPOST /cancel-meeting/<int:meeting_id>/- Cancel a meetingGET /get-meetings/- Get all meetingsGET /get-upcoming-meetings/- Get upcoming meetings
Course Progress
GET /get-course-progress/<int:student_id>/- Get student's course progressPOST /update-course-progress/- Update course progressGET /get-progress-analytics/- Get progress analytics
Firebase Integration
POST /saveFCMToken/- Save Firebase Cloud Messaging token
🔐 Authentication System
OTP Verification
- Phone-based OTP verification
- OTP expiry management
- OTP resend functionality
- Secure OTP storage
📱 Frontend Features
User Interface
- Responsive design
- Dark/Light mode
- Custom themes
- Accessibility support
- Mobile-first approach
Interactive Features
- Real-time updates
- File uploads
- Data visualization
- Interactive forms
- Dynamic content loading
Mobile Optimization
- Touch-friendly interface
- Offline support
- Push notifications
- Mobile-specific layouts
- Gesture support
🔍 Testing
Current Test Coverage
- Unit Tests: Basic test structure in place
- API Tests: Endpoint testing framework available
- Integration Tests: Setup for comprehensive testing
Running Tests
# Run all tests
python manage.py test
# Run specific app tests
python manage.py test app
# Run with coverage
coverage run --source='.' manage.py test
coverage report
Test Areas
-
Authentication & Authorization
- OTP verification
- Password reset
- Role-based access
-
Data Management
- CRUD operations
- Data validation
- File handling
-
Business Logic
- Attendance calculation
- Leave approval workflow
- Course progress tracking
-
Integration
- Firebase messaging
- File storage
- Email/SMS notifications
📈 Performance
Optimization Techniques
- Database indexing
- Query optimization
- Caching
- Lazy loading
- Code minification
- Asset compression
- CDN integration
Monitoring
- Performance metrics
- Error tracking
- User analytics
- Resource usage
- API response times
🤝 Contributing
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
Code Style
- Follow PEP 8
- Use type hints
- Write docstrings
- Add comments
- Follow Django best practices
Commit Messages
- Use present tense
- Be descriptive
- Reference issues
- Follow conventional commits
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Credits
If you use this project in your work, please give credit where credit is due:
Student Management System
Created by Sankalp
GitHub: https://github.com/S4NKALP
📝 Citation
If you're using this project in an academic context, you can cite it as:
@software{StudentManagementSystem2025,
author = {Sankalp},
title = {Student Management System},
year = {2025},
publisher = {GitHub},
url = {https://github.com/S4NKALP/Student-Management-System-In-Django}
}
🤝 Acknowledgments
- Thanks to all contributors who have helped improve this project
- Special thanks to the open-source community for their valuable resources
- Appreciation to all users who have provided feedback and suggestions