My 2019 Coding Year In Review
Another year (and decade) is officially in the books! I'll never forget 2019 since this was the year my first child was born. She is a healthy, very social (and as of this writing) almost-five-month-old, and I cherish every moment I get to spend with her. I am excited to spend the year of 2020 and beyond with my new family of three.
In terms of professional development, I spent the year broadening my horizons as a developer. Whereas most of my first year on the job was spent on frontend projects, last year I worked on several backend projects in Golang while also diving deeper into DevOps. Here's a rundown of what stood out the most to me:
Cool things I worked on
GraphQL. I started the year by building a GraphQL server in Go using the fantastic gqlgen library. I had existing schema that I wrote out near the end of 2018, so part of this year was spent actually setting up and implementing the server using these definitions. With
gqlgen, it's really easy to get started. You just need to define the schema, add a config file, run the generator and then fill out the resolvers. I started by writing layers for our existing REST API services, then added in resolvers for our new gRPC microservices as we worked on them (more on those next). Once the server was ready for use, I set up GraphQL in two of our frontend applications using Apollo Client. Hopefully by the end of 2020 we will have converted all of our frontend apps to use GraphQL.
Golang Microservices. I wrote out gRPC microservices for two of our backend APIs. This was an all-new experience for me since my backend experience had been minimal at best. This involved writing out Protocol Buffers and service methods while also generating AQL queries to interact with our ArangoDB database. Once these were built, I updated the GraphQL server to include them.
GitHub Actions. Later in the year, we spent quite a bit of time creating our own CI (Continuous Integration) pipeline. At first, I experimented using Argo Events which we were going to use to monitor for any GitHub commits and then fire off a set of actions (i.e. running unit tests) if detected. While I was able to get a webhook-based system set up with Argo Events, it was proving to be unnecessarily complex for our use case. Shortly after, our organization got notice that we had been given access to the beta for GitHub Actions. This was exactly what we needed.
We were able to build our own CI pipelines utilizing some relatively simple GitHub workflow config files. I was in charge of creating the frontend CI, so I set up a pull request based pipeline where on every PR, GitHub Actions will run through the necessities: unit tests, ESLint and Flow type checking (I know... we are slowly switching to TypeScript!). It also includes visual snapshot testing with Percy, test coverage pass/fail integration with Codecov, automatic code reviews with Code Climate, and generated Lighthouse reports. When a PR is accepted and merged into our
developbranch, I set up a workflow that will build a Docker image and push it to Docker Hub. By automating all of this, we can now put more time into the most important of it all: the actual code.
NIH Grant writing. As mentioned in last year's review, my organization relies on government funding to operate. Early in 2019 we found out that we did in fact get the grant we applied for the year before (hooray!); however, there was a caveat -- we only got two years of funding rather than the four we requested, and we were advised to apply for a new type of grant next time. In order to maximize our chances for the next grant, we had to start working on the new one immediately. This time around, with more experience under my belt, I jumped in and wrote quite a bit more about our analytics and technical infrastructure. I also made a neat little diagram that shows our software architecture model.
New frontend application for displaying publications. I was given the freedom to build this how I saw fit. I had been wanting to learn TypeScript so I used that from the beginning. This was the first app that was able to use our new GraphQL server, so it included Apollo Client integration right off the bat. I used this as a model for our future GraphQL implementations on the client side.
Complete revamp of our Stock Center app UI. The Stock Center app is essentially a shopping website where people can browse/search a catalog, add items to the cart and then order them through a checkout process. Our initial designs were very flat and didn't take advantage of Material-UI, which had taken over as our default UI library in our apps. I redesigned the catalog page to include full search abilities, multiple checkbox selection, dynamic add/remove to cart buttons and will support downloading data as PDFs in the near future. I also updated the individual item pages to a more appealing tab-based design with cards to show other related items, among others. These refactors helped bring our UI up to the modern era.
React Hooks!. With our transition to GraphQL on the client side, we didn't really need to keep Redux anymore. I designed a way to handle our state management using a combination of Context and the
useReducerhook, very similar to how it is described in this React.Christmas article. Rather than having one source for storing global state, we now use multiple contexts for different parts of the app. For example, the state used for the catalog pages is only needed for that section of the site -- there was simply no reason for all of it to sit in the global state. This is something that is still in transition as of this writing, but it seems really promising for our use cases. I have also been writing my own custom hooks and rarely, if ever, use a class component anymore.
I also wrote a ton of smaller scripts and other projects. There are too many to list here in detail, but some examples are an event messenger system that handles events as a subscriber to Nats messaging (i.e. sending an email when an order is received), a script to create new ArangoDB collections, a predictive analytics script that uses light machine learning to guess where a user might visit next, and scripts that post GitHub issues or upload files to Minio S3 storage when a webhook is received. I also spent time improving my documentation writing skills and working on various React libraries.