/ Updates

Typely update released v0.3.1

I'm pleased to announce that most of the discussed updates are now pushed into production: live. A lot of things were changed during this release and I'm going to explain the most important aspects.

Markdown preview is live

This sucker managed to keep me busy for almost a week, only on the client side. I brainstormed everything so much that I was seeing panels and windows resizing even in my sleep for a while.

Initially, I envisioned Typely to be simple (at first impression) and, 1280px in width, was perfect for the main content. This gave me peace of mind when considering anything…horizontally. Introducing a new panel that is supposed to be of equal size with the main editor raised some issues because I was now above the “safe” dimension of 1280px - a minimum desktop resolution which is quite popular for laptops and some tablets.

I'm not going into too much detail over how I managed to sort this all out because it's been discussed already in a previous post but it was done…in style, with sweat.

Creating, saving, listing and loading documents

Up until this point, Typely was what I consider to be a stateless application. It didn't care who you are and what you want to do except its main business: linting prose. A simple tool where people came to paste some documents, view and fix whatever is recommended and that was all.

With this release, however, Typely has the notion of multiple documents. This means that you can create, save, open or close documents. You can have multiple projects to work on without having to rely on external editors or tools for storage.

The overall functionality is also discussed in one of my earlier posts so, if you want to know everything, head over there.

Introducing the Typely score

A bit of refactoring was done to the sidebar as I introduced a tabbing navigation with 3 panels. All the counters were moved to a “Stats” panel because there was little space vertically to fit everything.

This resulted in a panel with some counters on the top and bottom but nothing else in the center of it. I hate having empty content so I started searching through the emails I received from my users. Lots of requests over there but I needed something that fits within the notion of “counters”, “numbers” or “stats”. There was this guy, pointing me to some other tool that gives a score based on how good is your writing. Sure, I can have a score as well; hold my beer.

After days of searching and asking all kinds of people from the mathematical communities, people with bigger brains than mine, I had…nothing. Nobody was able to understand what I need exactly so I brainstormed something. It takes into consideration the following variables:

  • The length of your test
  • The number of mistakes reported
  • A weight that each mistake has (some mistakes are “lighter” than others)
  • The length of the mistake matches combined in report to the overall text length

With these 4 variables and some ultra-secret glue, Typely has a score to display after each report. Something people can brag about.

Exporting documents to Google Drive/Docs

This one is the first on a list of many integrations for exporting documents. I started out with Google Drive because it's tightly related with Google Docs and that's a popular tool among my audience. I'm planning on adding Dropbox as well in the near future as well as the ability to also import from these remote storage boxes.

Generate PDF report

I find this feature to be the most important one from this release. It may not seem much but I have a lot of teachers telling me that it would be nice to be able to generate something and send a report to their students. Nothing fancy, not a lot of work but with so much to gain from.

Https, some minor checks added

If we're talking https, we're talking LetsEncrypt. I refuse to spend hundreds of dollars on a certificate any more when I can obtain and renew one free from these guys.

Since I'm a docker fan to the core, everything is contained because I like to be de-coupled from the host.

I hated it back then when most of the software was installed on the server machine. Upgrades were a pain and code releases were done with crossed fingers all the time because we couldn't replicate properly our production environments on our dev machines.

To obtain the SSL I grabbed a letsencrypt-proxy container and linked it with the main nginx one. Everything was working fine, except for the blog. When adding a blog to Typely I decided to keep it on the main domain with a path prefix of "/blog/" instead of losing domain authority to a subdomain.

Unfortunately, with nginx dockerized, I was unable to obtain ssl for 2 containers that are on different ports, with the same VIRTUAL_HOST but a different VIRTUAL_PATH. This issue put me back for almost a day until I found an alternative, a better one if you ask me. It is similar to the ingress L7 offered by Google Container Engine and it allows you to tweak a lot of things.

The difference with Traefik is that you don't have to specify letsencrypt directives for each container. There are some global options you can tweak and it does its job securing everything for you:

email = "hello@example.com"
storage = "acme.json"
entryPoint = "https"
onDemand = false
OnHostRule = true

What's next?

A lot! Many things to fix and just as many to add. I need an API for this thing. I kept pushing it back because Typely is in its early stage and I need to focus on the interface a lot in order to captivate my users.

Some mistakes were made during the upgrade but I'm glad they took place as I found out many issues in the way I release the code. The backend is made in such way that every release has a new tag and I can revert to an earlier state easily in case something does not work as expected. The issue is that I forgot to do the same for the client code and I pushed it first. The new client code was impossible to revert and, of course, something was not working. One of those WTF moments with Javascript and my obfuscated code.

I'll have to fix my release code and add a staging server somewhere because I had almost an hour of downtime until the problem was found and fixed.