helios 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8f49d72eae50b9d0f7b0fcd955286e930c6a008b
4
- data.tar.gz: 7a81dbf2013d8fbfd94f2f7a883c6c8d9144f43d
3
+ metadata.gz: ec8e7e4600d587e9ffb3c1c96a93e371c9000126
4
+ data.tar.gz: 6062579b3e86cdf248881d5785ac9679c240285f
5
5
  SHA512:
6
- metadata.gz: 9e3f0a41f0a7f4e4a514936ae48fee5cee7ddd216298a6d6dd8fd3f77fe37136bc3147f3d92ca5b699a593498746633741cbba3f77f6b341243248c4b034e04b
7
- data.tar.gz: 054897badfddb7935d3a88568f3059606e9b944414a0965c0d25ff9be24f5bb5e18440dedff336ae1cb05a9ee04bc5c7c9ff8a4b14a0cd31d7f33015dadd54ab
6
+ metadata.gz: 493b0388cfaa239908e63bfd07b8ec900c89ecd463f59382f7e83a93cd17f78bc970cd204f0beee710649a17da0fc986bf2491997ba1dc1ae7b1ad52a558ebad
7
+ data.tar.gz: debfe1d63f7497d469afc5ae59cc8a4ad9ec9eea26c150c4f1bc31ad410c2a10a11cbb19d3032e26b268c46dc181c2d53f628d2f96645b7662d166c811746a62
data/Gemfile CHANGED
@@ -1,5 +1,3 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- gem 'pg'
4
-
5
3
  gemspec
data/Gemfile.lock CHANGED
@@ -1,18 +1,19 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- helios (0.1.1)
4
+ helios (0.2.0)
5
5
  coffee-script (~> 2.2)
6
- commander (~> 4.1.2)
6
+ commander (~> 4.1)
7
7
  compass (~> 0.12)
8
+ foreman (~> 0.60)
8
9
  haml (~> 3.1)
9
10
  json (~> 1.7)
10
- omniauth (~> 1.0)
11
- rack-core-data (~> 0.2)
11
+ rack-contrib (~> 1.1)
12
+ rack-core-data (~> 0.3)
12
13
  rack-in-app-purchase (~> 0.1)
13
14
  rack-passbook (~> 0.1)
14
15
  rack-push-notification (~> 0.4)
15
- rack-smart-app-banner (~> 0.0.1)
16
+ rails-database-url (~> 1.0)
16
17
  sinatra (~> 1.3)
17
18
  sinatra-assetpack (~> 0.1)
18
19
  sinatra-backbone (~> 0.1.0.rc2)
@@ -28,7 +29,7 @@ GEM
28
29
  i18n (= 0.6.1)
29
30
  multi_json (~> 1.0)
30
31
  backports (3.1.1)
31
- chunky_png (1.2.7)
32
+ chunky_png (1.2.8)
32
33
  coffee-script (2.2.0)
33
34
  coffee-script-source
34
35
  execjs
@@ -39,13 +40,15 @@ GEM
39
40
  chunky_png (~> 1.2)
40
41
  fssm (>= 0.2.7)
41
42
  sass (~> 3.1)
43
+ diff-lcs (1.2.2)
42
44
  eventmachine (1.0.3)
43
45
  excon (0.17.0)
44
46
  execjs (1.4.0)
45
47
  multi_json (~> 1.0)
48
+ foreman (0.62.0)
49
+ thor (>= 0.13.6)
46
50
  fssm (0.2.10)
47
51
  haml (3.1.8)
48
- hashie (1.2.0)
49
52
  highline (1.6.16)
50
53
  houston (0.1.1)
51
54
  commander (~> 4.1.2)
@@ -53,23 +56,19 @@ GEM
53
56
  i18n (0.6.1)
54
57
  jsmin (1.0.1)
55
58
  json (1.7.7)
56
- multi_json (1.7.1)
59
+ multi_json (1.7.2)
57
60
  nokogiri (1.5.9)
58
- omniauth (1.1.3)
59
- hashie (~> 1.2)
60
- rack
61
- pg (0.14.1)
62
61
  rack (1.5.2)
63
62
  rack-contrib (1.1.0)
