Track your Spotify listens
Find a file
2022-09-29 00:56:44 +00:00
.github/workflows ci: fix argument name 2022-07-24 13:19:08 +02:00
assets feat(frontend): add favicon 2020-05-14 03:10:24 +02:00
charts/listory chore(release): 1.20.1 [skip ci] 2022-09-28 08:17:43 +00:00
docs docs: make readme visually appealing 2022-07-06 20:37:50 +02:00
frontend chore(deps): update dependency typescript to v4.8.4 2022-09-27 20:39:50 +00:00
observability feat(dev): combine all docker-compose setups 2022-09-27 18:14:49 +02:00
src feat(api): add local repl console 2022-09-27 18:14:49 +02:00
test test: create initial unit tests 2021-07-18 21:57:38 +02:00
.dockerignore feat(frontend): add footer with version number 2021-05-24 19:00:07 +02:00
.env.sample feat: add docs and polish 2020-05-03 21:10:31 +02:00
.eslintrc.js chore(lint): switch to eslint 2021-05-25 18:12:42 +02:00
.gitignore feat: serve frontend from api container in prod build 2020-05-03 21:10:31 +02:00
.prettierignore style(helm): run prettier and add templates to prettierignore 2020-11-21 15:53:51 +01:00
.releaserc.yml ci(release): fix .releaserc.yml with renamed default branch 2022-06-25 15:43:24 +02:00
CHANGELOG.md chore(release): 1.20.1 [skip ci] 2022-09-28 08:17:43 +00:00
docker-compose.yml fix(dev): broken traces with latest OTEL libraries 2022-09-28 10:11:37 +02:00
Dockerfile chore(deps): update node.js to v18 2022-06-19 14:26:53 +02:00
LICENSE feat: add docs and polish 2020-05-03 21:10:31 +02:00
nest-cli.json feat(api): setup nestjs 2020-05-03 21:00:20 +02:00
package-lock.json chore(deps): update opentelemetry-js monorepo 2022-09-29 00:56:44 +00:00
package.json chore(deps): update opentelemetry-js monorepo 2022-09-29 00:56:44 +00:00
README.md feat(dev): combine all docker-compose setups 2022-09-27 18:14:49 +02:00
renovate.json chore(deps): group updates to sentry and peers 2022-07-04 11:11:58 +02:00
tsconfig.build.json feat(api): setup nestjs 2020-05-03 21:00:20 +02:00
tsconfig.json build: fix issue where frontend was included in backend tsc build 2021-06-22 21:06:35 +02:00

Listory

Login with Spotify and Listory will save all tracks you listen to.

Latest Release GitHub branch checks state Codecov GitHub

The listens report shows how many songs you have listened to during the last month (and all months prior to that).
Want to know which song you heard on your drive to work last tuesday? Now you can! Find out what genres (or artists, albums, songs) you listen to the most!

Installation

End-user Installation of Listory is not yet fully supported and the docs in this section are not complete. Please open an issue if you want to install this yourself, and I can help you through the process.

Configuration

All configuration must be set as environment variables. Default values are added in bold, values that are required are marked with Required.

Application

  • PORT: 3000: Port the webserver will listen on.
  • APP_URL: http://localhost:3000: Public URL of the Application, is used to generate Links.

Authentication

  • JWT_SECRET: Required, used to sign the JWTs.
  • JWT_ALGORITHM: HS256: Algorithm used to sign the JWTs. One of HS256, HS384, HS512
  • JWT_EXPIRATION_TIME: 1d: Lifetime of signed JWTs. Accepts strings like 1d, 2h, 15m.

Spotify

  • SPOTIFY_CLIENT_ID: Required, Spotify App Client ID
  • SPOTIFY_CLIENT_SECRET: Required, Spotify App Client Secret
  • SPOTIFY_FETCH_INTERVAL_SEC: 60: Interval for fetching recently listened tracks from Spotify.
  • SPOTIFY_UPDATE_INTERVAL_SEC: 60: Interval for updating previously imported music library entities (artist, album, track). Raise this number if you often hit the Spotify API Ratelimit.
  • SPOTIFY_WEB_API_URL: https://api.spotify.com/: Spotify WEB API Endpoint.
  • SPOTIFY_AUTH_API_URL: https://accounts.spotify.com/: Spotify Authentication API Endpoint.
  • SPOTIFY_USER_FILTER: "": If set, only allow Spotify users with these ids to access the app. If empty, allow all users to access the app. Seperate ids with , eg.: 231421323123,other_id.

Database

  • DB_HOST: Required, Database host
  • DB_USERNAME: Required, Database username
  • DB_PASSWORD: Required, Database password
  • DB_DATABASE: Required, Database database
  • DB_POOL_MAX: 50, max concurrent database connections

Sentry

You can use Sentry to automatically detect and report any exceptions thrown.

  • SENTRY_ENABLED: false, Set to true to enable Sentry.
  • SENTRY_DSN: Required, but only if SENTRY_ENABLED is true. The DSN for your Sentry project.

OpenTelemetry

We use OpenTelemetry to provide observability into Listory API.

The metrics will be exposed on a seperate port at :9464/metrics. Make sure that this endpoint is not publicly available in your deployment.

Traces will be sent to the specified endpoint.

To use observability tools locally, check out docker-compose setup in observability/.

  • OTEL_METRICS_ENABLED: false, Set to true to activate metrics.
  • OTEL_TRACES_ENABLED: false, Set to true to activate traces.
  • OTEL_EXPORTER_OTLP_ENDPOINT: Required, but only if OTEL_TRACES_ENABLED is true. The endpoint that traces are sent to, see OpenTelemetry docs
  • OTEL_EXPORTER_PROMETHEUS_PORT: 9464, Set to configure non-standard port for Prometheus metrics

Development

Configure Spotify API Access

Copy the file .env.sample to .env and add your Spotify API Key.

Starting the application

We use docker compose to provide a full local development environment.

$ docker compose up

You can now access the frontend at http://localhost:3000 and the API at http://localhost:3000/api.

Frontend and API will automatically reload on any code changes.

REPL Console

You can start the REPL console by starting the normal environment, and then running:

$ docker compose run console

Observability

If you want to start the observability suite (Metrics & Tracing) locally, you can use the observability docker compose profile:

$ docker compose --profile observability up

Grafana is then available at http://localhost:2345 and all sources are preconfigured.

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

License

Listory is MIT licensed.