Quarkus backend for the Pyramid Draft MTG cube drafting application.
- Java 17
- Docker
- Node.js (for json-server)
# Start MongoDB
docker compose -f src/main/docker/docker-compose.yml up -d
# Start json-server (dev only)
json-server --watch db.json
# Run the app
./gradlew clean build quarkusDev| Profile | Use |
|---|---|
dev |
Local development with json-server |
prod |
Production with CubeCobra API |
Configure via quarkus.profile in application.properties.
The backend ships with a dev mode that bypasses Google JWT signature verification.
Dev mode is enabled by default in application.properties via google.oauth.dev-mode=true.
To test account endpoints with Insomnia:
- Start the app:
./gradlew quarkusDev - Open the included
insomnia-collection.jsonin Insomnia - Run Dev Resources → Generate Dev Token — this creates a signed JWT with your desired user info
- Copy the
idTokenfrom the response - Paste it into Account Service → Login (replace
<google-id-token>with the copied value) - Run Login — the response contains the
accountIDto use in subsequent requests
You can customize the dev token with query parameters:
GET /dev/token?sub=my-id&email=test@example.com&name=My+Name
When google.oauth.dev-mode=true, the GoogleTokenVerifier parses the JWT header and payload
without verifying the cryptographic signature, so any properly-formed JWT will work.
For production or end-to-end testing with real Google authentication:
- Go to the Google Cloud Console
- Create a project (or select an existing one)
- Navigate to APIs & Services > Credentials
- Click Create Credentials > OAuth client ID
- Choose Web application as the application type
- Add your front-end URL to Authorized JavaScript origins (e.g.
http://localhost:5173) - Add your front-end URL to Authorized redirect URIs (e.g.
http://localhost:5173) - Copy the generated Client ID
- Set it in
application.properties:google.oauth.client-id=YOUR_CLIENT_ID google.oauth.dev-mode=false
- Your front-end should use the Google Identity Services library to obtain an ID token, then POST it to
/account/login.
To get a test ID token without a front-end:
- Visit Google's OAuth 2.0 Playground
- Under "Scopes & APIs", enter
openid email profileand click "Authorize APIs" - Exchange the authorization code for tokens
- Use the
id_tokenvalue in your login request
Important: The ID token must have email_verified: true for the backend to accept it.
Google only sets this for accounts with a verified email (most Google accounts qualify).
./gradlew testCoverage reports are generated at build/reports/jacoco/test/html/index.html.
# Build native executable
./gradlew build -Dquarkus.package.type=native
# Docker build
docker build -f src/main/docker/Dockerfile.jvm -t pyramid-draft-backend .- Multiface card data is strange, Meld structure different from Day/Night, not sure about other flips. Will need something to get image URL's in a good structure in the base Object.
- Think of a good way to create commonality between the cube cobra structure of cards, and scryfall structure of cards. Or, rip out cube cobra structure and only take ID's (Would lose preffered art in the cube if you do not use the cube data)