A webapp to manage the ticketing for a non-profit Devoxx4KidsQC event
See AGENTS.md for guidelines on using AI/code assistants with this project.
https://billetterie.devoxx4kids.montreal-jug.org
or
https://billetterie.devoxx4kids.montrealjug.org
because, well, we can't decide which domain to use 🤷
Make sure to have a Docker daemon running (so that tests and dev. can start the postgresql and mailhog containers).
And then:
./mvnw spring-boot:run
To ease local development, two profiles are available:
local: for day to day developmentlocal-mail: to test sent emails locally (it's a group that loadslocalandmailhogprofiles in the expected order) (see email module documentation for more)
You can set your desired profile on the command line:
./mvnw spring-boot:run -Dspring-boot.run.profiles=localor
./mvnw spring-boot:run -Dspring-boot.run.profiles=local-mailThis can also be done in your IDE configuration.
We use tailwind for our css.
Tailwind build is disabled for now, to speed dev.
To enable it:
- remove the
skiptag in thefrontend-maven-pluginin thepom.xml - replace the tags in the
admin_layout.jteandguest_layout.jteby the commented one
The generation of the main.css file is handled by the frontend-maven-plugin during the build.
As explained in the documentation of the plugin, it is focused on the build process, not on the dev experience. Especially, it is not possible to use it to launch tasks in watch mode (maven will simply stop the process).
To run tailwind in watch mode during dev, you have to use a dedicated shell and launch, from the project root directory:
npm --prefix src/main/tailwind run watchCoupled with spring-boot-dev-tools, and our local profile this will update generated css on any changes in the templates, making the changes visible in the browser on refresh.
If you have a failure during compilation, make sure to run:
./mvnw spotless:applyto make sure your files are formatted according to our convention.
Builds are pinned to Java 21. Using Java 25 currently breaks Hibernate enhancement because Byte Buddy does not yet support classfile version 69; upgrade tooling first if you need Java 25.
If the database schema changed, because of JPA entities, the safest way to rebuild everything is... to delete your DB!
Simply issue this command:
docker-compose down
# or docker-compose --profile mailhog downfly proxy 5432 -a billetterie-db
pg_dump postgres://username:password@localhost:5432/billetterie > ./billetterie.sql
dropdb -U myuser -h localhost -p 25432 mydatabase
createdb -U myuser -h localhost -p 25432 mydatabase
psql -U myuser -d mydatabase -h localhost -p 25432 -f billetterie.sqlNotes for administrators connecting to the Fly.io db: you can't simply destroy it.
Here are commands that could help:
# open a postgres shell
fly postgres connect -a billetterie-db
# list databases
\l
# drop the database altogether
DROP DATABASE billetterie;
# if that fails because of existing connections, list them and kill them
select pid,state from pg_stat_activity;
select pg_terminate_backend(`PID`);
# re create the DB
CREATE DATABASE billetterie;
# Make sure user billetterie can interact with its database
GRANT ALL PRIVILEGES ON DATABASE "billetterie" to billetterie;Set those environment variables:
- MAIL_SERVER , defaults to in-v3.mailjet.com
- MAIL_USER
- MAIL_PASSWORD
The RSA key is used to create signatures of the email addresses of the booker; this signature is then used to identify and manage the bookings of the user (booker).
# Generate a 2048-bit RSA private key in PKCS#8 format
openssl genpkey -algorithm RSA -out private_key.pem -pkeyopt rsa_keygen_bits:2048then set the env. variable / secret APP_RSA_KEY
Set at least those environment variables:
ACTUATOR_PASSWORD, defaults toactuator😱😉ADMIN_PASSWORD, defaults topassword😱😉
You can also set:
ADMIN_USER, defaults toadminto... set theadminusernameADMIN_SESSION_COOKIE_NAME, defaults toBILLETTERIE_SESSIONto ... set theadminsession cookie name