This is a event ticketing system built for the BAE Openluchtcantus 2023.
The main goals of the system are to sell tickets online and to check ticket validity at a later point in time. Selling is done using a Mollie integration. Tickets is serialized as a QR-code (with the payload encrypted) and distributed using email via a Sendgrid integration. An admin interface is provided with which ticket details can be viewed and edited. The admin interface also provides a scanned, which scans QR-codes and shows whether the ticket is valid and whether it has been scanned before.
Prerequisites:
- Install a Postgres server locally.
- Take a look at installation instructions for your platform here: https://www.postgresql.org/download/
- Populate database with required tables.
- Execute the contents of
./server/database.sql
on your new database.
- Execute the contents of
- Install
deno
.- Take a look at installation instructions for your platform here: https://deno.land/
- Install
npm
.- To use
npm
, you need to installNode.js
. It is recommended that you installNode.js
usingnvm
. Take a look at installation instructions for your platform here: https://github.com/nvm-sh/nvm
- To use
- Install client dependencies:
- Navigate into the client folder (
cd ./client
) and runnpm install
- Navigate into the client folder (
- Set up the .env file in
./server
.- See
/server/README.md
for further instructions.
- See
Run the server for development:
- Start you local Postgres server
cd server
deno run --allow-env --allow-net --allow-read main.ts
- If you want to test the Mollie integration, your server needs to be reachable
from the outside by Mollie. You have a few options here:
- Use a service like http://localhost.run/. Set the
HOST
property in your.env
file to the returned URL. - Setup your router to forward incoming requests from the outside to the port
on your machine where the server listens. Set the
HOST
property in your.env
file to the public IP address of your router.
- Use a service like http://localhost.run/. Set the
Run the client for development:
cd client
npm run start
- Set up the .env file in
./server
.- See
/server/README.md
for further instructions.
- See
- Run
docker compose up --build
It is recommended to run the Postgres database directly on the bare-metal production machine. The Docker configuration does not provide a database server and the application will fail to start if no database server is found.
The docker-compose.yml
file inserts the following environment variable:
DATABASE_HOST=host.docker.internal
. This allows your server to connect to your
database on localhost
from within the container.