Creating a class schedule at UCAB was a nightmare. Each semester, students faced the same ritual: open multiple browser tabs, cross-reference course sections, check professor schedules, and manually verify that nothing overlapped. A single mistake meant conflicts that could derail your entire semester. With hundreds of subjects across dozens of degree programs, finding a valid combination often took hours.
In November 2018, I entered the “Reto al Ingenio” competition with a solution. Mi Horario UCAB is a web application that automates schedule creation. Users select their degree program, pick courses they need, and the system generates conflict-free schedules automatically. The project won Best Application at the competition.
What It Does
Mi Horario UCAB starts with a canvas showing an empty weekly calendar. The interface displays time blocks from 7 AM to 6 PM across all seven days. Users interact through three floating buttons: add subjects, generate a schedule, and download the result.
When adding a subject, users select their degree program from a dropdown. The system loads all available courses for that program, organized by semester. Pick “Informatics Engineering” and “Semester III,” and you see subjects like Algorithms, Data Structures, and Database Systems. Each subject includes all available sections with their assigned professors and time slots.
The real power is the random scheduler. After selecting multiple courses, clicking the refresh button triggers the algorithm. It searches through all possible combinations of sections, checking for time conflicts. When it finds a valid schedule, it paints each course on the canvas with a unique color. If no valid combination exists, it alerts the user.
Students can drag courses around the board to explore alternatives. Each card shows the subject name and can be repositioned. Once satisfied, users download their schedule as a PDF for reference during enrollment.
Technical Architecture
The application uses Django on the backend with Django REST Framework for the API. The frontend is vanilla JavaScript with HTML5 Canvas for rendering the schedule grid.
Data Model
The system models university scheduling with two main entities: subjects and degree programs. A subject stores everything about a course section: the semester it belongs to, its NRC code, the assigned professor, the course name, and time slots for each day of the week.
Days store time information as simple strings encoding start and end hours. Monday through Sunday each have their own field. A section that meets Monday and Wednesday from 9 AM to 11 AM stores those times in the respective day columns.
Degree programs maintain many-to-many relationships with subjects. One subject can appear in multiple programs. This reflects how universities share common courses across similar degrees.
REST API
The backend exposes endpoints for reading degree programs and subjects. The career endpoint returns all programs with their associated courses. A separate endpoint returns just program names for populating the dropdown. Subject endpoints support full CRUD operations for administrators.
I used Django REST Framework serializers to shape the JSON responses. The career serializer nests subject data, so a single request returns everything needed to populate the UI. This reduces round trips and keeps the frontend simple.
Canvas Rendering
The frontend draws everything on an HTML5 Canvas element. The board consists of a header row showing days, a left column showing hours, and a grid of time cells. I built classes to handle each component: Header draws the top bar, Hours draws the time labels, and Board coordinates the overall layout.
Course cards render as colored rectangles. Each card knows its position, dimensions, and color. When the scheduler assigns a section, it calculates where to place the card based on the day column and time row. The card stretches to cover the duration of the class.
Colors come from a predefined palette. Each course gets a unique color, making it easy to distinguish subjects on the crowded calendar. The color assignment persists even when regenerating schedules.
The Scheduling Algorithm
The heart of the application is the conflict-free schedule generator. It uses backtracking to find valid combinations. The algorithm processes one course at a time, trying each available section.
For each section, it checks against all previously placed courses. Two sections conflict if they share any common hours on the same day. If a section fits, the algorithm adds it to the working solution and moves to the next course. If no section works, it backtracks and tries a different section for the previous course.
This recursive approach explores the search space efficiently. It stops at the first valid solution rather than enumerating all possibilities. For typical student schedules with 5-7 courses, it finds an answer almost instantly.
The conflict detection compares time ranges on matching days. Each section stores start and end hours for days when classes occur. The comparison checks if any time overlap exists.
PDF Export
Users can download their generated schedule using the jsPDF library. The download button captures the current canvas state and converts it to a PDF document. This gives students a portable record of their planned schedule.
Challenges
Data Collection
The university did not provide a public API for course data. I had to scrape the enrollment system and format the data for my database. This required understanding how UCAB structured their course offerings and mapping it to my simplified model.
Time Representation
Encoding class times required balancing storage simplicity with calculation convenience. I stored times as 4-character strings representing start and end hours. The JavaScript code parses these strings and converts them to comparable numbers for conflict detection.
Visual Feedback
Users needed immediate feedback when manipulating the schedule. The Canvas API redraws efficiently, but managing state across multiple interactive elements required careful coordination. Each card tracks its own position while the board maintains the global layout.
What I Learned
Mi Horario UCAB taught me how to build a complete application under competition pressure. I had limited time to deliver something useful, which forced prioritization. The core feature, automatic schedule generation, worked perfectly. Polish could wait.
I learned that backtracking algorithms solve constraint problems elegantly. The scheduling problem seemed complex, but breaking it into “try a section, check conflicts, recurse or backtrack” made it manageable.
Building with Django and vanilla JavaScript showed me both sides of web development. Django handles data modeling, serialization, and API routing. JavaScript brings the interactive frontend to life. Understanding both layers makes you a better engineer.
Winning Best Application validated the approach. Students face real problems that software can solve. Finding those problems and building focused solutions is what software engineering is about.