64
63
  rack (>= 0.9.1)
65
- rack-core-data (0.2.0)
66
- activesupport (~> 3.2.6)
64
+ rack-core-data (0.3.1)
65
+ activesupport (>= 3.0)
67
66
  nokogiri (~> 1.4)
68
67
  rack (~> 1.4)
69
- rack-contrib (~> 1.1.0)
70
- sequel (~> 3.37.0)
71
- sinatra (~> 1.3.2)
72
- sinatra-param (~> 0.1.1)
68
+ rack-contrib (~> 1.1)
69
+ sequel (~> 3.37)
70
+ sinatra (~> 1.3)
71
+ sinatra-param (~> 0.1)
73
72
  rack-in-app-purchase (0.1.0)
74
73
  rack (~> 1.4)
75
74
  sequel (~> 3.37)
@@ -88,14 +87,20 @@ GEM
88
87
  sequel (~> 3.37)
89
88
  sinatra (~> 1.3)
90
89
  sinatra-param (~> 0.1)
91
- rack-smart-app-banner (0.0.1)
92
- rack (>= 1.2.0, <= 2.0.0)
93
90
  rack-test (0.6.2)
94
91
  rack (>= 1.0)
95
- rake (0.9.6)
96
- rspec (0.9.4)
92
+ rails-database-url (1.0.0)
93
+ rake (10.0.4)
94
+ rspec (2.13.0)
95
+ rspec-core (~> 2.13.0)
96
+ rspec-expectations (~> 2.13.0)
97
+ rspec-mocks (~> 2.13.0)
98
+ rspec-core (2.13.1)
99
+ rspec-expectations (2.13.0)
100
+ diff-lcs (>= 1.1.3, < 2.0)
101
+ rspec-mocks (2.13.0)
97
102
  sass (3.2.7)
98
- sequel (3.37.0)
103
+ sequel (3.45.0)
99
104
  sinatra (1.3.6)
100
105
  rack (~> 1.4)
101
106
  rack-protection (~> 1.3)
@@ -119,6 +124,7 @@ GEM
119
124
  sinatra-support (1.2.2)
120
125
  sinatra (>= 1.0)
121
126
  terminal-table (1.4.5)
127
+ thor (0.18.1)
122
128
  tilt (1.3.6)
123
129
  venice (0.0.1)
124
130
  commander (~> 4.1.2)
@@ -133,6 +139,5 @@ PLATFORMS
133
139
 
134
140
  DEPENDENCIES
135
141
  helios!
