A comprehensive Java Swing application for educational institutions to manage, schedule, and view timetables for courses.
- Java Development Kit (JDK) 17 or newer
- Maven 3.6.0 or newer
- Windows, macOS, or Linux operating system with GUI support
TT/
├── pom.xml
├── Readme.md
├── data/
│ ├── classrooms.json
│ ├── courses.json
│ ├── instructors.json
│ ├── sections.json
│ ├── students.json
│ ├── timetable.json
│ └── users.json
├── src/
│ └── main/
│ └── java/
│ └── com/
│ └── timetablebuilder/
│ ├── Main.java
│ ├── model/
│ │ ├── Classroom.java
│ │ ├── ComponentType.java
│ │ ├── Course.java
│ │ ├── Instructor.java
│ │ ├── Section.java
│ │ ├── Student.java
│ │ ├── TimeSlot.java
│ │ └── ...
│ ├── service/
│ │ ├── AuthService.java
│ │ ├── DataRepository.java
│ │ ├── PersistenceService.java
│ │ ├── TimetableGenerator.java
│ │ └── TimetableService.java
│ ├── solver/
│ │ └── TimetableSolver.java
│ ├── ui/
│ │ ├── AutoTimetablePanel.java
│ │ ├── CourseBrowserPanel.java
│ │ ├── DataInputPanel.java
│ │ ├── LoginDialog.java
│ │ ├── MainFrame.java
│ │ ├── ManualTimetablePanel.java
│ │ ├── StudentTimetablePanel.java
│ │ ├── TeacherTimetablePanel.java
│ │ └── ...
│ └── util/
│ └── PasswordUtils.java
└── target/
├── TimetableBuilder-1.0-SNAPSHOT.jar
└── classes/
└── com/
└── timetablebuilder/
└── ...
- UI Layer (
ui/): Java Swing panels, dialogs, and frames for all user roles (Admin, Teacher, Student). Handles user input and displays data. - Model Layer (
model/): Java classes representing core entities (Classroom, Course, Instructor, Section, Student, TimeSlot, etc.). - Service Layer (
service/): Contains business logic, authentication, data management, and timetable generation. Key classes:AuthService: Handles user authentication and session management.PersistenceService: Loads and saves data to JSON files.TimetableService&TimetableGenerator: Manage and generate timetables.
- Solver Layer (
solver/): Implements algorithms for automatic timetable generation and conflict resolution. - Utility Layer (
util/): Helper classes for tasks like password hashing.
Data Flow:
- User interacts with the UI (e.g., logs in, manages data, views timetables).
- UI calls service layer methods to perform actions.
- Service layer updates models and persists changes using
PersistenceService. - Data is loaded from and saved to JSON files in the
data/directory.
- All persistent data is stored as JSON files in the
data/directory. - Each file corresponds to a specific entity or relationship:
classrooms.json: Classroom details (id, name, capacity, type, etc.)courses.json: Course information (code, name, credits, etc.)instructors.json: Instructor profiles and assignments.sections.json: Course sections, including schedule, assigned instructor, and classroom.students.json: Student records, enrollments, and credentials.users.json: User login credentials and roles (admin, teacher, student).timetable.json: The master timetable, mapping sections to time slots and classrooms.
Persistence Mechanism:
- On startup, the application loads all JSON files into memory.
- Any changes made via the UI (add/edit/delete) are immediately saved back to the corresponding JSON file.
- The
PersistenceServiceabstracts file I/O, ensuring data consistency and integrity.
Example Data Structure (section of sections.json):
[
{
"id": "SEC101",
"courseId": "CSE101",
"instructorId": "INST01",
"classroomId": "CR01",
"timeSlot": {
"day": "Monday",
"startTime": "09:00",
"endTime": "10:00"
},
"enrolledStudents": ["STU01", "STU02"]
}
]System Diagram:
[User]
│
▼
[UI Layer] ──calls──> [Service Layer] ──manages──> [Model Layer]
│ │
│ ▼
└──────────reads/writes────────> [PersistenceService] ──JSON──> [data/]
If you don't have JDK installed:
-
Download JDK from Oracle's website or use OpenJDK.
-
Install the JDK by following the installation wizard.
-
Verify installation by opening a terminal or command prompt and running:
java -version
If you don't have Maven installed:
-
Download Maven from Apache Maven's website.
-
Extract the archive to a location of your choice.
-
Add Maven's bin directory to your system's PATH variable.
-
Verify installation by running:
mvn -version
download and extract the ZIP file from the drive.
Navigate to the project root directory and run:
mvn clean install
This will download all dependencies specified in the pom.xml file and build the project.
There are several ways to run the application:
Just run the Main.java using VScode or any other IDE as java application.
If the project is built with Maven, run the compiled JAR file:
java -jar target/TimetableBuilder-1.0-SNAPSHOT.jar
- Open the project in your preferred IDE.
- Ensure that all Maven dependencies are properly imported
- Find the Main class (com.timetablebuilder.Main)
- Right-click on the class and select "Run" or "Run As > Java Application"
If you have all the required dependencies (including Jackson libraries) in your classpath:
-
Compile the project:
javac -cp "/path/to/dependencies/" -d target/classes src/main/java/com/timetablebuilder/**/.java
-
Run the compiled class:
java -cp "target/classes:/path/to/dependencies/*" com.timetablebuilder.Main
For Windows users (Command Prompt): cmd javac -cp "path\to\dependencies*" -d target\classes src\main\java\com\timetablebuilder***.java java -cp "target\classes;path\to\dependencies*" com.timetablebuilder.Main
The application supports three user roles, each with different permissions and views:
Login Credentials:
- Username: admin1
- Password: admin123
Capabilities:
-
Data Management
- Manage classrooms, instructors, courses, sections, and students
- Add, edit, or remove any data entity
- View all data in tabular format
-
Manual Timetable Management
- View the master timetable
- Schedule sections by selecting from unscheduled sections
- Assign classrooms and time slots
- Remove scheduled sections
-
Automatic Timetable Generation
- Generate timetables automatically based on constraints
- Preview generated timetables before applying
- Apply generated schedules to the master timetable
Instructions for Common Tasks:
- Adding a Classroom: Go to Data Management tab → Select Classroom panel → Click "Add" → Fill in details → Submit
- Scheduling a Section: Go to Manual Timetable tab → Select a section from the unscheduled list → Select a classroom → Click on a time slot in the grid → Click "Assign"
- Generating Timetable: Go to Auto Timetable tab → Set parameters → Click "Generate" → Review → Apply to master
Login Credentials:
- Username: ajith (or a specific instructor ID)
- Password: teacher123
Capabilities:
-
View Personal Timetable
- See all sections assigned to the logged-in instructor
- View by day and time slot
-
View Master Timetable
- Read-only view of all scheduled sections
Instructions for Common Tasks:
- Viewing Your Schedule: After login, the personal timetable is displayed automatically
- Finding a Specific Class: Use the search functionality (if available) or locate the cell in the timetable grid
Login Credentials:
- Username: vardhan (or a specific student ID)
- Password: student123
Capabilities:
-
View Personal Timetable
- See all sections the student is enrolled in
- View by day and time slot
-
Course Registration
- Browse available courses and sections
- Register for courses
- Drop enrolled courses
Instructions for Common Tasks:
- Enrolling in a Course: Go to Course Registration tab → Browse available sections → Select a section → Click "Enroll"
- Dropping a Course: Go to Course Registration tab → View enrolled sections → Select a section → Click "Drop"
- Viewing Your Schedule: Go to My Timetable tab to see your personal schedule
-
Admin Setup:
- Add classrooms, instructors, courses, sections, and students
- Schedule sections in the timetable
- Save all changes
-
Instructor Usage:
- Log in to view assigned teaching schedule
- Plan accordingly
-
Student Registration:
- Log in to view available courses
- Register for courses
- View personal timetable
All data is saved in JSON format in the data directory:
- classrooms.json
- instructors.json
- courses.json
- sections.json
- students.json
- users.json
- timetable.json
The application automatically loads data from these files on startup and saves changes when operations are performed.
- Application won't start: Ensure Java is installed and properly configured
- Missing dependencies: Run mvn clean install to download required libraries
- Data not loading: Check if the data directory exists and contains valid JSON files