Skip to content

Blank45-cmd/python_Project

Repository files navigation

πŸš€ Smart Campus Scheduler - Cyber Edition

A modern, futuristic university scheduling system built with Python Flask and featuring a cyber-styled interface. This comprehensive application provides real-time timetable management, conflict detection, and hall availability tracking for universities.

🌟 Features

🎨 Cyber-Styled Interface

  • Dark Theme: Sleek dark background with neon accents
  • Glassmorphism Effects: Modern glass-effect cards and components
  • Neon Colors: Cyber-blue, purple, pink, and green accent colors
  • Responsive Design: Works perfectly on desktop, tablet, and mobile
  • Smooth Animations: Hover effects, transitions, and loading animations

πŸ§‘β€πŸ« Teacher Timetable Management

  • Create Timetable Entries: Add new classes with full details
  • Edit/Delete Entries: Modify existing timetable entries
  • Advanced Conflict Detection:
    • Hall conflicts (same hall, overlapping times)
    • Faculty conflicts (teacher double-booked)
    • Student group conflicts (same class overlapping)
  • Calendar View: Visual weekly timetable display
  • Notes & Resources: Optional notes for each class entry
  • Real-time Updates: Instant updates across all users

πŸŽ“ Student Lecture Hall Availability

  • Multi-Time Slot Selection: Students select multiple free time slots
  • Real-Time Filtering:
    • Building selection
    • Minimum capacity requirements
    • Amenity filters (Projector, AC, Lab Equipment)
  • Live Status Updates: Real-time occupancy status
  • Detailed Information: Room details, capacity, amenities
  • Interactive Cards: Click for detailed hall information

πŸ“Š Advanced Analytics & Features

  • Usage Statistics: Most used halls, busiest faculty
  • Export Functionality: PDF and CSV export for reports
  • Search System: Global search across classes, teachers, halls
  • Real-Time Notifications: Schedule changes and booking confirmations
  • API Integration: RESTful APIs for all functionality

πŸ—οΈ Project Structure

Smart Campus Scheduler/
β”œβ”€β”€ app.py                    # Main Flask application
β”œβ”€β”€ requirements.txt          # Python dependencies
β”œβ”€β”€ templates/
β”‚   └── index.html           # Main frontend template
β”œβ”€β”€ timetable.csv            # Timetable data
β”œβ”€β”€ lecture_halls.csv        # Hall information
β”œβ”€β”€ hall_bookings.csv        # Booking data
β”œβ”€β”€ users.csv               # User accounts
└── notifications.csv       # System notifications

πŸš€ Quick Start

Prerequisites

  • Python 3.7+
  • pip (Python package manager)

Installation

  1. Clone or download the project files

  2. Navigate to the project directory:

    cd "path/to/Smart Campus Scheduler"
  3. Install dependencies:

    pip install -r requirements.txt
  4. Run the application:

    python app.py
  5. Open your browser and visit:

    http://127.0.0.1:5000/
    

🎯 How to Use

Timetable Management (Teachers)

  1. Navigate to "Manage Timetable" section

  2. Fill out the form:

    • Select Department and Semester
    • Choose Day and Time Slot
    • Enter Subject and Faculty name
    • Select Lecture Hall
    • Add optional Notes/Resources
  3. Submit the form - the system will check for conflicts automatically

  4. View results in the timetable table or calendar view

Hall Availability (Students)

  1. Navigate to "Available Halls" section
  2. Select your free time slots using checkboxes
  3. Click "Find Available Halls"
  4. Filter results by building, capacity, or amenities
  5. Click on halls for detailed information

Viewing Timetables

  1. Use the search bar to find specific classes
  2. Apply filters for department, semester, or faculty
  3. View in table format or calendar view
  4. Export data as CSV or PDF

πŸ”§ API Endpoints

Timetable Management

  • GET /api/timetable - Get all timetable entries
  • POST /api/timetable/create - Create new timetable entry
  • PUT /api/timetable/edit/<id> - Edit existing entry
  • DELETE /api/timetable/delete/<id> - Delete entry

Hall Availability

  • GET /api/available-halls - Get available halls for specific time
  • GET /api/available-halls-student - Get halls for student-selected slots
  • GET /api/halls - Get all lecture halls

