How rishikumarrajvansh/college_management_system works
Project type and purpose
• This is a full-stack, monolithic Django web application called “College Management System.”
• It manages students, faculty, courses, attendance, examinations, fees, library, hostel, reporting, and user authentication, all within one Django project comprised of multiple reusable “apps.”
File structure
• Top-level directories:
• college_management_system/ – the Django project (settings, URLs, WSGI/ASGI)
• [attendance_management, course_management, examination, faculty_management, fee_management, hostel_management, library_management, reporting, student_management, user_authentication] – Django apps each with models.py, views.py, urls.py, migrations, templates and (sometimes) api_views.py
• templates/ – shared base templates and per-app template subfolders
• static/ – CSS, JS, images served via Django’s staticfiles
• tools/backup_database.py – standalone backup script
• requirements.txt, manage.py, db.sqlite3 (dev database)
• Architectural patterns:
• Standard Django MVC (Model-View-Template)
• Role-based authentication middleware
• AJAX API endpoints for Chart.js data (api_views.py in some apps)
• Centralized reporting app generating exports (PDF, Excel, CSV)
Key insights from README
• RESTful/AJAX endpoints deliver JSON for dynamic Chart.js dashboards.
• Uses PostgreSQL/MySQL in production, SQLite in dev.
• Recommends Redis caching, Gunicorn + Nginx in production, plus backup scripts, SSL with Certbot.
• Notification subsystem via a Notification model and AJAX polling.
Main components
a. Clients
– Web browser (desktop/mobile) interacting via HTTPS
– May also include scheduled cron job invoking backup_database.py
b. Web / Application Layer
– Nginx (or Apache) reverse proxy + static/media server
– Gunicorn (WSGI application server)
– Django project (WSGI entry point) loading:
• URL dispatcher → app-specific URL routers → view functions / class-based views
• Templates rendered server-side + JS assets for dynamic UI
• REST/AJAX endpoints (api_views) serving JSON for Chart.js
• Middleware (authentication, caching, security headers)
c. Business Logic Layer
– Individual Django apps (models ↔ views ↔ templates)
– Role-based access control modules in user_authentication
– Reporting & notification modules
d. Data Layer
– Primary relational database (PostgreSQL/MySQL) storing all models: User, Student, Faculty, Course, Attendance, Exam, FeeStructure, Payment, Book, BookIssue, Hostel, Room, Report, Notification, etc.
– Redis (optional) as Django cache backend + session store
e. External services
– SMTP mail server for notifications and password resets
– Cron / backup scripts writing SQL dump to backup storage
– Certbot/Let’s Encrypt for SSL
– (Optional) Monitoring agents (Monit)
Relationships and interactions
• Browser → HTTPS → Nginx
• GET / POST → static files served directly or forwarded to Gunicorn
• API calls (AJAX) → JSON responses
• Gunicorn → WSGI → Django URL router → app view → ORM → Database
• Django → Cache backend (Redis) for sessions and query caching
• Django → SMTP server for emails (password reset, notifications)
• Cron → backup_database.py → PostgreSQL dump → compressed backup storage
• Certbot → Nginx configuration → SSL termination
Architectural patterns / design principles
• Modularization by feature (one app per domain)
• MVC/MVT separation: models ↔ views ↔ templates
• Clear API layer for real-time dashboards
• Role-based access control enforced via middleware and decorators
• Use of Django ORM for database abstraction
• Client-side caching (browser) paired with server-side caching (Redis)
Diagramming conventions
• Green for client layer
• Blue for web/app layer
• Orange for business logic/apps
• Purple for data stores
• Gray for external services