GithubHelp home page GithubHelp logo

diazbeach / rack-core-data Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mattt/rack-scaffold

0.0 1.0 0.0 225 KB

Automatically generate REST APIs from Core Data models

License: MIT License

rack-core-data's Introduction

Rack::CoreData

Automatically generate REST APIs for Core Data models

This is still in early stages of development, so proceed with caution when using this in a production application. Any bug reports, feature requests, or general feedback at this point would be greatly appreciated.

Core Data Model API Endpoints
  • GET /artists
  • POST /artists
  • GET /artists/1
  • PUT /artists/1
  • DELETE /artists/1
  • GET /artists/1/songs

Building web services for iOS apps is a constant struggle to coordinating data models. You're probably not running Objective-C on the server, so you're stuck duplicating your business logic--allthewhile doing your best to maintain the correct conventions and idioms for each platform.

Rack::CoreData aims to bridge the client/server divide, and save you time.

Simply point Rack::CoreData at your Core Data model file, and a RESTful webservice is automatically created for you, with all of the resource endpoints you might expect in Rails. And since we're running on Rack, each endpoint can be overriden if you need to add or change any existing behavior. Likewise, any of the models can be re-opened to make any necessary adjustments.

Think of it like an API scaffold: while you may throw all of it away eventually, having something to start with will allow you to iterate on the most important parts of your application while you're the most excited about them.

Usage

The easiest way to use Rack::CoreData is to deploy to Heroku using the Core Data Buildpack. Just git push your .xcdatamodel file to Heroku, and you'll have a REST webservice up and running in a matter of seconds.

Gemfile

source :rubygems

gem 'rack-core-data', :require => 'rack/core-data'

gem 'thin'
gem 'pg'

config.ru

require 'bundler'
Bundler.require

# Rack::CoreData requires a Sequel connection to a database
DB = Sequel.connect(ENV['DATABASE_URL'] || "postgres://localhost:5432/coredata")

run Rack::CoreData('./Example.xcdatamodeld')

Examples

An example web API using a Core Data model can be found the /example directory.

It uses the same data model as the AFIncrementalStore example iOS project, so try running that against Rack::CoreData running on localhost.

Contact

Mattt Thompson

License

Rack::CoreData is available under the MIT license. See the LICENSE file for more info.

rack-core-data's People

Contributors

caleywoods avatar larrylegend avatar marshallmick007 avatar mattt 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.