Bestmix

screenshot of Bestmix

Boilerplate to develop both iOS/Android app and Rails-based backend integrated with each other

Overview

Bestmix is a boilerplate code that provides a basic structure to build an iOS app, Android app, and Rails-based backend. It allows for the integration of a mobile app and backend web API using JSON REST API. The code supports features such as CRUD operations, pagination, caching, OAuth2, and Facebook integration. The sample app provided is a simple blog engine.

Features

  • JSON REST web API integration for server-side and iOS app
  • Authentication options including basic authentication and Facebook login
  • OAuth2 authorization for web API
  • API versioning
  • Admin UI for managing the backend
  • Storing authorized tokens securely in Keychain for iOS app
  • Parsing and importing JSON objects into Core Data as local cache for iOS app
  • HTTP caching for improved performance and offline access
  • Android app integration with JSON REST web API
Server-Side
  1. Install Ruby on Rails and RVM (if not already installed).
  2. Copy server/config/database.yml.example to server/config/database.yml and modify it to match your own database server configuration.
  3. Copy server/config/initializers/devise.rb.example to server/config/initializers/devise.rb and modify it according to your authentication requirements.
  4. Set the config.mailer_sender attribute in the server configuration file.
  5. If you plan on using Facebook login, enable the setting at the bottom and modify the APP_ID and APP_SECRET variables.
  6. Run the following commands: cd server; bundle; rake db:setup; rake db:migrate; rails s (or setup your preferred web server such as Apache or nginx).
  7. Open the URL http://localhost:3000/ to access the web app and http://localhost:3000/admin to access the admin page using the following credentials:
    • Email: admin@example.com
    • Password: password
Register iOS App to Web API
  1. Open the admin page: http://localhost:3000/admin.
  2. Click on "Applications".
  3. Click on "New Application" at the bottom of the applications page.
  4. Input the app information in the form:
    • Name: <your iOS app name>
    • Redirect URL: bestmix://auth (If you are developing your own app instead of using the sample app, make sure to change the URL schema to match your own app)

Summary

Bestmix is a boilerplate code that provides a solid foundation for building a mobile app and backend web API. It offers features such as JSON REST API integration, authentication options, API versioning, and admin UI. The installation process involves setting up the server-side code, registering the iOS app with the web API, and making necessary configurations. Bestmix is a comprehensive solution for developers looking to build a mobile app and backend system.