b86bd0464122fd8864ff4f28ee690ced9d5cb056
📚 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
- ✨ Key Features
- 🎯 Project Architecture
- 🚀 Getting Started
- 🔧 Configuration
- 📦 Dependencies
- 🔐 Security Features
- 📊 Database Schema
- 🔌 API Endpoints
- 📱 Frontend Features
- 🔍 Testing
- 📈 Performance
- 🤝 Contributing
- 📄 License
💻 Tech Stack
🔥 Core Technologies
| Technology | Version | Purpose | Documentation |
|---|---|---|---|
| Python | 3.8+ | Backend Development | Python Docs |
| Django | 5.1.7 | Web Framework | Django Docs |
| Django REST Framework | 3.15.2 | 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 | Purpose | Documentation |
|---|---|---|
| Bootstrap | UI Framework | Bootstrap Docs |
| jQuery | DOM Manipulation | jQuery Docs |
| Firebase Web SDK | Real-time Updates | Firebase Web Docs |
🛠️ Development Tools
| Tool | Purpose | Documentation |
|---|---|---|
| Git | Version Control | Git Docs |
| WhiteNoise | Static File Serving | WhiteNoise Docs |
| PyOTP | OTP Generation | PyOTP Docs |
🖥️ Development Environment
| Component | Details |
|---|---|
| Operating System | Arch Linux |
| Window Manager | Hyprland |
| Status Bar | Modus |
| Editor | Neovim |
| Terminal | Kitty |
| Shell | Zsh |
✨ Key Features
👥 User Management
- Multi-role System: Admin, Staff, and Student interfaces
- Secure Authentication: OTP-based verification system
- Role-based Access Control: Granular permissions for each role
- User Profiles: Comprehensive user information management
📚 Academic Management
- Course Management: Create and manage courses and subjects
- Class Scheduling: Timetable generation and management
- Grade Management: Track and calculate student grades
- Exam Management: Schedule and conduct examinations
📊 Attendance System
- Real-time Tracking: Live attendance monitoring
- Automated Reports: Generate attendance reports
- Notification System: Alert for low attendance
- Bulk Operations: Manage multiple students at once
📝 Leave Management
- Online Applications: Digital leave request system
- Approval Workflow: Multi-level approval process
- Leave History: Track all leave records
- Automated Notifications: Status updates via email/SMS
🔐 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: Works on all devices
- Push Notifications: Real-time updates via Firebase
- Offline Support: Basic functionality without internet
- Mobile-first Approach: Optimized for mobile devices
🎯 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
🚀 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
- Create a Firebase project
- Download the service account key
- Place it as
firebase-key.jsonin the project root - Configure Firebase Web SDK in
static/js/firebase-config.js
6️⃣ Run Migrations
# Apply database migrations
python manage.py migrate
7️⃣ Create Superuser
# Create a superuser account
python manage.py createsuperuser
8️⃣ Run the Development Server
# Start the development server
python manage.py runserver
# The application will be available at:
# http://localhost:8000
📱 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
DB_PORT=3306
# Email (for OTP)
EMAIL_BACKEND=django.core.mail.backends.smtp.EmailBackend
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_USE_TLS=True
EMAIL_HOST_USER=your-email@gmail.com
EMAIL_HOST_PASSWORD=your-app-password
# Firebase
FIREBASE_DATABASE_URL=your-firebase-url
FIREBASE_TYPE=service_account
FIREBASE_PROJECT_ID=your-project-id
FIREBASE_PRIVATE_KEY_ID=your-private-key-id
FIREBASE_PRIVATE_KEY=your-private-key
FIREBASE_CLIENT_EMAIL=your-client-email
FIREBASE_CLIENT_ID=your-client-id
# Google Cloud
GOOGLE_CLOUD_PROJECT=your-google-cloud-project
GOOGLE_CLOUD_KEY_FILE=path/to/your/google-cloud-key.json
📦 Dependencies
Backend
- Django 5.1.7
- Django REST Framework
- Firebase Admin
- Google Cloud Storage
- PyOTP
- WhiteNoise
Frontend
- Bootstrap
- jQuery
- Firebase Web SDK
🔐 Security Features
Authentication
- OTP-based authentication
- Session management
- Password hashing
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,duration,duration_type(Year/Semester)
Subject
name,course(FK),semester_or_year,syllabus_pdf,files
Student
name,status,gender,birth_date,email,phone,addresses,marital_statusparent_name,parent_phone,citizenship_no,batches(M2M),imagecourse(FK),current_semester,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
Routine
course(FK),subject(FK),teacher(FK),start_time,end_timesemester_or_year,is_active
Attendance
date,routine(FK),teacher(FK),teacher_attend,class_status
Leave Management
Staff_leave:staff(FK),start_date,end_date,message,statusStudent_Leave:student(FK),start_date,end_date,message,status
Feedback System
StudentFeedback:student(FK),teacher(FK),rating,feedback_textInstituteFeedback:institute(FK),user(FK),feedback_type,rating,feedback_textStaffInstituteFeedback:institute(FK),staff(FK),feedback_type,rating,feedback_text
Course Tracking
student(FK),course(FK),enrollment_date,start_date,expected_end_dateactual_end_date,progress_status,completion_percentage,current_semestersemester_start_date,semester_end_date,notes
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 dashboardPOST /update-profile/- Update user profilePOST /change-password/- Change passwordPOST /teacher-update-profile-picture/- Update teacher profile picturePOST /teacher-change-password/- Change teacher 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 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
Firebase Integration
POST /saveFCMToken/- Save Firebase Cloud Messaging token
📱 Frontend Features
User Interface
- Responsive design
- Dark/Light mode
- Custom themes
- Accessibility support
Interactive Features
- Real-time updates
- File uploads
- Data visualization
Mobile Optimization
- Touch-friendly interface
- Offline support
- Push notifications
🔍 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
Monitoring
- Performance metrics
- Error tracking
- User analytics
- Resource usage
🤝 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
Commit Messages
- Use present tense
- Be descriptive
- Reference issues
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
Made with ❤️ by Sankalp
Description
A comprehensive Student Management System built with Django, featuring multi-role access, real-time notifications, and secure authentication.
backendcollege-managementdjangodjango-applicationdjango-frameworkdjango-projectprojectpythonsmsstudent-managementstudent-management-systemstudent-management-system-projectweb-app
Readme
GPL-3.0
1.6 MiB
0 Stars
1 Watchers
0 Forks