Data Export

  • GET /api/export/timetable?format=csv - Export timetable as CSV
  • GET /api/export/timetable?format=pdf - Export timetable as PDF
  • GET /api/export/halls?format=csv - Export halls as CSV
  • GET /api/export/halls?format=pdf - Export halls as PDF

Analytics

  • GET /api/analytics - Get usage statistics
  • GET /api/search?q=<query> - Search across all data

🎨 Customization

Cyber Theme Colors

The application uses CSS custom properties for easy theme customization:

:root {
    --cyber-dark: #0a0a0f;      /* Main dark background */
    --cyber-blue: #00d9ff;      /* Primary accent color */
    --cyber-purple: #7b2cbf;    /* Secondary accent */
    --cyber-pink: #ff006e;      /* Highlight color */
    --cyber-green: #00ff88;     /* Success color */
}

Adding New Features

  • New API endpoints in app.py
  • Frontend components in templates/index.html
  • Styling in the CSS section
  • Data models in CSV files

πŸ“± Mobile Responsiveness

The application is fully responsive and optimized for all devices:

πŸ“ Breakpoint Coverage

  • Large Desktop (1200px+): Full 4-column layout with all features
  • Desktop (992px-1199px): 2-column layout with optimized spacing
  • Tablet (768px-991px): Stacked layout with touch-friendly elements
  • Mobile Large (576px-767px): Single column with essential features
  • Mobile Small (320px-575px): Compact layout for phones
  • Ultra Small (320px-): Optimized for smallest devices

πŸ“± Mobile Features

βœ… Touch-Friendly Interface - 44px minimum touch targets for accessibility
βœ… Responsive Tables - Horizontal scrolling for data tables on mobile
βœ… Mobile Navigation - Collapsible navbar with glassmorphism effects
βœ… Adaptive Forms - Stacked form layouts for easy mobile input
βœ… Touch-Optimized Buttons - Larger buttons for better mobile interaction
βœ… Print Optimization - Clean printing layouts for mobile and desktop
βœ… Landscape Support - Optimized layouts for mobile landscape mode
βœ… High DPI Support - Retina display optimizations

🎯 Mobile-Specific Enhancements

  • Smart Typography: Fluid font sizes using clamp() for perfect scaling
  • Touch Gestures: Smooth scrolling and touch interactions
  • Mobile-First CSS: Progressive enhancement from mobile to desktop
  • Performance Optimized: Minimal JavaScript for mobile devices
  • Battery Friendly: Reduced animations on mobile for better battery life

πŸ”’ Security Features

  • Input Validation: All form inputs are validated
  • Conflict Detection: Prevents scheduling conflicts
  • Data Sanitization: CSV data is properly escaped
  • Error Handling: Comprehensive error handling and user feedback

🚨 Troubleshooting

Common Issues

Application won't start:

  • Ensure all dependencies are installed: pip install -r requirements.txt
  • Check if port 5000 is available
  • Verify Python version (3.7+ required)

CSV files not found:

  • Ensure all CSV files are in the same directory as app.py
  • Check file permissions

Styling not loading:

  • Ensure templates/index.html exists and is properly formatted
  • Check browser console for JavaScript errors

πŸ“Š Sample Data

The application includes sample data for:

  • 10 Timetable Entries across different days and subjects
  • 10 Lecture Halls with varying capacities and amenities
  • 5 Hall Bookings for extra activities
  • 6 User Accounts (admin, teachers, students)
  • 5 Notifications for system events

πŸš€ Deployment Guide

❌ Netlify Deployment (Not Supported)

Important: This Flask application cannot be deployed directly to Netlify because:

  • Netlify is designed for static sites and serverless functions
  • Flask requires a Python runtime environment
  • Netlify does not support Python server-side applications

βœ… Recommended Deployment Platforms

1. Heroku (Free & Easy)

# Prerequisites
heroku --version
git --version

# Deploy to Heroku
git init
git add .
git commit -m "Initial commit"
heroku create your-unique-app-name
git push heroku main

