Timetable V2 is a **substitution plan and timetable viewer** that is meant to be a placement for the HTML files that my school provides via [~~DSB Mobile~~](https://dsbmobile.de/) [BOLLE](https://bolle-software.de/).
This Project fetches the latest substitution plan files from the specified source and parses them, which converts the HTML files exported by [Untis](https://www.untis.at/) to a JSON format. The Programm then compares the new substitution plan to the previous one and finds changed, deleted and newly added substitutions and adds them to the database.
The substitutions in the database and their history can then be viewed in the web browser, where they are also being filtered by class and linked with the students timetable.
To setup Timetable V2 in a docker container, you firstly have to build the docker image:
```sh
docker-compose build
```
Next you will need to set your environment variables. For that rename `.env.sample` in the server directory to `.env` and change the variables as described in the file.
Then you can run the app
```sh
docker-compose up -d
```
And check its logs
```sh
docker-compose logs -f
```
If everything is working, you should be able to connect to the app at http://localhost:3000 (or the IP address of your docker host)
To setup a development environment for Timetable V2, you will need to have NodeJS and Docker installed. (If you don't want to install Docker, you can also install PostgreSQL natively on your computer)
### Build the frontend
To build the Vue.js based frontend, you will need to be in the root folder of the project and run
docker run --name timetable-postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 -d postgres
```
The backend can be found at `./server`, so all upcomming commands need to be run in that directory.
For the app to be able to fetch substitution plan files, you need to create a `.env` file (you can use the `.env.sample` as a template) and set the values correctly. You don't need to change the database url used in `.env.sample` for development.
To apply the database schema to the newly created database, you need to run: