Features β’ Quick Start β’ Documentation β’ Contributing
A comprehensive full-stack web application designed for educational institutions to efficiently manage classroom schedules and lecture bookings. Built with modern technologies including Python, Flask, and MongoDB, this system provides an intuitive interface for scheduling, conflict detection, and real-time updates.
Perfect for: Universities, colleges, training centers, and educational institutions managing multiple classrooms and lecture schedules.
- π Multi-Classroom Management - Manage schedules for up to 6 classrooms simultaneously
- π Intelligent Conflict Detection - Automatic detection of scheduling conflicts
- π₯ User Authentication - Secure login system with session management
- β‘ Real-time Updates - AJAX-powered interface for seamless user experience
- π Lecture CRUD Operations - Create, read, update, and delete lectures easily
- π Password Management - User-friendly password change functionality
- π± Responsive Design - Works seamlessly on desktop and mobile devices
- βοΈ Configurable Weekdays - Switch between Sun-Thu and Mon-Fri schedules
- π¨ Interactive UI - Click-to-edit schedule cells with modal forms
- π Visual Schedule Grid - Clear, color-coded timetable view
- π Dynamic Day Mapping - Automatic adaptation to selected weekday configuration
Before you begin, ensure you have the following installed:
- Python 3.8 or higher (Download)
- MongoDB Atlas account or local installation (Setup Atlas)
- Git (Download)
# 1. Clone the repository
git clone https://github.com/samyabdellatif/labs.git
cd labs
# 2. Run automated setup
python setup.py
# 3. Configure your MongoDB connection
# Edit .env file and update MONGO_URI
# 4. Start the application
# Windows
venv\Scripts\activate
python server.py
# macOS/Linux
source venv/bin/activate
python server.py# 1. Clone the repository
git clone https://github.com/samyabdellatif/labs.git
cd labs
# 2. Create virtual environment
python -m venv venv
# 3. Activate virtual environment
# Windows
venv\Scripts\activate
# macOS/Linux
source venv/bin/activate
# 4. Install dependencies
pip install -r requirements.txt
# 5. Configure environment variables
cp .env.example .env
# Edit .env and add your MongoDB connection string
# 6. Run the application
python server.pyCreate a .env file in the project root:
# MongoDB Connection (Atlas or Local)
MONGO_URI=mongodb+srv://username:password@cluster.mongodb.net/classroomsDB
# Flask Security
FLASK_SECRET_KEY=your-secure-random-secret-key-hereMongoDB Atlas Setup:
- Create free account at MongoDB Atlas
- Create a new cluster
- Get connection string from dashboard
- Replace credentials in MONGO_URI
Local MongoDB:
MONGO_URI=mongodb://localhost:27017/classroomsDB- Open browser and navigate to
http://127.0.0.1:5000 - Login with default credentials:
- Username:
admin - Password:
password
- Username:
β οΈ Important: Change default password immediately via Control Panel
labs/
βββ π server.py # Flask application & routes
βββ π setup.py # Automated setup script
βββ π requirements.txt # Python dependencies
βββ π .env.example # Environment template
βββ π .env # Your configuration (create this)
βββ π README.md # Documentation
βββ π templates/ # HTML templates
βββ base.html # Base layout & navigation
βββ index.html # Schedule view
βββ cpanel.html # Control panel
βββ login.html # Authentication
βββ about.html # About page
βββ _lecture_form.html # Lecture form modal
| Category | Technologies |
|---|---|
| Backend | Python 3.8+, Flask 3.0+, PyMongo |
| Database | MongoDB (Atlas/Local) |
| Frontend | HTML5, CSS3, Vanilla JavaScript |
| Authentication | Flask Sessions |
| Environment | python-dotenv |
1. users - User authentication
{
username: String, // Unique identifier
password: String, // Plaintext (consider hashing for production)
role: String // "admin" or "user"
}2. classroom - Lecture schedules
{
course: String, // Course name
instructor: String, // Instructor name
days: String, // Day codes e.g., "135" (SUN, TUE, THU)
starttime: String, // Format "HH:MM"
endtime: String, // Format "HH:MM"
numberOfStudents: Number, // Expected attendance
classroom: String // Classroom number "1" to "6"
}3. settings - Global configuration
{
_id: "global",
weekdays: String // "sun-thu" or "mon-fri"
}| Method | Endpoint | Description |
|---|---|---|
GET |
/ |
Home page (schedule view) |
GET |
/index?classroom=N |
View specific classroom |
GET |
/cpanel |
Control panel |
GET |
/login |
Login page |
POST |
/login |
Authenticate user |
GET |
/logout |
End session |
GET |
/about |
About page |
GET |
/get_lecture |
Fetch lecture details |
GET |
/lectures?classroom=N |
Get all lectures for classroom |
POST |
/insert_lecture |
Create new lecture |
POST |
/update_lecture |
Update existing lecture |
POST |
/change_password |
Change user password |
POST |
/update_settings |
Update global settings |
| Variable | Description | Required | Default |
|---|---|---|---|
MONGO_URI |
MongoDB connection string | β Yes | - |
FLASK_SECRET_KEY |
Session encryption key | β Yes | change-this-secret |
MongoDB Connection Error
Problem: Could not connect to MongoDB
Solutions:
- Verify
MONGO_URIin.envfile - Check MongoDB Atlas network access (whitelist your IP)
- Ensure database user credentials are correct
- For local MongoDB, confirm service is running
Module Not Found Error
Problem: ModuleNotFoundError: No module named 'flask'
Solution:
# Activate virtual environment first
source venv/bin/activate # macOS/Linux
venv\Scripts\activate # Windows
# Reinstall dependencies
pip install -r requirements.txtPort Already in Use
Problem: Address already in use
Solutions:
Windows:
netstat -ano | findstr :5000
taskkill /PID <PID> /FmacOS/Linux:
lsof -ti:5000 | xargs kill -9Or change port in server.py:
app.run(debug=True, port=5001)Permission Denied Error
Problem: PermissionError: [Errno 13]
Solutions:
- Run terminal as administrator (Windows)
- Check file/folder permissions
- Ensure virtual environment is activated
# In server.py, enable debug mode
app.run(debug=True, port=5000)# Disable debug mode and use production server
app.run(debug=False, host='0.0.0.0', port=5000)
# Better yet, use Gunicorn
pip install gunicorn
gunicorn -w 4 -b 0.0.0.0:5000 server:app// MongoDB Shell - Reset database
use classroomsDB
db.users.drop()
db.classroom.drop()
db.settings.drop()
// Or reset via Mongo Compass/Atlas UIWe welcome contributions! Here's how you can help:
- Fork the repository
- Create a feature branch
git checkout -b feature/amazing-feature
- Commit your changes
git commit -m 'Add some amazing feature' - Push to the branch
git push origin feature/amazing-feature
- Open a Pull Request
- Follow PEP 8 style guide for Python code
- Write clear commit messages
- Add comments for complex logic
- Test your changes thoroughly
This project is created for educational purposes. Feel free to use, modify, and distribute for learning and teaching.
Samy Abdellatif
- π§ Email: Contact via GitHub
- π GitHub: @samyabdellatif
This project demonstrates real-world concepts:
- β Full-stack web development with Python & Flask
- β NoSQL database design with MongoDB
- β RESTful API patterns
- β AJAX for dynamic updates
- β User authentication & session management
- β Form validation & error handling
- β Responsive web design
- β MVC architecture patterns
- β Environment configuration management
- β Git version control
Built as a training project to demonstrate modern web development practices and educational software design.
Need help? Here's what to check:
- β Review the Troubleshooting section
- β Verify all dependencies are installed
- β
Check
.envconfiguration - β Ensure MongoDB is accessible
- β Review Flask logs for error details
Made with β€οΈ for education