One of the interesting things about Tesla cars is that they are packed full of cameras (8 of them on the Model 3). Tesla allows you to plug in a USB drive and click a button on the touch screen to save videos from the forward and two side cameras when an event of interest takes place. Earlier this year, Tesla also introduced a feature called Sentry Mode which uses the car's cameras to record activity when someone does something like lean on your car (or something more nefarious).
Focus started as a way to scratch my own itch, so to speak. What I'm ultimately interested in is playing with image recognition techniques and automatic detection of activity. I think this would make the Sentry Mode concept much easier to deal with on a regular basis - I mean, who wants to sit and skim through 60 second videos to figure out why the car was triggered?
This first release handles combining the videos from the three available cameras and merging them into one. The calendar functionality (which I shamelessly stole from Memoir) makes it much easier to find videos than just a big list view, and I find the flag feature works great for "interesting" videos. I think it's the most capable app of it's kind, and a solid first release. Having never actually done any video work prior to a month ago, there was a learning curve in getting this going, and so there's a lot of room for new features and improvements. We'll see where it goes!
First off, a back story. You should jump ahead if you just want instructions on how to handle hosting Vapor on a Mac.
One of the things I've learned about myself over the years is that I need variety in my work. Every two or three years I look around and see what I could be doing differently to increase productivity and keep software development interesting.
I've had the opportunity over the past 15 years to do a lot of web development work for a variety of clients. Several years ago, after a particularly demanding project, it was clear to me that I needed to find something better on the server side (I was mostly doing PHP at the time). That's when I found Laravel. Laravel felt comfortable from the start, and I've been using it for the past 5 years. I've used it to power everything from simple sites with a few forms to larger sites that process several hundred orders per day. In short, if you program in PHP, you should check it out.
Last year, when I started working on our new website - I again had this feeling that I needed something different. Maybe it was the fact that I'd been using Swift a lot, and going back to PHP just felt... wrong. So, I set about searching to see if there was something that would allow me to stay in Swift-land, something again to make web development fun. I found Vapor.
This brings me to the other really cool thing about Swift: you can easily leverage existing macOS frameworks to build your backend. For me, this means I can utilize libraries like Core Image or Foundation, opening up a huge set of frameworks that I'm already familiar with. This also exposes what I consider a hole in the ecosystem - hosting. In order to take advantage of Apple frameworks, you need to be running on macOS. For many projects that don't rely only on Foundation, this isn't a problem - Swift on Linux supports these just fine, and there are instructions out there to handle this. Even better, the creators of Vapor have an excellent service they offer, Vapor Red, which I prefer to handle sites that don't require a macOS host. But what if you want to take advantage of the many frameworks available only on macOS?
This assumes you have the developer tools on your host Mac, but little else. On the host Mac, install Homebrew:
Once installed, pull in Vapor:
Clone your vapor project to wherever it is you want it to run from, then change your directory to your vapor project and build:
Run your project:
You need to make sure that your site starts up on boot. For this, I use supervisord, which you can install using homebrew:
Create the supervisord configuration file:
Open a text editor, and enter the following for the yourapp.ini file:
Make sure that whatever directory you choose to put your log files in, that it exists before you start supervisord. Then, start the supervisord service:
The next thing to do is to create a proxy which passes traffic from the http port (80) and, optionally, the https port (443), to the running application. To do so, first ensure that apache isn't already running on your host:
Then go ahead and install nginx (also fomr homebrew):
Set up nginx:
Modify the “user” on the first line:
Comment out the existing server block (or remove it).
Create a new server in the servers directory:
Set up a new server block that redirects all traffic on port 80 to port 8080 (where your vapor project is running):
Once this is complete, just restart nginx and you should be able to browse to your server on port 80:
I’d recommend setting up SSL for whatever you’re doing, certbot works great for this. Instructions are available on their website.
Other pertinent references that might help:
I've been working on Memoir 3 for about the last two years, going in fits and starts between consulting work and working on another startup company. As I've transitioned out of consulting and my requirements at the other business have been reduced, Memoir development has picked up steam - and I'm finally ready to announce a brand new version, Memoir 3.
Memoir 3 is a complete rewrite of the original version. The interface has been streamlined, and support for many of the latest macOS features are included. The product page has more detail, and the help files have been moved online so it's easier to see how Memoir operates. As always, a free trial is available, so you can purchase Memoir after you see if it's a good fit. Memoir 3 is a free upgrade for existing users, macOS 10.13 and higher.
Now that Memoir is out the door, Dossier is up next. In the past, much of the code has been shared between the two programs; with Memoir 3 this has changed. Memoir will remain a application focused on keeping notes on your Mac. Dossier will evolve into something larger, keeping it's advanced features (and adding more) while also moving onto Apple's other platforms. Much of the knowledge gained in Memoir will lend itself to Dossier, resulting in a quicker release. Dossier is still in the planning phase, so I won't have details on the release date and new features for some time.
All that being said, the current version of Dossier is long in the tooth. I've removed it from the Mac App Store, as I could not provide a meaningful update within Apple's requested timeline. Today, Dossier has been updated to version 2.7.3. I've also reduced the price to $14.99, with a free upgrade to version 3. A more substantial update is in the works, fixing bugs that have cropped up over the years with new macOS releases, and adding some new features. At it's core, Dossier is still a very capable program - and I now have the time to keep it maintained until I can complete work on a rewrite.
The majority of sales of both Memoir and Dossier have gone through the Mac App Store. The Memoir 3 update will be available on the App Store soon. For those who bought directly from Boundary Labs, new licenses are now available for the latest releases of Memoir and Dossier. A new license is required for the latest versions, though the upgrade is free. Please email us if you do not receive the new license via email.
We have a new website that has been written from the ground up in Swift using the Vapor framework. I've so far focused on enabling purchasing and integrating with our eCommerce partner (FastSpring), so I feel like things are a bit bare at the moment. It will fill out over the coming months, with a focus on help and support content.
Lastly, there's this blog. As the tagline above notes, I don't intend it to be a product blog (or not specifically a product blog). On the previous website, I've occasionally posted tutorials or experiences on getting tricky things to work on macOS. These were sometimes hidden, posted for my own future use or sent along to someone who was having technical issues similar to my own. So, instead of a product blog, I'll be keeping those kinds of things here.