Automatic court reservations
Find a file
2023-05-23 15:09:17 -05:00
.github/workflows Correcting docker build command 2023-05-23 15:09:14 -05:00
docker Updating dockerfile to ensure that chromium is part of app image 2023-05-23 15:09:17 -05:00
src Making the DB debug log a bit more concise 2023-05-23 15:09:17 -05:00
tests Adding some routers to http server that handle more requests to /reservations and /cron 2023-05-23 15:09:15 -05:00
.eslintrc.json Adding some pretty stuff 2023-05-23 15:09:09 -05:00
.gitignore Switching to use SQLite instead of MySQL 2023-05-23 15:09:14 -05:00
.nvmrc Updating node version, improving build process and adding required modules to dev dependencies 2023-05-23 15:09:11 -05:00
.prettierrc Adding some new packages for password/database features; updating old packages 2023-05-23 15:09:11 -05:00
jest.config.ts Spliting out server code, adding unit test for server 2023-05-23 15:09:12 -05:00
package-lock.json Switching to use SQLite instead of MySQL 2023-05-23 15:09:14 -05:00
package.json Correcting docker build command 2023-05-23 15:09:14 -05:00
README.md Readme updates for anyone who will read it (future me) 2023-05-23 15:09:17 -05:00
tsconfig.json Removing rollup and relying on tsc to make builds. Also updated Docker to have a working development version 2023-05-23 15:09:13 -05:00

autobaan

Automatic court reservation!

Setup

Requirements

  • Node.js (18.x)
  • npm (8.x)
  • gcc (g++-12)
  • nvm (optional)

Using nvm

  1. Install nvm
  2. nvm use will use version specified in .nvmrc
  3. nvm install-latest-npm will upgrade NPM to latest version (8.x)

Usage

npm install
npm run local <username> <password> <year> <month> <day> <startTime> <endTime> <opponentName> <opponentId>

Architecture

|======|
| User |
|======|
    |
[requests reservation]
    |
    |
    V
|===========|                             /---\                           |==========|
| Scheduler | ---[checks possibility]--->/ ok? \--[y/ forward request]--> | Reserver |
|===========|                            \     /                          |==========|
                                          \---/                                 |
                                            |                                   |
                                          [n/ save request]      [find possible, saved reservations]
                                            |                                   |
                                            V                                   |
                                        |==========|                            |
                                        | Database |<---------------------------|
                                        |==========|

Deployment

  • Create a volume which will store the SQLite database file using docker-like
  • Build image via provided dockerfile
  • Run container with built image exposing port 3000 and mapping the aforementioned volume to /app/db

CD

So I don't forget... I am using GHA to create a container image which I pull on my server using podman. This then restarts the container on my server with the latest image. The container is backed by a systemd service to restart and start on boot.