136
- pg
137
- rake (~> 0.9)
138
- rspec (~> 0.6)
142
+ rake
143
+ rspec
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2013 Mattt Thompson (http://mattt.me/)
1
+ Copyright (c) 2013 Heroku (http://heroku.com/)
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,23 +1,299 @@
1
- # Helios
2
- **Coming Soon**
1
+ ![Helios - an extensible open source mobile backend framework](https://raw.github.com/helios-framework/helios.io/assets/helios-banner.png)
2
+
3
+ Helios is an open-source framework that provides essential backend services for iOS apps, from data synchronization and user accounts to push notifications, in-app purchases, and passbook integration. It allows developers to get a client-server app up-and-running in just a few minutes, and seamlessly incorporate functionality as necessary.
4
+
5
+ Helios is designed for "mobile first" development. Build out great features on the device, and implement the server-side components as necessary. Pour all of your energy into crafting a great user experience, rather than getting mired down with the backend.
6
+
7
+ One great example of this philosophy in Helios is Core Data Synchronization. This allows you to use your existing Core Data model definition to automatically generate a REST webservice, which can be used to shuttle data between the server and client. No iCloud, _no problem_.
8
+
9
+ ![Helios Web UI Screenshot](https://raw.github.com/helios-framework/helios.io/assets/helios-screenshot.png)
10
+
11
+ Helios also comes with a Web UI. Browse and search through all of your database records, push notification registrations, in-app purchases, and passbook passes. You can even send targeted push notifications right from the browser.
3
12
 
4
13
  ---
5
14
 
6
- // TODO
15
+ ## Requirements
16
+
17
+ - Ruby 1.9
18
+ - PostgreSQL 9.1 _([Postgres.app](http://postgresapp.com) is the easiest way to get a Postgres server running on your Mac)_
19
+
20
+ ## Getting Started
21
+
22
+ 1. Install Helios at the command prompt:
23
+
24
+ $ gem install helios
25
+
26
+ 2. Create a new Helios application:
27
+
28
+ $ helios new myapp
29
+
30
+ 3. Change directory to `myapp` and start the web server:
31
+
32
+ $ cd myapp; helios server
33
+
34
+ 4. Go to http://localhost:5000/admin and you’ll see your app's Web UI
35
+
36
+ Read on for instructions on the following:
37
+
38
+ - Linking a Core Data model
39
+ - Integrating Helios into your mobile client
40
+
41
+ ## Usage
42
+
43
+ Built on the Rack webserver interface, Helios can be easily added into any existing Rails or Sinatra application as middleware. Or, if you're starting with a Helios application, you can build a new Rails or Sinatra application on top of it.
44
+
45
+ This means that you can develop your application using the tools and frameworks you love, and maintain flexibility with your architecture as your needs evolve.
46
+
47
+ ### Sinatra / Rack
48
+
49
+ #### Gemfile
50
+
51
+ ```ruby
52
+ gem 'helios'
53
+ ```
54
+
55
+ #### config.ru
56
+
57
+ ```ruby
58
+ require 'bundler'
59
+ Bundler.require
60
+
61
+ run Helios::Application.new do
62
+ service :data, model: 'path/to/DataModel.xcdatamodel'
63
+ service :push_notification
64
+ service :in_app_purchase
65
+ service :passbook
66
+ end
67
+ ```
68
+
69
+ ### Rails
70
+
71
+ To create a Rails app that uses Postgres as its database, pass the `-d postgresql` argument to the `rails new` command:
72
+
73
+ $ rails new APP_PATH -d postgresql
74
+
75
+ If you're adding Helios to an existing Rails project, be sure to specify a PostgreSQL database in `config/database.yml` and check that the `pg` gem is included in your `Gemfile`:
76
+
77
+ #### Gemfile
78
+
79
+ gem 'helios'
80
+ gem 'pg'
81
+
82
+ Helios can be run as Rails middleware by adding this to the configuration block in `config/application.rb`
83
+
84
+ #### config/application.rb
85
+
86
+ ```ruby
87
+ config.middleware.use Helios::Application do
88
+ service :data, model: 'path/to/DataModel.xcdatamodel'
89
+ service :push_notification
90
+ service :in_app_purchase
91
+ service :passbook
92
+ end
93
+ ```
94
+
95
+ ## Available Services
96
+
97
+ Each service in Helios can be enabled and configured separately:
98
+
99
+ `data`: Generates a REST webservice from a schema definition. Currently supports Core Data (`.xcdatamodel`) files.
100
+
101
+ **Parameters**
102
+
103
+ - `model`: Path to the data model file
104
+
105
+ **Associated Classes**
106
+
107
+ Each entity in the specified data model will have a `Sequel::Model` subclass created for it under the `Rack::CoreData::Models` namespace.
108
+
109
+ <table>
110
+ <caption>Endpoints</caption>
111
+ <tr>
112
+ <td><tt>GET /:resources</tt></td>
113
+ <td>Get list of all of the specified resources</td>
114
+ </tr>
115
+ <tr>
116
+ <td><tt>POST /:resources</tt></td>
117
+ <td>Create a new instance of the specified resource</td>
118
+ </tr>
119
+ <tr>
120
+ <td><tt>GET /:resources/:id</tt></td>
121
+ <td>Get the specified resource instance</td>
122
+ </tr>
123
+ <tr>
124
+ <td><tt>PUT /:resources/:id</tt></td>
125
+ <td>Update the specified resource instance</td>
126
+ </tr>
127
+ <tr>
128
+ <td><tt>DELETE /:resources/:id</tt></td>
129
+ <td>Delege the specified resource instance</td>
130
+ </tr>
131
+ </table>
132
+
133
+ ---
134
+
135
+ `push_notification`: Adds iOS push notification registration / unregistration endpoints.
136
+
137
+ **Associated Classes**
138
+
139
+ - `Rack::PushNotification::Device`
7
140
 
8
- - Usage
9
- - By itself / Rack / Sinatra
10
- - With Rails
11
- - Explicitly documenting formats of models, what tables they reside in / depend on, how to override them, etc.
12
- - Deploying Helios to Heroku
13
- - When and How to migrate off of Helios
14
- - Who is Helios for
15
- - How to install helios
16
- - gem install
17
- - Gemfile
18
- - CLI usage
19
- - How to incorporate it into your iOS project
141
+ <table>
142
+ <caption>Endpoints</caption>
143
+ <tr>
144
+ <td><tt>PUT /devices/:token</tt></td>
145
+ <td>Register or update existing device for push notifications</td>
146
+ </tr>
147
+ <tr>
148
+ <td><tt>DELETE /devices/:token</tt></td>
149
+ <td>Unregister a device from receiving push notifications</td>
150
+ </tr>
151
+ </table>
20
152
 
153
+ ---
154
+
155
+ `in_app_purchase`: Adds an endpoint for iOS in-app purchase receipt verification endpoints, as well one for returning product identifiers.
156
+
157
+ **Associated Classes**
158
+
159
+ - `Rack::InAppPurchase::Receipt`
160
+ - `Rack::InAppPurchase::Product`
161
+
162
+ <table>
163
+ <caption>Endpoints</caption>
164
+ <tr>
165
+ <td><tt>POST /receipts/verify</tt></td>
166
+ <td>Decode the associated Base64-encoded <tt>receipt-data</tt>, recording the receipt data and verifying the information with Apple</td>
167
+ </tr>
168
+ <tr>
169
+ <td><tt>GET /products/identifiers</tt></td>
170
+ <td>Return an array of valid product identifiers</td>
171
+ </tr>
172
+ </table>
173
+
174
+ ---
175
+
176
+ `passbook`: Adds endpoints for the [web service protocol](https://developer.apple.com/library/prerelease/ios/#documentation/PassKit/Reference/PassKit_WebService/WebService.html) for communicating with Passbook
177
+
178
+ **Associated Classes**
179
+
180
+ - `Rack::Passbook::Pass`
181
+ - `Rack::Passbook::Registration`
182
+
183
+ <table>
184
+ <caption>Endpoints</caption>
185
+ <tr>
186
+ <td><tt>GET /v1/passes/:passTypeIdentifier/:serialNumber</tt></td>
187
+ <td>Get the Latest Version of a Pass</td>
188
+ </tr>
189
+ <tr>
190
+ <td><tt>GET /v1/devices/:deviceLibraryIdentifier/registrations/:passTypeIdentifier[?passesUpdatedSince=tag]</tt></td>
191
+ <td>Get the Serial Numbers for Passes Associated with a Device</td>
192
+ </tr>
193
+ <tr>
194
+ <td><tt>POST /v1/devices/:deviceLibraryIdentifier/registrations/:passTypeIdentifier/:serialNumber</tt></td>
195
+ <td>Register a Device to Receive Push Notifications for a Pass</td>
196
+ </tr>
197
+ <tr>
198
+ <td><tt>DELETE /v1/devices/:deviceLibraryIdentifier/registrations/:passTypeIdentifier/:serialNumber</tt></td>
199
+ <td>Unregister a Device</td>
200
+ </tr>
201
+ </table>
202
+
203
+ ## Command-Line Interface
204
+
205
+ Helios comes with a CLI to help create and manage your application. After you `$ gem install helios`, you'll have the `helios` binary available.
206
+
207
+ $ helios --help
208
+ helios
209
+
210
+ A command-line interface for building mobile infrastructures
211
+
212
+ Commands:
213
+ console Open IRB session with Helios environment
214
+ help Display global or [command] help documentation.
215
+ link Links a Core Data model
216
+ new Creates a new Helios project
217
+ server Start running Helios locally
218
+
219
+ ### Creating an Application
220
+
221
+ The first step to using Helios is to create a new application. This can be done with the `$ helios new` command, which should be familiar if you've ever used Rails.
222
+
223
+ $ helios new --help
224
+
225
+ Usage: helios new path/to/app
226
+
227
+ The `helios new` command creates a new Helios application with a default
228
+ directory structure and configuration at the path you specify.
229
+
230
+ Options:
231
+ --skip-gemfile Don't create a Gemfile
232
+ -B, --skip-bundle Don't run bundle install
233
+ -G, --skip-git Don't create a git repository
234
+ --edge Setup the application with Gemfile pointing to Helios repository
235
+ -f, --force Overwrite files that already exist
236
+ -p, --pretend Run but do not make any changes
237
+ -s, --skip Skip files that already exist
238
+
239
+ ### Linking a Core Data Model
240
+
241
+ In order to keep your data model and REST webservices in sync, you can link it to your helios application:
242
+
243
+ $ helios link path/to/DataModel.xcdatamodel
244
+
245
+ This creates a hard link between the data model file in your Xcode and Helios projects—any changes made to either file will affect both. The next time you start the server, Helios will automatically migrate the database to create tables and insert columns to accomodate any new entities or attributes.
246
+
247
+ ### Starting the Application Locally
248
+
249
+ To run Helios in development mode on `localhost`, run the `server` command:
250
+
251
+ $ helios server
252
+
253
+ ### Running the Helios Console
254
+
255
+ You can start an IRB session with the runtime environment of the Helios application with the `console` command:
256
+
257
+ $ helios console
258
+
259
+ This command activates the services as configured by your Helios application, including any generated Core Data models. The `rack` module is automatically included on launch, allowing you to access everything more directly:
260
+
261
+ > Passbook::Passes.all # => [...]
262
+
263
+ ## Deploying to Heroku
264
+
265
+ [Heroku](http://www.heroku.com) is the easiest way to get your app up and running. For full instructions on how to get started, check out ["Getting Started with Ruby on Heroku"](https://devcenter.heroku.com/articles/ruby).
266
+
267
+ Once you've installed the [Heroku Toolbelt](https://toolbelt.heroku.com), and have a Heroku account, enter the following commands from the project directory:
268
+
269
+ $ heroku create
270
+ $ git push heroku master
271
+
272
+ ## Integrating with iOS Application
273
+
274
+ ### Core Data Synchronization
275
+
276
+ With [AFIncrementalStore](https://github.com/AFNetworking/AFIncrementalStore), you can integrate your Helios app directly into the Core Data stack. Whether it’s a fetch or save changes request, or fulfilling an attribute or relation fault, AFIncrementalStore handles all of the networking needed to read and write to and from the server.
277
+
278
+ See ["Building an iOS App with AFIncrementalStore and the Core Data Buildpack"](https://devcenter.heroku.com/articles/ios-core-data-buildpack-app) on the Heroku Dev Center for a comprehensive guide on how to use AFIncrementalStore with the Core Data buildpack. An article for Helios is forthcoming, but aside from deployment, the instructions are essentially unchanged.
279
+
280
+ ### Push Notification Registration
281
+
282
+ ```objective-c
283
+ - (void)application:(UIApplication *)application
284
+ didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
285
+ {
286
+ NSURL *serverURL = [NSURL URLWithString:@"http://raging-notification-3556.herokuapp.com/"];
287
+ Orbiter *orbiter = [[Orbiter alloc] initWithBaseURL:serverURL credential:nil];
288
+ [orbiter registerDeviceToken:deviceToken withAlias:nil success:^(id responseObject) {
289
+ NSLog(@"Registration Success: %@", responseObject);
290
+ } failure:^(NSError *error) {
291
+ NSLog(@"Registration Error: %@", error);
292
+ }];
293
+ }
294
+ ```
295
+
296
+ ---
21
297
 
22
298
  ## Contact
23
299
 
@@ -25,8 +301,8 @@ Mattt Thompson
25
301
 
26
302
  - http://github.com/mattt
27
303
  - http://twitter.com/mattt
28
- - m@mattt.me
304
+ - <mattt@heroku.com>
29
305
 
30
306
  ## License
31
307
 
32
- Helios is available under the MIT license. See the LICENSE file for more info.
308
+ Helios is released under the [MIT](http://opensource.org/licenses/MIT) license.