项目作者: amastellone

项目描述 :
Mail-Funnel, a Shopify Embedded App available in the Shopify App Store
高级语言: JavaScript
项目地址: git://github.com/amastellone/mail-funnel-client.git
创建时间: 2016-10-30T07:45:01Z
项目社区:https://github.com/amastellone/mail-funnel-client

开源协议:

下载


Mail-Funnel-Client

Coverage Status Coverage StatusStories in Ready

Mail-Funnel is a Ruby on Rails Embedded Shopify App (Available in the Shopify App Store). It uses Her ORM to connect to it’s REST Server.

Mail-Funnel Project:

App Store Config

Development - .env

  1. APP_URL=http://localhost:3000/
  2. REDIRECTION_URL=http://localhost:3000/auth/shopify/callback

Client Security Method

We are using JWT, automaticaly added to the header on the Client, and added in the Rack on the server

  1. # Client
  2. https://www.sitepoint.com/introduction-to-using-jwt-in-rails/
  3. # Both
  4. https://github.com/nsarno/knock
  5. # Server (and maybe client)
  6. https://github.com/eigenbart/rack-jwt
  7. https://github.com/jgalmeida/rack-jwt-auth
  8. https://github.com/jwt/ruby-jwt
  9. https://jwt.io/

Developmet

  1. Visit (Development)
  2. http://localhost:3000

Testing

  1. rake
  2. # or
  3. rake test
  4. # Test Individual Client-API Tests
  5. bundle exec rspec ./spec/models/apps_spec.rb # Tests Apps w/ ORM to Server-API

Development

  1. rake test

Staging + Production

Deployment Process
Github -> Circle-CI Server -> Heroku-Staging -> Heroku-Production

  • Github
    • Pushed to GitHub
    • Code-Analysis Service(s) Executed Automatically
  • Circle-CI
    • coveralls.io - Test Coverage Executed
    • depbot.io - Dependency Analysis
  • Heroku-Staging
    • Builds temporary Heroku server, destroys 5 days after last use
    • Creates new Heroku server to test production data
  • Heroku-Production
    • Rollbar.io - Error / Log Monitoring + Reporting Tool
  • Mail-Funnel-Client

Usage + Install

Warning: You must
To start the client execute this

  1. bundle exec rails server

Then, to install this Shopify App, go to

  1. http://localhost:3000/login (or /install or /auth)

Once you have added the client, you must add the server too

  1. TODO: Server install URL is wrong
  2. http://localhost:3001/auth

Then once you visit the client - you will be forwarded to your App’s page in the Shopify store it was installed in.
NOTICE: Your app will not load by default, while it is being run on your localhost, because Chrome does not allow cross-site-scripting.
You MUST disable this by clicking the icon in the URL-bar, on the right, and telling it to load the script regardless

  1. Visit App Install Page
  2. http://localhost:3000 / mf-client.bluehelmet.io
  3. This will foward you to the Shopify Store's internal Mail Client App URL.
  4. http://your-store.myshopify.com
  5. Mail-Funnel API Server (Dev) / (Staging) / (Production)
  6. http://localhost:3001 / http://mf-server.bluehelmet.io

Developers

JS Resources for Funnel_Builder Ajax flowchart

bluehelmet-dev ~ Apps ~ Shopify

Working with JavaScript in Rails — Ruby on Rails Guides

akzhan/jquery-ujs: Ruby on Rails unobtrusive scripting adapter for jQuery

ActionController::RequestForgeryProtection

Active Model Basics — Ruby on Rails Guides

Action View Overview — Ruby on Rails Guides

ruby on rails 3 - Difference between Active Model, Active Record and Active Resource - Stack Overflow

ActiveModel | Running with Ruby

Active Record Query Interface — Ruby on Rails Guides

External articles · rails/jquery-ujs Wiki

jquery-ujs/rails.js at asynchronous-call-to-confirm · akzhan/jquery-ujs

Rails 3 Remote Links and Forms: A Definitive Guide - Alfa Jango Blog

Rails 3 Remote Links and Forms Part 2: Data-type (with jQuery) - Alfa Jango Blog

Rails jQuery UJS: Now Interactive - Alfa Jango Blog

A Tour of Rails’ jQuery UJS

rails/jbuilder: Jbuilder: generate JSON objects with a Builder-style DSL

Class: ActiveResource::Schema — Documentation for activeresource (4.0.0)

Rails 4: How to partials & AJAX, dead easy (Example) | Coderwall

Rails 4 rendering a partial with ajax, jquery, :remote => true, and respond_to - Stack Overflow

jquery - How to asynchronously load a partial page in rails - Stack Overflow

sdrdis/jquery.flowchart: JQuery plugin that allows you to draw a flow chart.

jQuery.ajax() | jQuery API Documentation

Automatically adding CSRF tokens to ajax calls when using jQuery

Rails 3: How to return errors in a JSON request? - Stack Overflow

rack/utils.rb at master · rack/rack