2. Railway (Modern & Free) ⭐ RECOMMENDED

  1. Go to railway.app
  2. Create a new project
  3. Connect your GitHub repository
  4. Railway will auto-detect Python and deploy

Railway Configuration Files Created:

  • nixpacks.toml: Advanced Railway configuration with build and deploy settings
  • railway.toml: Alternative Railway configuration

Railway Deployment Features:

  • βœ… Automatic Python detection
  • βœ… Auto-scaling based on usage
  • βœ… Built-in database support (if needed later)
  • βœ… Custom domains and SSL
  • βœ… Environment variable management

3. Render (Free Tier Available)

  1. Go to render.com
  2. Create a new Web Service
  3. Connect your GitHub repository
  4. Build Command: pip install -r requirements.txt
  5. Start Command: gunicorn app:app

4. DigitalOcean App Platform

  1. Go to DigitalOcean
  2. Create a new App
  3. Choose GitHub integration
  4. Select Python runtime

πŸ—οΈ Deployment Files Created

The following deployment files have been created for you:

  • Procfile: Heroku deployment configuration
  • runtime.txt: Python version specification
  • netlify.toml: Netlify configuration (informational only)
  • .gitignore: Excludes unnecessary files from deployment
  • deploy.sh: Interactive deployment helper script

πŸ“‹ Deployment Checklist

Before deploying, ensure:

βœ… All CSV files are present (timetable.csv, lecture_halls.csv, etc.)
βœ… Python dependencies installed (pip install -r requirements.txt)
βœ… Git repository initialized (git init)
βœ… All files committed (git add . && git commit -m "message")
βœ… Choose appropriate deployment platform (Railway recommended for beginners) βœ… Railway configuration files (nixpacks.toml or railway.toml) present


πŸ”§ Environment Variables

For production deployment, consider setting:

# Example for Heroku
heroku config:set FLASK_ENV=production
heroku config:set SECRET_KEY=your-secret-key-here

🌐 Access Your Deployed App

After successful deployment:

  1. Heroku: https://your-app-name.herokuapp.com
  2. Railway: https://your-app-name.up.railway.app ⭐ Recommended
  3. Render: https://your-app-name.onrender.com
  4. DigitalOcean: Your assigned domain

πŸ” Troubleshooting Deployment

Common Issues:

❌ Port binding errors: Ensure app.run(host='0.0.0.0', port=int(os.environ.get('PORT', 5000)))

❌ CSV files not found: Make sure CSV files are in the project root

❌ Module not found: Run pip install -r requirements.txt before deploying

❌ Memory issues: Consider using a database instead of CSV files for large datasets


πŸ’‘ Development vs Production

Development (Local):

python app.py
# Access: http://127.0.0.1:5000/

Production (Deployed):

gunicorn app:app --bind 0.0.0.0:$PORT
# Access: Your deployed URL

🚨 Production Considerations

For production deployment:

πŸ”’ Security: Set strong SECRET_KEY
πŸ“Š Database: Consider replacing CSV files with SQLite/PostgreSQL
πŸ“ˆ Scaling: Monitor resource usage
πŸ”„ Backups: Regular data backups
πŸ“ Logging: Implement proper logging


🎯 Ready to Deploy!

Your Smart Campus Scheduler is now Railway-optimized and deployment-ready!

πŸš€ Quick Start - Deploy to Railway (Recommended)

Railway is the fastest and easiest way to deploy your Flask application:

  1. Sign up at railway.app (free)
  2. Create a new project
  3. Connect your GitHub repository
  4. Railway auto-detects Python and deploys instantly!

Your app will be live at: https://your-app-name.up.railway.app

✨ Railway Advantages:

  • ⚑ Zero configuration - Auto-detects Python projects
  • πŸ”„ Auto-scaling - Scales with your usage
  • πŸ’Ύ Built-in database support (for future upgrades)
  • 🌐 Custom domains and SSL certificates
  • πŸ“Š Built-in monitoring and logs
  • πŸ’° Generous free tier with $5/month starter plan

πŸ“– Detailed Railway deployment guide: See RAILWAY_DEPLOYMENT.md


Alternative platforms:

  • Heroku: Good for simple deployments
  • Render: Free tier with good performance
  • DigitalOcean: More control and power

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published