An API for my personal portfolio
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

docs: add readme

+42
+42
README.md
··· 1 + # api.matthew-hre.com 2 + 3 + Personal API powering [matthew-hre.com](https://matthew-hre.com). Built with [Hono](https://hono.dev) on [Bun](https://bun.sh), deployed via [Dokploy](https://dokploy.com). 4 + 5 + ## Endpoints 6 + 7 + ### `GET /vinyl` 8 + 9 + Paginated vinyl collection, synced nightly from Discogs. 10 + 11 + | Param | Default | Options | 12 + | ------- | --------- | ---------------------------- | 13 + | `page` | `1` | | 14 + | `sort` | `added` | `title`, `artist`, `added` | 15 + | `order` | `desc` | `asc`, `desc` | 16 + 17 + ### `GET /activity/music` 18 + 19 + Currently playing (or last played) track from Last.fm. 20 + 21 + ### `GET /activity/music/stream` 22 + 23 + SSE stream that pushes track changes in real-time. Polls Last.fm every ~10 seconds server-side and broadcasts to all connected clients. 24 + 25 + ## Local Development 26 + 27 + ```bash 28 + cp .env.example .env # fill in your tokens 29 + docker compose up -d # start Postgres 30 + bun install 31 + bun run sync # seed the database from Discogs 32 + bun run dev # start the API on :3000 33 + ``` 34 + 35 + ## Environment Variables 36 + 37 + | Variable | Description | 38 + | -------------------------------- | ---------------------------- | 39 + | `DATABASE_URL` | Postgres connection string | 40 + | `DISCOGS_PERSONAL_ACCESS_TOKEN` | Discogs API token | 41 + | `LASTFM_API_KEY` | Last.fm API key | 42 + | `LASTFM_USERNAME` | Last.fm username |