Skip to content

A Flask web app for managing student attendance with secure login. Track daily presence/absence, manage student records, and export reports to Excel/PDF. Uses SQLAlchemy with migrations for database management, ready for deployment on Render.

License

Notifications You must be signed in to change notification settings

arpanpramanik2003/smart-attendence

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

51 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎯 Smart Attendance Management System

Live Demo Python Flask SQLite PostgreSQL HTML5 CSS3 JavaScript

πŸ“‹ Project Summary

A comprehensive web-based attendance management system built with Flask that enables educational institutions to efficiently track student attendance, manage student records, and generate detailed reports. The system provides a user-friendly interface for teachers and administrators to streamline the attendance tracking process with secure authentication and robust data management capabilities.

πŸš€ Key Highlights:

  • Modern web interface with responsive design
  • Secure user authentication system
  • Real-time attendance tracking and management
  • Comprehensive reporting with multiple export formats
  • Cloud deployment ready (Render/Heroku compatible)

✨ Features

πŸ” Secure Authentication

  • Role-based access control
  • Secure session management
  • Password protection with encryption
  • Default admin credentials: username: a, password: a

πŸ‘₯ Student Management

  • βž• Register new students with unique identifiers (UID)
  • πŸ—‘οΈ Remove students from the system
  • πŸ“Š View comprehensive student directories
  • πŸ” Search and filter student records
  • πŸ“ Edit student information

πŸ“… Daily Attendance Tracking

  • βœ… Mark attendance status (Present/Absent/Late)
  • πŸ“† Date-wise attendance management
  • ⏰ Timestamp tracking for attendance records
  • πŸ”„ Edit and update existing attendance records
  • πŸ“ˆ Real-time attendance statistics

πŸ“Š Advanced Reporting & Analytics

  • πŸ“ Export attendance data to Excel (.xlsx)
  • πŸ“„ Generate professional PDF reports
  • πŸ“‹ View detailed attendance history by date range
  • πŸ“ˆ Attendance percentage calculations
  • πŸ“Š Visual attendance analytics and insights

πŸ’Ύ Data Export Capabilities

  • Multiple export formats (Excel, PDF, CSV)
  • Customizable date range selection
  • Filtered export options
  • Professional report formatting

πŸ› οΈ Technology Stack

Backend

  • Framework: Python Flask 2.x
  • Database: SQLite (Development) / PostgreSQL (Production)
  • ORM: SQLAlchemy with Flask-SQLAlchemy
  • Migrations: Flask-Migrate (Alembic)
  • Authentication: Flask-Login

Frontend

  • Templating: Jinja2
  • Styling: CSS3 with Bootstrap components
  • JavaScript: Vanilla JS for interactivity
  • Responsive Design: Mobile-first approach

Data Processing & Reporting

  • Excel Export: Pandas + openpyxl
  • PDF Generation: WeasyPrint
  • Data Analysis: NumPy, Pandas

Deployment & DevOps

  • Cloud Platform: Render (Primary), Heroku (Alternative)
  • Database: PostgreSQL (Production)
  • Environment Management: python-dotenv

βš™οΈ Installation & Setup

Prerequisites

  • Python 3.8+ installed on your system
  • Git for version control
  • Virtual environment (recommended)

1. Clone the Repository

git clone https://github.com/arpanpramanik2003/smart-attendence.git
cd smart-attendence

2. Create Virtual Environment

# Create virtual environment
python -m venv attendance_env

# Activate virtual environment
# On Windows:
attendance_env\Scripts\activate

# On macOS/Linux:
source attendance_env/bin/activate

3. Install Dependencies

# Install required packages
pip install -r requirements.txt

# If requirements.txt doesn't exist, install manually:
pip install flask flask-sqlalchemy flask-migrate pandas openpyxl weasyprint

4. Environment Configuration

# Create .env file
touch .env

# Add the following variables to .env:
FLASK_APP=app.py
FLASK_ENV=development
SECRET_KEY=your-secret-key-here
DATABASE_URL=sqlite:///attendance.db

5. Database Setup

# Initialize database
flask db init
flask db migrate -m "Initial migration"
flask db upgrade

6. Run the Application

# Start the development server
flask run

# Or alternatively:
python app.py

The application will be available at http://localhost:5000

πŸš€ Deployment

Render Deployment (Recommended)

  1. Prepare for Deployment:

    # Ensure you have these files:
    # - requirements.txt
    # - Procfile (web: gunicorn app:app)
    # - runtime.txt (python-3.9.x)
  2. Database Configuration:

    • Set DATABASE_URL environment variable to PostgreSQL URL
    • Update database configurations for production
  3. Deploy on Render:

    • Connect your GitHub repository
    • Configure build and start commands
    • Set environment variables
    • Deploy automatically from main branch

Alternative Cloud Platforms

  • Heroku: Use Heroku Postgres add-on
  • Railway: Direct GitHub integration
  • PythonAnywhere: Manual file upload option

