Giter Site home page Giter Site logo

purchasing's Introduction

Purchasing

An API for Surfdome Purchasing built in Rails. Currently comes packaged with a frontend for purchase processing built in React.

Originally brought to you by the Made Tech team.

Accessing the app

env url user password
production https://purchasing.surfdome.io purchasing lastordersplease
staging https://purchasing.surfdome.cc purchasing lastordersplease

Installation

  • Clone this repo.
  • Install the Docker Toolbox.
  • Run the docker quickstart terminal (cmd-space should find it) to set up the VirtualBox VMs.
  • Run docker-machine start default to start the VM.
  • Run eval $(docker-machine env default) to bootstrap the env vars. Either add this line to your bashrc or run it in each new tab you open (For fish shell, use eval (docker-machine env default)).
  • Now follow the development information below

If Not Using Docker

If you aren't using docker, you may have trouble installing 'therubyracer' with bundle. In that case you may have to manually install it locally. You should try:

gem uninstall libv8
gem uninstall therubyracer
brew install v8
gem install therubyracer
bundle

Developing

Updating gems

docker-compose build

Now run the following in another tab to setup your DB:

docker-compose run web rake db:setup

Booting the project for the first time

docker-compose up

This will boot the rails server. To connect in the browser, visit the docker host IP at port 3000 (e.g. http://192.168.99.100:3000/). To find out the IP simply run:

docker-machine ip

Now import the redacted dataset to your local DB. We usually do this using SequelPro connected to your docker DB instance. To connect to the DB via sequel pro, run docker-machine env default and use the IP of the docker host, and use the port 13306.

Reset your DB

docker-compose run web rake db:reset

Now import the redacted dataset to your local DB.

Developing frontend

In order to build the app and watch for changes you make, run

  npm run dev

The first build takes a bit of time but subsequent builds will be faster.

Running tests locally

docker-compose run web rspec

Running entire build locally

docker-compose run web rake build

Deploying

ensure local master is up to date

> git checkout master
> git pull -r origin master

ensure local production is up to date

> git checkout production
> git pull -r origin production

rebase production to master

> git checkout production
> git rebase master

Push branch to github to trigger deployment

> git push origin production

Once CI passes, a release will be triggered. Check #tech-purchasing and #frankie-debug for info.

Advanced mode

Staff who require advanced mode can add a bookmark with the following URL:

javascript:void(window.store.dispatch({ type: 'ADVANCED_MODE' }));

Clicking this whilst looking at the purchasing app will enable advanced features.

purchasing's People

Contributors

lukemorton avatar alex-min avatar fmd avatar chrisblackburn avatar adzz avatar rrpff avatar tonysurfdome avatar dcoxall avatar bkarakashev avatar arepo avatar korki avatar dearshrewdwit avatar harsh438 avatar

Watchers

James Cloos avatar  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.