Compare your music preferences to your friends starting with the ability to create playlists that with just your music, just your friend's music, or music you've both loved.
Test
You'll just need...
npm install
Create a .env
file in the root directory.
cp .env.example .env
Update...
- Spotify Client Id -
SPOTIFY_CLIENT_ID
- Spotify Client Password -
SPOTIFY_CLIENT_SECRET
- Last.fm API Key -
LASTFM_API_KEY
- Last.fm Shared Secret -
LASTFM_SHARED_SECRET
- Session Secret -
SESSION_SECRET
- Admin API Secret -
API_SECRET
Update the DATABASE_URL
if you want to connect to a remote database. The DATABASE_URL
included in .env.example
is configured to use the Dockerized database included in the docker-compose.yml
file.
- Resource | last.fm | Create API Account
- Consideration | last.fm api accounts are very easy to get. Just fill out a quick form.
- Resource | Spotify | Getting started with the Web API
npx prisma migrate dev # This will apply to the database specified in the DATABASE_URL of your .env
You can download a sample data set of 4 listeners here: music.adambechtold.xyz/api/setup/seed.zip
It contains a series of .dump
files which you can load into your database using the method of your choice. If you're having trouble with this, comment on this issue.
# If you have your own database running and modified DATABASE_URL in step 2
npm run dev
# If you want to use the pre-configured Dockerized database for local development
npm run dev:local
Start the cron jobs that track listening history and research additional information about tracks.
npx ts-node src/music/cron/scheduleJobs.cron.ts \
updateListeningHistory \
createListens \
addTrackFeatures
Consider running these in separate screen
instances.
- 📝 Documentation - Admin API
- Create a
.env.test.local
file
cp .env.example .env.test.local
- Configure the
DATABASE_URL
to connect to the test database hosted by Docker
# Filename: .env.test.local
...
DATABASE_URL='mysql://root:test@localhost:3306/test'
...
npm run test
The Dockerized database for tests will start running and tests will be executed.
CREATE USER 'grafana'@'%' IDENTIFIED BY 'grafana';
GRANT SELECT ON taste_explorer.* TO 'grafana'@'%';
cd dashboard && docker compose up
Your starting login information is:
- Username:
admin
- Password:
admin
Head to Home
> Connections
> Data Sources
> Add Data Source
Adam will update this after some initial work on the dashboard.
Sometimes, the browser doesn't allow non-SSL-protected resources to load, even from localhost.
The fastest way to get around this is to simply forward traffic through a service like VS Code port forwarding. ngrok is another common service for this.
(If you know a better way around this, let me know!)