Skip to content

iOS Tutorial Part I: Scaffold & Deploy

nickelskevin edited this page Apr 23, 2014 · 1 revision

The very first thing you want to do, no two ways about it, is install the FatFractal Engine on your development machine. Actually, there are precisely two ways about it: with your app's backend pointed to your local machine or pointed at the cloud.

The Hoodyoodoo Tutorial's sample app is written using the acme.fatfractal.com backend on the cloud, which means that it really works when you download it. To create and use your own backend, you need to follow the getting started sections below and change the baseUrl of the FatFractal instance to use yours. You can choose to deploy your backend either locally or in the cloud; it really is up to you. If you feel like keeping it away from the InterWebs, you may do that as well. You will want to jump for joy, upon learning that the FatFractal Engine is identical whether on your local setup or in the cloud. It's not a simulator. It is the whole schlemiel. If you do choose to work locally and deploy to the cloud later, it will work just as you would expect.

If you download the sample files, you will notice you can run the application immediately using the acme.fatfractal.com/hoodyoodoo backend that we have deployed. To create your own instance of the hoodyoodoo backend, you need to scaffold your application and configure the backend.
Setting up your own hoodyoodoo backend
First, create a directory for your project called hoodyoodoo. [fancy_code_box] > cd $HOME; > cd ffapps > mkdir hoodyoodoo > cd hoodyoodoo [/fancy_code_box]

Then, scaffold the application by doing the following using your domain:

[fancy_code_box]> <install directory>/fatfractal/runtime/ffnsbin/ffef newapp hoodyoodoo <your domain> [/fancy_code_box] Note: The domain refers to a domain you've registered in the FatFractal Console or during the installation process (e.g. 'acme' in acme.fatfractal.com)

This will create all the information your backend needs to work with your application.

Running in the Cloud
If you haven't already, go to the Console and add an application called hoodyoodoo to <your domain>. To deploy the now-scaffolded hoodyoodoo backend to the FatFractal Platform via the command line, you use the command ffef deployFFFabric: [fancy_code_box]> <install directory>/fatfractal/runtime/ffnsbin/ffef deployFFFabric[/fancy_code_box]

In a few seconds, your application will be available at http://<your domain>.fatfractal.com/hoodyoodoo For more information, see Getting Started.

Running locally
Assuming that you have installed the FatFractal Engine and it is running, you can deploy to your development machine via the command line using ffef deploylocal: [fancy_code_box]> <install directory>/fatfractal/runtime/ffnsbin/ffef deploylocal[/fancy_code_box]

Your application will be available at http://localhost:8080/hoodyoodoo

NB: In the FatFractal_Runtime/conf directory you will find a file called config_include.properties which tells the engine the ports on which to listen (defaults are 8080 for http and 8443 for https), and how frequently to scan for new deployments (default is every 5 seconds)

In either case, your app's backend is now in learn mode and ready to start persisting your backend data structures automatically. All you need to do is start using your application and it will learn what to store by itself until you turn off learning mode.

NEXT: Xcode Love