KONSol is an information screen in Konsulatet. This repo contains the React app that is the screen itself, a React admin page to upload slides, and the backend written in Actix Web.
- Ability to upload slides (images, title, text, date) that will be shown on the screen.
- SL timetable data.
- Fysiksektionen calendar integration.
- Environment Variables:
(Defined in
backend/.env)DATABASE_URL: Path to the SQLite database file.IMAGE_PATH: Directory where slide images are stored. Defaults to/tmp/konsol_slides. Warning: Currently all files in this directory are served under/api/screen/slides/images.
See endpoints.
- Make sure Rust is installed and
cargoworks. Otherwise, install Rust. - Install Diesel CLI, for example by running
cargo install diesel_cliorcargo-binstall diesel_cli. - Navigate to
backend/and rundiesel migration run. - To fill the database with mock slides, navigate to
backend/scriptsand (while in that directory) runpython3 mock_data.py. - To add a user to the database (necessary to log in to the admin page) run
python3 add_authenticated_user.py <user_email>with the full email of the Google account you want to log in with. - Run the backend with
cargo runorcargo rfrom thebackend/directory. (The port will be displayed in the terminal)
- Make sure
nodeandnpmare both installed. - Navigate to either
screen-frontend/oradmin-frontendand runnpm install. - For the admin page, enter a Google client ID in
admin-frontend/.env. If you don't have one, you can make a Google Cloud project and get a client id. - Run the frontend with
npm run dev. (The port will be displayed in the terminal)
If you don't use Nix, you can ignore this and all *.nix-files. If you use Nix, this project has a dev shell which can be entered with nix develop (if you use flakes) or nix-shell (if you don't). After entering the dev shell, run npm install to install the Node dependencies, run the migrations, and fill the database according to the instructions above.