A full-stack web application that generates optimized timetables for educational institutions with smart scheduling algorithms, mobile-responsive design, and PDF export capabilities.
- Smart Scheduling Algorithm: Prevents teacher conflicts and optimizes class distribution
- Lab Management: 3-hour continuous lab blocks on specific days (Tue, Thu, Fri)
- Special Periods: Sports, Library, and Counseling in last periods only
- Gap Prevention: Intelligently adds breaks between teacher assignments
- Multi-Section Support: Different timetables for multiple sections
- Teacher Schedule View: Individual teacher timetables
- Mobile-First Design: Responsive on phones, tablets, and desktops
- Modern UI: Clean interface with Tailwind CSS
- Real-time Validation: Form validation with helpful error messages
- Loading Animations: Progress indicators during generation
- Touch-Friendly: Optimized for mobile interactions
- PDF Downloads: Section-wise and teacher-wise timetables
- Clean Formatting: Professional PDF layout with proper styling
- Multiple Views: Switch between section and teacher perspectives
The application is deployed and accessible at:
- Frontend: https://timetable-generator-frontend.vercel.app
- Backend API: https://timetable-generator-backend.onrender.com
- Flask - Python web framework
- ReportLab - PDF generation
- Flask-CORS - Cross-origin resource sharing
- Gunicorn - WSGI HTTP Server
- React 18 - Modern JavaScript library
- Tailwind CSS - Utility-first CSS framework
- Lucide React - Beautiful icons
- Axios - HTTP client
timetable-generator/
βββ backend/
β βββ app.py # Flask application
β βββ requirements.txt # Python dependencies
β βββ Procfile # Deployment configuration
β βββ runtime.txt # Python version
βββ frontend/
β βββ public/
β β βββ index.html # HTML template
β βββ src/
β β βββ components/ # React components
β β β βββ ConfigForm.js
β β β βββ TimetableDisplay.js
β β β βββ LoadingSpinner.js
β β βββ App.js # Main App component
β β βββ index.js # React entry point
β β βββ index.css # Tailwind styles
β βββ package.json # Node dependencies
β βββ tailwind.config.js # Tailwind configuration
β βββ postcss.config.js # PostCSS configuration
βββ .replit # Replit configuration
βββ replit.nix # Replit environment
βββ vercel.json # Vercel deployment
βββ README.md # Documentation
-
Fork the Replit:
- Go to Replit
- Import this repository
- Click "Run" - everything is pre-configured!
-
Access Your App:
- Backend will run on the Replit URL
- Deploy with Replit Deployments for a public URL
-
Create Render Account: Sign up at render.com
-
Deploy Backend:
# Connect your GitHub repository to Render # Set build command: pip install -r backend/requirements.txt # Set start command: gunicorn --bind 0.0.0.0:$PORT backend.app:app
-
Note your backend URL:
https://your-app-name.onrender.com
-
Install Vercel CLI:
npm i -g vercel
-
Update API URL:
# In frontend/.env.production REACT_APP_API_URL=https://your-backend-url.onrender.com -
Deploy:
cd frontend vercel --prod
-
Backend Setup:
cd backend python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -r requirements.txt python app.py
-
Frontend Setup:
cd frontend npm install npm start
- Working Days: Choose 5 or 6 days
- Periods per Day: Set number of periods (6-8)
- Period Duration: Set minutes per period (40-60)
- College Hours: Set start and end times
- Enter teacher names one by one
- Assign subjects each teacher can handle
- Support for multiple subjects per teacher
- Add section names (e.g., CS-A, DS-B)
- Define subjects for each section
- Include lab subjects (must contain "lab" in name)
- Click "Generate Timetable"
- View section-wise or teacher-wise schedules
- Download PDFs for any section or teacher
The application follows these intelligent rules:
- No Conflicts: Teachers can't be in two places simultaneously
- Lab Scheduling:
- Labs are 3-hour continuous blocks
- Only on Tuesday, Thursday, Friday
- Prevent interruptions
- Special Periods: Sports/Library/Counseling only in last period
- Gap Management: Prevents back-to-back teaching when possible
- Subject Distribution: Avoids repeating subjects in same day
- Balanced Workload: Distributes teaching load evenly
GET /api/health- Health checkPOST /api/generate-timetable- Generate new timetablePOST /api/download-pdf- Download PDF
{
"working_days": 6,
"periods_per_day": 7,
"period_duration": 50,
"start_time": "08:00",
"end_time": "15:00",
"teachers": ["Dr. Smith", "Prof. Johnson"],
"sections": [
{
"name": "CS-A",
"subjects": ["Mathematics", "Physics", "Computer Lab"]
}
],
"teacher_subjects": {
"Dr. Smith": ["Mathematics", "Physics"],
"Prof. Johnson": ["Computer Lab"]
}
}- Modify
frontend/src/index.cssfor custom styles - Update
frontend/tailwind.config.jsfor theme changes - Colors, fonts, and spacing can be customized
- Edit
backend/app.pyTimetableGeneratorclass - Modify scheduling rules in
assign_labs()andassign_special_periods() - Adjust conflict resolution logic
-
CORS Errors:
- Ensure backend has
Flask-CORSenabled - Check API URL in frontend environment variables
- Ensure backend has
-
PDF Generation Fails:
- Verify ReportLab installation
- Check if all required data is present
-
Mobile Display Issues:
- Tables are horizontally scrollable on small screens
- Use landscape mode for better viewing
-
Deployment Issues:
- Ensure all environment variables are set
- Check build logs for missing dependencies
- Fork the repository
- Create your feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with β€οΈ for educational institutions
- Icons by Lucide
- Styling with Tailwind CSS
- PDF generation powered by ReportLab
Made with π» and β
Ready to use β’ No installation required β’ Works everywhere