GithubHelp home page GithubHelp logo

shopshopslive-rails's Introduction

US hub of Shopshops

Things you may want to cover:

  • Ruby version 2.5.1

  • Rails version 5.1.6

  • Database PostgresSQL

  • 运行test rspec spec/

  • API文档 /docs

  • Services (job queues, cache servers, search engines, etc.)

  • Deployment instructions

  • ...

Set up local environment (for Ubuntu & Mac OS):

  • Install RVM:

  • Install ruby version 2.5.1:

    • RVM makes your life easier, simply run command rvm install 2.5.1
    • If you failed to install it, try running the following commands then retry it:
       rvmsudo rvm cleanup all
       rvm get master
      
  • Install node.js:

    • Simply run the following commands
      sudo apt-get update
      sudo apt-get install nodejs
      
  • Install PostgreSQL (psql):

    • Simply run the following commands
      sudo apt-get update
      sudo apt-get install postgresql postgresql-contrib
      
  • Install bundler and rails:

    • Simply run following commands
      gem install bundler
      gem install rails
      bundle install
      
  • Install Redis

    • Run the following commands:
      sudo apt-get update
      sudo apt-get install redis-server
      
  • Create your local databases:

    • Run sudo -i -u postgres to open psql console
    • Create a role, run create user "shopsadmin" with password 'shopspassword'; grant create db permission to this user
    • If you haven't grant create db to shopsadmin, do it by ALTER USER shopsadmin CREATEDB;
    • Create a db for development, run create database "shopshops_development" owner "shopsadmin";
    • Create a db for testing purpose, run create database "shopshops_test" owner "shopsadmin";
    • To view list of db, enter \list and you shall find db shopshops_development and shopshops_test
  • Start server:

    • In terminal redirect to project's directory
    • Run rake db:migrate
    • Then run rails server to start your server
    • Your server is listening on port 3000, type localhost:3000 in browser address bar and press enter. You are now on rails
  • Ngrok:

    • Now you have to expose your local web server to the internet
    • We recommend using ngrok. Follow this tutorial to set it up
    • Redirect to directory where ngrok is, run command ./ngrok http 3000 and now you are exposed to the Internet
    • We recommend using a subdomain which makes your domain more meaningful. To do that, run command ./ngrok http -subdomain=<YOUR_SUBDOMAIN> 3000
    • Now you shall see the domain ngrok assigned to you in the terminal. Go to ngrok's console localhost:4040 in browser, it provides helpful info and logs for every single request
  • Change base url:

    • Your local server is now running, you have to modify the base url
    • Go to .env file, change the field BASE_URL=https://shopshops-hub.herokuapp.com to BASE_URL=<LOCAL_URL_GIVEN_BY_NGROK>
    • Restart server if necessary

shopshopslive-rails's People

Contributors

cappellettitadeo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.