itpdp/api
2026-05-11 20:21:01 +02:00
..
src progress on device connection 2026-05-11 20:21:01 +02:00
.gitignore initial commit 2026-04-19 12:38:24 +02:00
AGENTS.md format issues + socket 2026-04-21 22:01:53 +02:00
biome.json split up generation 2026-05-03 22:38:49 +02:00
bun.lock initial commit 2026-04-19 12:38:24 +02:00
docker-compose.yaml initial commit 2026-04-19 12:38:24 +02:00
drizzle.config.ts format issues + socket 2026-04-21 22:01:53 +02:00
package.json basic party analysis 2026-04-25 18:20:07 +02:00
README.md add simple docs 2026-05-01 20:41:30 +02:00
tsconfig.json basic party analysis 2026-04-25 18:20:07 +02:00
vitest.config.ts basic party analysis 2026-04-25 18:20:07 +02:00

API

To install dependencies:

bun install

To run:

bun run dev

Requires running Postgres and environment setup.

Create .env file (in this folder):

# Leave as is if using docker/default Postgres install
DATABASE_URL=postgres://postgres:postgres@localhost/postgres
BETTER_AUTH_URL=http://127.0.0.1:3000

# random secure secret; can be left as is for development/testing
BETTER_AUTH_SECRET=vGIwQFYm4kUPHOhFNt882IbFaWhLklke

# Create a spotify web app.
# Add http://127.0.0.1:3000/api/auth/callback/spotify as callback URL there
# Copy and paste Client ID and Client secret to the following places:
SPOTIFY_CLIENT_ID=
SPOTIFY_CLIENT_SECRET=

Important files for editing:

  • src/workflows/quiz.ts has the main Quiz loop.
    • Questions are generated in src/party/ files.
  • src/workflows/sync.ts gets data from spotify and saves into database
  • src/workflows/party-analysis.ts generates analysis details of a given party, to be used for question generation
  • src/party-types.ts contains type definitions of party data, shared with frontend