Yesterday, I discussed the CompHound datatable implementation and thought I would be able to deploy to Heroku for you to try it out right away.
That took a moment longer than expected due to one little hiccup.
Here are my steps towards discovering and resolving it, and a few other topics that also arose in the meantime:
- Cloud9
- Online slide deck and easy github.io domain rerouting
- CompHound deployment to Heroku
- Heroku requires HTTPS
- Recent CompHound commits
- Try it out live
- CompHound road map
- Self-sufficient urban farming on 1/10 of an acre
Cloud9
Are you aware of Cloud9?
Philippe Leefsma created a boilerplate sample for using the View and Data API.
Based on that, you can have your viewer-based web application up and running within minutes.
Philippe guides us through the required steps in full detail in his first try at Cloud9, View & Data API boilerplate.
If you are interested in more general information, the tutorial on Github, Cloud9, NodeJS & Heroku: develop & deploy a web(socket) application and the Cloud9 document on deploying via the command line might fit the bill.
So cool.
Let alone the fact that Cloud9 sports one of the shortest URLs I know, c9.io.
Online Slide Deck and Easy GitHub.io Domain Rerouting
Last week, I explored how to set up a Google domain and reroute it to display a github.io web page.
This week, Shiya Luo gave a presentation on the View and Data API to the Monday night Atlanta JS meetup group.
She created a really nice online slide deck for that, very much to the point, accessible from shiyaluo.com/atl-js, using reveal.js.
I congratulated her on the super slides, cool hosting on her own domain, and enthusiastic feedback from participants on the meetup site.
Here is her explanation how this rerouting was achieved:
Thanks, what I did is I routed
shiya.github.io
’sCNAME
to my own domainshiyaluo.com
. Every page (a repo with a branch calledgh-pages
and anindex.html
) I create on Github automatically becomesshiyaluo.com/reponame
. The original repo to my slides is github.com/shiya/atl-js.
That sounds easier than Kean's and my approach fiddling around with the Google domain settings.
Addendum by Cyrille: I you would like to know what Shiya did for the cname redirection, read the GitHub documentation on Setting up a custom domain with GitHub Pages.
If you are interested in using reveal.js for presentations, there is an editor here, or you can deploy on heroku. You obviously need to make sure you have a reliable Internet connection when presenting, or configure your system for offline viewing.
[Q] Many conferences require you to submit PDF or PPTX slide decks beforehand. Is it easy to transform a HTML slide deck to pptx and pdf?
[A] Yes and no:
- Easy if you export to images
- Hard to extract as markup definition
Addendum by Jeremy: I implemented the PowerPoint slide deck text extractor command line tool for the inverse operation, to extract markup, or at least the pure text content, from a PPTX.
CompHound Deployment to Heroku
I am really getting the hang of this Heroku deployment thing.
While I was writing yesterday's post, I thought it might be nice to show you what I am up to, live.
In other words, I wanted to deploy the CompHoundWeb server in the wide wild web and not just locally for only me to enjoy.
Since it already lives in its own cosy little CompHoundWeb GitHub repository, nothing is easier than that.
I created a new Heroku app for it, connected it to the GitHub repo, deployed, and had it up and running within minutes.
But...
There is a reason why I did not add this note right away to yesterday's post:
Heroku Requires HTTPS
I hit one little snag that took me a while to sort out:
The datatable view only displayed the table header and footer. All the content was missing.
Some exploration revealed the problem: the datatable CSS and JavaScript files were failing to load.
On my local machine, running locally, using localhost
, the app is accessed via HTTP.
On Heroku, all access is HTTPS.
On Heroku, it therefore refused to access the unsafe datatable CSS and JavaScript files.
They were being pulled in like this by views/index.jade
:
link(rel='stylesheet', href='http://cdn.datatables.net/1.10.5/css/jquery.dataTables.min.css') script(type='text/javascript', src='http://cdn.datatables.net/1.10.5/js/jquery.dataTables.min.js')
Once I discovered that and added the missing s
, all was fine:
link(rel='stylesheet', href='https://cdn.datatables.net/1.10.5/css/jquery.dataTables.min.css') script(type='text/javascript', src='https://cdn.datatables.net/1.10.5/js/jquery.dataTables.min.js')
The web server is up and running now; see below for some links to test it.
Recent CompHound Commits
Just for my own reference, here is the list of commits I made during the exploration described above:
- 0.0.7 implemented config.json server configuration
- 0.0.8 improved config.json server configuration
- 0.0.9 check db connection before launching web server
- 0.0.10 mongoose datatable is up and running
- 0.0.11 cleanup and smaller datatable font size
Try it out Live
Now that the CompHound web server is happily deployed on Heroku, you can explore it up and running live.
Here is the mongolab-hosted database that we are using: mongolab.com/databases/comphound.
It contains the collection of
component instances.
The only occurrences that I exported so far are from the standard Revit sample file rst_advanced_sample_project.rvt
.
You can add more yourself by running the
CompHoundRvt add-in in any other Revit BIM of your choice.
The node.js web server driving the database via mongoose is hosted on Heroku, and its URL is https://comphound.herokuapp.com.
Its REST API is accessible via the route /api/v1.
/api/v1/instances should in theory returning all database entries, but it will fail with an application error due to too large data.
However, you can use /api/v1/instances/:id to retrieve the JSON document for a single specific entry.
Finally, it sports the beginnings of a user interface that currently provides the following access points:
- / – say hello.
- /hello/:message – reply with the message passed in.
- /html/count – return the number of database entries.
- /www/instances1 – list all the database entries in a table – this can take a long time.
- /www/datatable – display a datatable navigation interface through the instance records.
In the long run, most of these access points can be shut down again.
Instead, one single main index
entry point will display the datatable listing the component occurrences as well as provide access to the still missing reporting, viewing and model navigation functionality.
Addendum: We are still in a rapid developmewnt phase, so these testing links are currently frequently changing.
From version 0.0.17 onwards, the datatable test link is /datatable2 and includes a test react.js widget.
Please always refer to the CompHoundWeb readme file for the most up-to-date working links.
CompHound Road Map
Here are some of the things to work on next:
- Add a View and Data API viewing component.
- Implement the model translation for the viewer.
- Add a database column for the viewer URN.
- Add the rest of the database columns to the datatable view.
- Implement isolated viewing of an individual selected instance.
- Reroute the comphound.net domain to it.
The versions discussed above are the CompHoundWeb 0.0.15 node.js mongodb web server, the CompHoundRvt 2016.0.0.2 C# REST API client populating it, and the (placeholder) landing page CompHound.github.io 0.0.1.
Self-sufficient Urban Farming on 1/10 of an Acre
Would you like to change the world?
Do you think you can make anyone else change anything at all?
Do you think you can change anything just for yourself, all on your own?
A one-woman or one-man revolution?
Well, here is a pretty uplifting 15-minute documentary about someone who has done just that successfully for over a decade:
Surrounded by urban sprawl and just a short distance from a freeway, the Urban Homestead project is a family operated and highly productive city farm. It is also a successful, real-life working model for sustainable agriculture and eco living in urban areas... harvesting 3 tons of organic food annually from our 1/10 acre garden while incorporating many back-to-basics practices, solar energy and biodiesel in order to reduce our footprint on the earth’s resources...