Skip to content

BabsLabs/code_songs

Repository files navigation

CodeSongs

Description

CodeSongs Demo Gif

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.

Purpose

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.

Focus Areas

  • 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

APIs Used

Tech/Framework Used

CodeSongs is written in Ruby with Ruby On Rails, uses a postgresql database, and is hosted on Heroku with the Travis CI integration tool.

Gems

The following Ruby Gems are used in this project:

Database

Database Diagram

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.

Database Diagram

Database Setup

Local Environment:

  • bundle exec rake db:create
  • bundle exec rake db:migrate
  • bundle exec rake db:seed

Running Tests:

  • 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>

Using Fiagro in development and testing:

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.

Required Environment Variables

Environment variables and required API keys/tokens (in Figaro format) :

  1. GitHub ID defined as ENV['GITHUB_ID']
  2. GitHub ID defined as ENV['GITHUB_SECRET']
  3. GitHub Token defined as ENV['GITHUB_TEST_TOKEN']
  4. MusixMatch Token defined as ENV['MUSIX_MATCH_TOKEN']

Refreshing VCR Test Cassettes

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.

Versions

  • Ruby 2.4.1
  • Rails 5.2.4

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •