Git Product home page Git Product logo

doctor-frontend's Introduction

Doctor Front End

Small Rails API to serve up to a React Front End

Rails API

https://github.com/abrahamkinney/doctor-api

Clone the Repository

https://github.com/abrahamkinney/doctor-frontend

-- Make sure you have Node and NPM installed --

Install Node Package

npm insall

Install Redis

brew install redis

Install Node

brew install node

Install Node Packages

npm install

Setup Databases

brew install postgres

NOTE: do NOT run standard Rails db tasks like rake db:migrate Management of the lootcrate database for all projects is handled via ldbm, the Lootcrate database manager. For instructions see the README in the lootcrate/ldbm repository.

Populate Database with Plans Data

Install Heroku

brew install heroku

(ensure you have been given Heroku permissions to access lootcrate fastly) Run the following command: bash bin/copy_plans_pages.sh lootcrate-fastly local

Setup Front-End Assets

npm install -g bower
bundle exec rake assets:precompile

Setup Testing Dependencies

brew install phantomjs
bundle exec rake db:test:prepare
Creating Test Users

Instructions: Run rake command below with desired test user. It will create all necessary data in database and recurly. It will output the email/password.

bundle exec rake create_test_users:with_one_active_subscription
bundle exec rake create_test_users:help (list of commands)

Working in Development

Start the Lootcrate API Server:

bash -c 'cd ../lootcrate-api-grape/ && bundle exec rackup'

Start Foreman

bundle exec foreman start -f Procfile.development

Create test database

createdb lootcrate_test

Running Tests

bundle exec spec
npm test

Use the flag --watch to run tests on based on file changes.

npm test -- --watch

Run client mocha/chai/sinon/enzyme test

npm run mochaTest

Run the full test suite (Jest/Mocha/chai/sinon/enzyme)

npm run testSuite

The JS Jasmine test suite that may be ran from the client browser using Teaspoon

http://localhost:3000/teaspoon

To run all Jasmine tests:

http://localhost:3000/teaspoon/default

I18n

Shipping currently only United States and Canada. Billing supports all countries.

Deployment on Heroku

Since we are using a node and ruby buildpack, we will need to set that up in our Heroku's application. The order of buildpack execution matters here: assets must be bundled and packaged by webpack before we precompile using the assets pipeline.

heroku buildpacks:clear --app <app_name>
heroku buildpacks:set heroku/nodejs --app <app_name>
heroku buildpacks:add heroku/ruby --index 2 --app <app_name>

doctor-frontend's People

Contributors

abrahamkinney 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.