How sai-deekshith-06/smart-campus-fine-track works
Project type and purpose
• This is a full-stack Flask web application called “Campus Fine Tracking System.”
• Purpose: allow administrators and students to submit, approve/reject, track, and manage campus fines, with automated email notifications and CLI tools for DB management.
File structure
• Top-level files:
• app.py – bootstrap and blueprint registration
• admin.py / student.py – Flask routes (controllers) for admin and student interfaces
• run.sh – startup script
• requirements.txt / .flaskenv – dependencies and environment config
• CLI to manage db/… – standalone Python scripts for populating and managing the MongoDB data
• Directories:
• templates/ – Jinja2 HTML templates (views) for admin_* and student_fines pages
• static/images/ – static assets (images)
• Data file: students.csv – batch import of student records via CLI
README insights
• Tech stack: Python 3.x, Flask, Flask-PyMongo, Flask-Mail, MongoDB, SMTP
• Features: separate admin/student interfaces, email notifications, secure session management
• Prerequisites / Setup: .flaskenv for MAIL_* and MONGO_URI, MongoDB running locally, SMTP server
a. Main components
1. Clients: Admin Browser, Student Browser
2. Web Server: Flask Application
• Subcomponents:
• Blueprints/Controllers (admin.py, student.py)
• Template Engine (templates/*.html)
• Static File Server (static/images)
• Configuration: .flaskenv (env vars for mail and DB)
• CLI Tools (manage_db.py, populate_students.py)
3. Data Store: MongoDB (finesdb)
4. External Service: SMTP Email Server
5. Optional: File storage for uploaded payment screenshots
b. Relationships and interactions
• HTTP(S) flow:
Admin/Student Browser → Flask App (routes) → business logic → MongoDB → Flask App → rendered HTML → Browser
• Email flow:
Flask App → Flask-Mail → SMTP Server → user inbox
• CLI flow (offline):
CLI scripts → connect to MongoDB → read/write student and fine category data
c. Architectural patterns
• MVC:
• Model: MongoDB collections accessed via Flask-PyMongo
• View: Jinja2 templates in templates/
• Controller: Flask route handlers in admin.py and student.py
• Modularization: two blueprints (admin vs student), plus a CLI module
• Configuration via environment variables for security and portability
d. Key technologies
• Flask (web framework)
• Flask-PyMongo (MongoDB integration)
• Flask-Mail (email notifications)
• Python-dotenv or .flaskenv (env var management)
• MongoDB (NoSQL database)
• SMTP (external email service)