cnva-schedule Svelte Themes

Cnva Schedule

A SvelteKit web app for viewing school timetables, populated by a Python data script.

CNVA Schedule Viewer

A SvelteKit web app for viewing school timetables, populated by a Python data script.

This project consists of two main parts:

  1. app/, app2/: A SvelteKit application that serves as the user-facing website. It displays the schedule information in a clean, readable format.
  2. proc/: A Python data processing script that reads a complex schedule from a .csv file and generates a structured JavaScript module (orar.js) that the SvelteKit application can import and use.

Key Features

  • 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 pandas parses 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 main branch.

Technology Stack

  • Frontend: SvelteKit , Vite
  • Data Processing: Python , Pandas
  • Deployment: Docker , GitHub Actions

How It Works

The application's data flow is designed for easy updates:

  1. The master schedule is maintained in the proc/orar CNVA 2025-2026 14 sept.csv file .
  2. 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 at proc/orar.js .
  3. This generated proc/orar.js file is then copied to app/src/lib/index.js , which acts as the database for the SvelteKit application.
  4. 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 .

Local Development

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 dev

Updating the Schedule

To update the schedule data used by the application:

  1. Update the CSV file at proc/orar CNVA 2025-2026 14 sept.csv .
  2. Ensure you have Python and the pandas library installed (pip install pandas).
  3. Run the processing script from the proc directory:
    cd proc
    python main.py
    
  4. This will create/overwrite proc/orar.js .
  5. Copy the contents of proc/orar.js and use them to replace the contents of app/src/lib/index.js.
  6. Commit and push the changes to app/src/lib/index.js to trigger a new deployment.

Top categories

Loading Svelte Themes