πŸ“– Usage Instructions

πŸ”‘ Admin Dashboard Access

  1. Navigate to the application URL
  2. Login with admin credentials:
    • Username: a
    • Password: a
  3. Access the main dashboard

πŸ‘¨β€πŸŽ“ Student Management

  1. Add New Student:

    • Click "Add Student" button
    • Enter student name and unique UID
    • Submit the form
  2. View Students:

    • Navigate to "Students" section
    • Browse through student directory
    • Use search functionality if needed
  3. Remove Student:

    • Find student in the directory
    • Click "Remove" button
    • Confirm the action

βœ… Attendance Marking

  1. Daily Attendance:

    • Select the current date
    • Choose students from the list
    • Mark Present/Absent status
    • Save attendance records
  2. Edit Attendance:

    • Navigate to specific date
    • Modify existing attendance records
    • Update and save changes

πŸ“Š Report Generation & Export

  1. Generate Reports:

    • Select date range
    • Choose report format (Excel/PDF)
    • Click "Generate Report" button
    • Download the generated file
  2. View Attendance History:

    • Navigate to "Reports" section
    • Filter by date, student, or class
    • View detailed attendance statistics

πŸ“ File Structure

smart-attendence/
β”œβ”€β”€ app.py                  # Main Flask application
β”œβ”€β”€ config.py               # Configuration settings
β”œβ”€β”€ requirements.txt        # Python dependencies
β”œβ”€β”€ Procfile               # Deployment configuration
β”œβ”€β”€ runtime.txt            # Python runtime version
β”œβ”€β”€ .env                   # Environment variables
β”œβ”€β”€ migrations/            # Database migration files
β”œβ”€β”€ static/                # Static files (CSS, JS, images)
β”‚   β”œβ”€β”€ css/
β”‚   β”œβ”€β”€ js/
β”‚   └── images/
β”œβ”€β”€ templates/             # HTML templates
β”‚   β”œβ”€β”€ base.html
β”‚   β”œβ”€β”€ login.html
β”‚   β”œβ”€β”€ dashboard.html
β”‚   β”œβ”€β”€ students.html
β”‚   β”œβ”€β”€ attendance.html
β”‚   └── reports.html
β”œβ”€β”€ models/                # Database models
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ student.py
β”‚   └── attendance.py
β”œβ”€β”€ routes/                # Application routes
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ auth.py
β”‚   β”œβ”€β”€ students.py
β”‚   └── attendance.py
└── utils/                 # Utility functions
    β”œβ”€β”€ __init__.py
    β”œβ”€β”€ export.py
    └── helpers.py

🀝 Contributing

We welcome contributions to improve the Smart Attendance Management System! Here's how you can contribute:

Getting Started

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make your changes with proper documentation
  4. Add tests for new functionality
  5. Commit changes: git commit -m 'Add amazing feature'
  6. Push to branch: git push origin feature/amazing-feature
  7. Open a Pull Request

Contribution Guidelines

  • πŸ“ Write clear commit messages
  • πŸ“‹ Update documentation for new features
  • πŸ§ͺ Add tests for new functionality
  • 🎨 Follow Python PEP 8 style guidelines
  • πŸ“± Ensure responsive design compatibility
  • πŸ” Test thoroughly before submitting PR

Areas for Contribution

  • 🌟 UI/UX improvements
  • πŸ”§ Performance optimizations
  • πŸ›‘οΈ Security enhancements
  • πŸ“Š Additional reporting features
  • 🌐 Internationalization support
  • πŸ“± Mobile app development

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

MIT License

Copyright (c) 2024 Arpan Pramanik

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

πŸ“ž Contact Information

πŸ‘¨β€πŸ’» Developer: Arpan Pramanik

πŸ“§ Email: [email protected]

πŸ’Ό LinkedIn: Connect with Arpan Pramanik

🐱 GitHub: @arpanpramanik2003

πŸ“± Portfolio: Visit Portfolio


πŸ™ Acknowledgments

  • Flask Community - For the excellent web framework and documentation
  • SQLAlchemy Team - For the powerful ORM capabilities
  • Bootstrap - For responsive design components
  • Open Source Community - For inspiration and code examples
  • Educational Institutions - For feedback and feature suggestions
  • Contributors - Thank you to all who have contributed to this project

Special Thanks

  • πŸŽ“ Educational Technology Community for valuable insights
  • πŸ”§ Flask Extension Developers for amazing tools
  • πŸ“š Documentation Writers for clear guides and tutorials
  • πŸ§ͺ Beta Testers for thorough testing and feedback

πŸ“ˆ Project Stats

GitHub stars GitHub forks GitHub issues GitHub license


🌟 If you found this project helpful, please consider giving it a star! 🌟

Made with ❀️ by Arpan Pramanik

About

A Flask web app for managing student attendance with secure login. Track daily presence/absence, manage student records, and export reports to Excel/PDF. Uses SQLAlchemy with migrations for database management, ready for deployment on Render.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published