Find the perfect song for your codebase with CodeSongs!
CodeSongs allows a user to select a GitHub repository and a musical artist and then "Songify" their code to find that artists best matching songs for the code. To do so CodeSongs uses IBM's Watson Tone Analyzer to identify the occurring sentiments in the code as well as in the selected artists top songs. CodeSongs then uses a proprietary algorithm to match the repo with the best suited songs.
This repository is for the CodeSongs front end. For the CodeSongs Microservice please see the repository page on GitHub.
The purpose of this project was to build and connect to a microservice, practice OAuth, database design, background workers / cron tasks, API calls, and to build a postgresql database.
- Consuming a number of various APIs
- Authenticated API calls
- Building features on Greenfield Code
- Building a Microservice
- Building a postgresql database in Sinatra
- Writing a cron task to automatically make API calls to seed and update database
- Test driven development
- Project planning
- Work with a deadline
- Prioritizing code functionality vs best practices
CodeSongs is written in Ruby with Ruby On Rails, uses a postgresql database, and is hosted on Heroku with the Travis CI integration tool.
The following Ruby Gems are used in this project:
- faraday
- figaro
- omniauth-github
- capybara
- factory bot
- faker
- vcr
- simple cov
- webmock
- shoulda-matchers
- database_cleaner
- skylight
CodeSongs is primarly a backend application that is driven by API endpoints and data comparison logic and as such the frontend has a very simple database.
bundle exec rake db:create
bundle exec rake db:migrate
bundle exec rake db:seed
-
You can run the full testing suite with the command
bundle exec rspec
-
You can run an individual test using
bundle exec rspec <path-to-file>
Keep environment variables secure by using Figaro to generate an application.yml
file. See more information about using the figaro gem at https://github.com/laserlemon/figaro.
Environment variables and required API keys/tokens (in Figaro format) :
- GitHub ID defined as
ENV['GITHUB_ID']
- GitHub ID defined as
ENV['GITHUB_SECRET']
- GitHub Token defined as
ENV['GITHUB_TEST_TOKEN']
- MusixMatch Token defined as
ENV['MUSIX_MATCH_TOKEN']
From time to time you may receive an error when testing with the VCR. You can delete the cassettes directory from your spec
folder and run bundle exec rspec
to refresh the cassettes used. More information on VCR cassettes can be found in the VCR documentation.
- Ruby 2.4.1
- Rails 5.2.4