Categorygithub.com/rustic-beans/spotify-viewer
module
0.0.0-20250221075718-6b6caedcced4
Repository: https://github.com/rustic-beans/spotify-viewer.git
Documentation: pkg.go.dev

# README

Spotify Viewer

A website for viewing what is currently playing on Spotify

Logo

Github Latest Release Github Actions Build Github Actions Tests Go Reference

What is it?

This project is a basic server-client application that allows users to view what is currently playing on their Spotify account through a website. The backend server is written in Go and uses the Spotify API to get information about the user's spotify account. The server will log songs that the user listens to in a SQLite database, the logic for when the server logs a song is explained in the docs here WIP. The frontend is written in Vue 3. The frontend will display the currently playing song (e.g. album art, artist name and song name), how far into the song the user is, as well as a small history of the last songs played and the future queue of songs to be played.

Dependencies

We use sqlc to generate the database code, you can install it by running

go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest

Usage

Run

To run the backend first configure the config variables by copying config-example.yaml to config.yaml and filling in the values.

To get the clientId and clientSecret first follow the instructions here to create an app, and then get the values from the Spotfy App dashboard.

Then you have to generate the GraphQL schema and database types by running

make generate

Every time you change something in ent/schema you have to run this command again.

Then run the backend with the following command:

make start

Frontend

Development

cd web
npm i
npm run generate
npm run dev

Build

cd web
npm i
npm run build

CI

This project primarily uses Dagger for CI. To run the CI locally you can use the following command:

dagger call publish --source=.

And then run the resulting container with:

mkdir dockerdata
cp config.yaml dockerdata/config.yaml
cp token.json dockerdata/token.json
docker run -v $(pwd)/dockerdata:/app/config -p 8080:8080 <container url> 

# Packages

No description provided by the author