CodeScrobble is a web application that makes it easy to scrobble your CD or vinyl records to Last.fm by scanning the barcode with your smartphone camera.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
In order to run a local version of the application you need to install the following tools:
- NVM or Node.js (v10.15.1)
- Yarn for npm package handling
- MongoDB as Database
- Redis as key-value store for session handling
In addition to the software requirements, you need access to the following APIs:
First you need to clone the repository from github:
git clone git@github.com:dpuscher/code-scrobble.git
cd code-scrobble
When you are using nvm
to manage your node installation use these commands to install and use the correct version
nvm install
nvm use
Afterwards you need to install all dependencies:
yarn install
To configure your application you need to set some environment variables. To do this easily you can just add a .env
file in the root directory:
DISCOGS_KEY=...
DISCOGS_SECRET=...
LASTFM_KEY=...
LASTFM_SECRET=...
MONGODB_URI=mongodb://localhost:27017/codescrobble
REDISCLOUD_URL=redis://localhost:6379
SERVER_URL=http://localhost:3000
SESSION_SECRET=...
Discogs and Last.Fm Keys and Secrets are received from the developer websites mentioned above.
The session secret is used to sign the session id cookie and can be any string you want.
To run the application with hot-releading you can run it in development mode:
yarn dev
CodeScrobble is now accessible at http://localhost:3000
You can adjust the port by setting the PORT
environment variable.
Jest is used as a test runner in this project:
yarn test
You can also use watch-mode and display the current test coverage:
yarn test:watch
yarm test:coverage
ESLint
and stylelint
are used to check the coding style of the project:
yarn lint
yarn lint:css
To deploy the project on a live system you just need to check it out on your server, install the dependencies (see "Installation"), add the config file and run the following commands:
yarn build
yarn start
- Daniel Puscher - Initial work - dpuscher
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE.md file for details