When we released the mobile application for CFSummit 2013, many of you had asked for the source code. And we said that we would make the source code public after the summit. So here is the source code of the application.
The application is developed using new mobile features of ColdFusion Splendor and Thunder. Since there are no public builds available as yet, you cannot run the application from the source. But this will give you an idea of how you could develop mobile applications using the new mobile development features of ColdFusion.
The application is not meant to be a reference implementation for developing mobile applications. We developed this app primarily to see how the mobile features we had implemented so far could be used in a real-world application, and at the same time provide a useful application to the conference attendees.
The application is implemented as a single page application. It uses JQuery, Bootstrap3, PathJS, JQuery Raty, Codebird, Cordova (PhoneGap), PhoneGap Build and LESS. index.cfm is the first page that is loaded. It includes index_include.cfm, which contains some initialization code and functions to display different pages in the application. Each page is implemented as a client side custom tag, e.g. session_list.cfm is the custom tag for displaying list of sessions.
All data access code is in CFCs and in the folder 'cfcs'. db_manager.cfc is the main data access CFC and contains other CFCs to manage schedule, speakers and notifications. There are two server-side CFCs - SurveyManager.cfc and ServerSessionSyncManager.cfc. Take a look at onSurveySubmit method in survey.cfm to see how to call a server side CFC from the client side.
If you want to know some of the details of how UI for this application was implemented and issues we faced, then take a look at this blog post - "My Experience of building UI of CFSummit2013 mobile app" .
A few things to keep in mind when you browse the code -
- Again, this is not a reference implementation. We were racing against time to complete this application and submit to app stores so that it would be available before the summit. So we might have taken a few shortcuts when implementing the app.
- Naming of functions, variables and file names in inconsistent. This is because when we started working on this, client side code was case sensitive. So we named everything in lower case. Later we made cfclient case-sensitive, but did not change the code we had already written.
- Variable scope was not implemented initially. So you might see many variables outside functions not scoped at all - they become global variables.
- Exception handling for query (cfquery and queryExecute) was being implemented. So you will not see proper exception handling for query in the code. All query code should ideally be in try-cach block.
- LESS files should ideally be pre-compiled to CSS. But we did not do this for two reasons - a) our CSS files were not too big, so performance penalty of converting LESS to CSS at runtime was small and b) setting up LESS compiler (setting up Node.js etc.) would have taken some of our time and our schedule was already very tight.
- You will see some of the image files used by Raty in the root of the application. We found that moving those images to images sub folder did not display Raty starts properly. So we had to leave them in the root.
- We did not create any relationship between sessions and speakers tables. This was deliberate. This data was pre-defined and not editable. Also we wanted to keep the code and updates simple.
35 Comments to “Source code of CFSummit2013 mobile application”
Comments now closed