14 May 2014

Open Source Code for Real Time Wine

As I promised in the closing down email and the post mortem "lessons learned" article - here is the code for Real Time Wine.

A couple of things:

a) Thank you to Prezence Digital for compiling this. I know agencies haven't quite embraced the "open source" thing, so I think it was a big step for them and I hope they get some joy and cool community engagement out of it.

b) That said, there are a few modules used in Real Time Wine that remain proprietary to them and are not in this download. Mainly it's their handset adaption tech (phone recognition and rendering a mobi style site according to screen size) and image manipulation tool.

c) This download excludes images (that download would be about 4GB). I'm also not sure that it can just be executed as is (in fact, it probably can't)... There are a few notes (included at the bottom of this post) that Prezence provided. If you're a developer, you should understand what's going on.

d) Remember the apps weren't built natively. To remain lean, we built a sexy mobi interface and the wrapped that up in some native code which controlled GPS, camera and a few other functions.

e) The Blackberry 10 App was native though.

f) If you use any of this, just let us know. Keep us in the loop. Or not. But it'd be nice. If we did something wrong, no haters. If we did something cool, pats on back absolutely welcome.

g) Any questions, chat to me on Twitter.

Enjoy. Hope it helps. Without further ado...



If you need any context on Real Time Wine, suggest scrolling through all the posts on this blog. This link will get you there: early posts with context and launch info / more recent posts with the closure announcement and post mortem.

Or read some of the early PR: TechCentral article / Daily Maverick Article


Developer Notes on Real Time Wine

Android Configuration:
These are the project folders:
realtime_wine_android

These depend on the Facebook android library project which can be found in the "android_facebook" project.

To change environment variables, see com.real_time_wine.BaseActivity:
public String baseUrl = "http://www.realtimewine.com";
protected static final String URL_HOMEPAGE = "/wine/trending";
protected static final String URL_LOGOUT_IDENTIFIER = "/users/logout";

BB10 Configuration:
BB10 source can be found in the folder real_time_wine_bb10.

To change the environment variables see the CustomDatasource.cpp file. The project is reliant on an api that is produced by the mobi site. The api_url has to be set to wherever the mobi site is deployed.

IOS Configuration:
iOS source can be found in the folder realtimewine_ios.

To change the environment variables see the RTWViewController file.
The BaseURLString has to point to wherever the mobi site is deployed.

Web Configuration:
The web files (front-ends and api) can be found in the folder realtimewine_web.

/app/config/core.php
For the front-end, the following values will need to be modified:

Configure::write('blog_url', 'http://blog.example.com/');
Configure::write('advertising_url', 'http://blog.example.com/p/advertise.html');
Configure::write('info_email', 'info@example.com');
Configure::write('Bitly.User', '');
Configure::write('Bitly.Key', '');
Configure::write('Google.analytics_key', '');
Configure::write('webserviceUrl', 'http://api.example.com/api/');
Configure::write('imageUrl', 'http://api.example.com/files/');
Configure::write('frontendUrl', 'http://example.com/');
Configure::write('apiUrl', 'http://api.example.com/');
Configure::write('cdnUrl', 'http://example.com/');

Social Links and App download links should be configured in core.php
Configure::write('app.download.itunes', '');
Configure::write('app.download.google', '');
Configure::write('app.download.samsung', '');
Configure::write('app.download.vodacom', '');
Configure::write('app.download.amazon', '');

/app/config/device_sniffer.php
Sidekicker API details required for content adaptation - see prezence.co.za for contact details.

// The authentication username.
$config['DeviceSniffer']['username'] = '';
// The authentication password.
$config['DeviceSniffer']['password'] = '';
// The encryption key used when interacting with the api.
$config['DeviceSniffer']['key'] = '';

/app/config/database.php
Database details required.

public $live = array(
        'driver' => 'mysql',
        'persistent' => false,
        'host' => '',
        'login' => '',
        'password' => '',
        'database' => '',
        'prefix' => '',
        'encoding' => 'utf8',
    );

Regarding Proprietary Code:
Certain parts of the web souce have been encoded with popular encryption software, ionCube.
The software to run the encrypted source, can be obtained free of charge on the ionCube website http://www.ioncube.com/.

~fin~


Image credit: Roo Reynolds. https://www.flickr.com/photos/rooreynolds/8574509123