Giter Site home page Giter Site logo

thattimc / sprionic-demo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from joshnuss/sprionic-demo

0.0 0.0 0.0 6.21 MB

Demo Spree+Ionic Android/iOS App

JavaScript 94.35% CSS 5.05% CoffeeScript 0.04% HTML 0.48% Shell 0.01% Haxe 0.01% Makefile 0.02% Nix 0.01% OpenSCAD 0.01% ABAP 0.01% ActionScript 0.01% Ada 0.01% Assembly 0.01% AutoHotkey 0.01% Batchfile 0.01% C++ 0.01% Cirru 0.01% Clojure 0.01% COBOL 0.01% ColdFusion 0.01%

sprionic-demo's Introduction

Spree + Ionic Android/iOS Demo

This is a toy project for playing with Spree/ionic integration

Links:

Frontend technologies used: gulp, sass, coffeescript, jade

Installation

Setup a Spree demo site

rails new ionic-store
cd ionic-store
spree install --auto-accept

Add CORS

The Spree API needs to allow cross domain access, for that we'll need CORS headers in all API responses.

To do that, open your Gemfile and add:

gem 'rack-cors', require: 'rack/cors'

Then run bundler:

bundle

In your config.ru, add the cors middleware:

use Rack::Cors do
  allow do
    origins '*'
    resource '*', headers: :any, methods: %i(get post delete put options head)
  end
end

Start a rails server on an IP your phone can access:

rails server -b 192.168.X.Y

Install node.js packages

Install cordova and ionic

npm install -g cordova ionic gulp
cd sprionic-demo && npm install

Install Android/iOS dev tools

For Android, install stand alone dev tools, and android-19 packages:

https://developer.android.com/sdk/installing/index.html

For iOS, install XCode:

https://developer.apple.com/xcode/downloads/

Development

Watch .coffee and .scss, and run app in local browser with live-reload:

gulp watch
ionic serve

Test on device

Android

Enable development mode on your device (click Settings -> About -> Click on build number 7 times)

ionic run android --device

iOS

TBD

Build

ionic build android
ionic build ios

sprionic-demo's People

Contributors

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