Skip to content

kumabook/pink-spider

Repository files navigation

Pink Spider

Build Status

Deploy

What's this?

Pink Spider is a music spider. Currently crawl YouTube and SoundCloud api with request of scraping track from web page.

Development

  1. Install asdf and run asdf install

  2. Install yarn and bundler

  3. Install dependencies

    cargo install
    yarn install
    bundle install
  4. Install posgresql and setup database

    • Create "postgres" role (password: "pink_spider"):

      createuser -d -U your_name -P pink_spider -s`
    • Create database

      rake db:create
      rake db:migrate
  5. Build and run backend

    cargo run --bin app
  6. Build frontend

    npm start # on another shell

Development on Docker

  • Install docker and docker-compose and docker-machine
    • brew install docker docker-compose docker-machine
  • Create container and prepare db
    • docker-compose up
    • docker-compose run --rm web rake db:create
    • docker-compose run --rm web rake db:migrate
  • Restore database from backup
    • cat latest.dump | docker exec -i docker-compose ps -q db pg_restore --verbose --clean -U postgres -d pink_spider_production

Testing

    cargo test
    npm run lint
    npm test

Deploy on heroku

    heroku apps:create pink-spider
    heroku buildpacks:set https://github.com/emk/heroku-buildpack-rust.git
    heroku buildpacks:set heroku/ruby
    heroku buildpacks:set heroku/nodejs
    heroku addons:create heroku-postgresql:hobby-dev
    git push heroku master
    heroku run rake db:migrate