Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/AI-USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ the part that matters most.
| 2026-10-01 | erikhfj | opencode | CI deploy fix for #27 after rachelks reported it: `grep -q` SIGPIPE silently skipped a live service, `sudo` had no TTY, and `sleep 2` raced Node binding the port. All three verified against the live unit |
| 2026-10-01 | erikhfj | opencode | Simplified this log to a table at the group's request |
| 2026-10-01 | robertky | Codex (ChatGPT) | Assisted with formulating good reviews of the architecture and UI-specification PRs. The group decided to include decade filtering; Rachel implemented the corresponding schema and documentation update in #38. |
| 2026-10-10 | evenkkl | Claude | Assisted with implementing the GraphQL Yoga server with `searchAlbums` for #6, and formulated an easy to understand PR description. Guided the reset of the prototype tables in the VM database (backup taken first). |
| 2026-10-13 | evenkkl | Claude | Fixed the review feedback on #6: cursor values validated against the sort, `reviewCount` returns 0 until reviews exist. The group decided genre filters combine with AND; Claude made the filter and the genre counts match that. |

## Notes

Expand Down
64 changes: 64 additions & 0 deletions docs/VM-setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# VM setup

How to run the GraphQL API (`server/`) on the group VM and check that it works.

## Run the API

`DATABASE_URL` must point at the `crate` database, for example in `server/.env`:

```
DATABASE_URL=postgres://t19:<password>@127.0.0.1:5432/crate
```

```bash
pnpm install
pnpm --filter @t19/server db:migrate # create the catalog tables
pnpm --filter @t19/server db:seed # replace the catalog with the sample albums
pnpm --filter @t19/server build
pnpm --filter @t19/server start # http://localhost:3001/graphql
```

## Smoke suite

Run on the VM after a deploy. Each command prints what to expect. The
expectations assume the sample data from `db:seed`.

```bash
API=http://localhost:3001/graphql
gql() { curl -s "$API" -H 'content-type: application/json' -d "$1"; echo; }
```

1. The API answers. Expect `{"data":{"__typename":"Query"}}`.

```bash
gql '{"query":"{ __typename }"}'
```

2. Search is case-insensitive. Expect `totalCount` 4 for both.

```bash
gql '{"query":"{ a: searchAlbums(input:{query:\"blue\",sort:RELEVANCE},first:5){ totalCount } b: searchAlbums(input:{query:\"BLUE\",sort:RELEVANCE},first:5){ totalCount } }"}'
```

3. A single word also matches artist names, and artists and genres resolve.
Expect A Love Supreme and Blue Train, both by John Coltrane.

```bash
gql '{"query":"{ searchAlbums(input:{query:\"coltrane\",sort:TITLE_ASC},first:5){ totalCount edges { node { title releaseYear artists { name } genres { name } } } } }"}'
```

4. Facets. With Rock (id 4) selected, expect `totalCount` 7. Genres combine
with AND, so `genreFacets` counts albums that are Rock and that genre:
Rock 7, Pop 3, Electronic 2. `decadeFacets` counts only Rock albums.

```bash
gql '{"query":"{ searchAlbums(input:{query:\"\",genreIds:[\"4\"],sort:TITLE_ASC},first:5){ totalCount genreFacets { genre { name } count } decadeFacets { decade count } } }"}'
```

5. Paging. Expect `hasNextPage` true and an `endCursor`. Paste the cursor in as
`after` to get the next two albums, with no album repeated.

```bash
gql '{"query":"{ searchAlbums(input:{query:\"\",sort:RELEASE_YEAR_DESC},first:2){ edges { node { title releaseYear } } pageInfo { hasNextPage endCursor } } }"}'
gql '{"query":"{ searchAlbums(input:{query:\"\",sort:RELEASE_YEAR_DESC},first:2,after:\"<endCursor>\"){ edges { node { title releaseYear } } pageInfo { hasNextPage endCursor } } }"}'
```
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"scripts": {
"dev": "pnpm --filter @t19/client dev",
"build": "pnpm --filter @t19/client build",
"build": "pnpm -r build",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"format": "prettier --write .",
Expand Down
Loading