A SvelteKit web app for viewing school timetables, populated by a Python data script.
This project consists of two main parts:
app/,app2/: A SvelteKit application that serves as the user-facing website. It displays the schedule information in a clean, readable format.proc/: A Python data processing script that reads a complex schedule from a.csvfile and generates a structured JavaScript module (orar.js) that the SvelteKit application can import and use.
- Class Selection: A simple homepage to select a class .
- Dynamic Schedule Display: Dynamically generates schedule pages for each class based on the imported data .
- "Next Day" View: A special route (
/next/[id]) that intelligently calculates and displays the schedule for the next upcoming school day, skipping weekends . - Persistent Selection: Remembers the user's last selected class using browser cookies and redirects to it on future visits .
- Automated Data Pipeline: A Python script using
pandasparses the master schedule CSV and outputs a clean JS module . - Automated Deployment: Uses Docker and a GitHub Actions workflow to automatically build and deploy the application upon changes to the
mainbranch.
- Frontend: SvelteKit , Vite
- Data Processing: Python , Pandas
- Deployment: Docker , GitHub Actions
The application's data flow is designed for easy updates:
- The master schedule is maintained in the
proc/orar CNVA 2025-2026 14 sept.csvfile . - The Python script (
proc/main.py) is executed . It reads the CSV , parses the schedule data, maps teachers to subjects , and generates a JavaScript module located atproc/orar.js. - This generated
proc/orar.jsfile is then copied toapp/src/lib/index.js, which acts as the database for the SvelteKit application. - The SvelteKit app imports this data to render the schedules for all classes.
Note: The repository also contains an app2 directory , which appears to be a newer version of the application using Svelte 5. However, the current CI/CD workflow is configured to build and deploy the application from the app directory .
To run the app (main deployed version) locally:
# Navigate to the app directory
cd app
# Install dependencies
bun install
# Run the development server
bun run devTo update the schedule data used by the application:
- Update the CSV file at
proc/orar CNVA 2025-2026 14 sept.csv. - Ensure you have Python and the
pandaslibrary installed (pip install pandas). - Run the processing script from the
procdirectory:cd proc python main.py - This will create/overwrite
proc/orar.js. - Copy the contents of
proc/orar.jsand use them to replace the contents ofapp/src/lib/index.js. - Commit and push the changes to
app/src/lib/index.jsto trigger a new deployment.