Oregon State University|blogs.oregonstate.edu
Blog Owner
Blogger Name

Again and Again With the Again

  October 15th, 2021

We came into this week with our plan of action; my part was to set up the ten non-database microservices, complete with automated testing, permissions for the other team members, and branch protection to force testing prior to risking breaking changes. My stretch goal was to get some user API routes mocked up but research and the rote repetition of getting the repos set took up the week.

I already knew that I had ten microservices to set up, so my first step was to try and find as many ways to streamline this process as possible. Ideally I could set up a single repo and then copy it over and over, just needing to change the name before any determinate steps were taken. Unfortunately it turned out that while there is a lovely pathway for copying the code as I hoped, branch protections and user access had to be manually set up for each individual repo and those were going to be the major time sink anyway.

For anyone following along at home, the quick trick to clone a repo repeatedly is to check the ‘template repository’ box in the main settings screen, and then a big friendly green button will appear on the repo home page so that you may copy it to your heart’s content.

There’s a checkbox under the repository name box when you first open settings.
This will be in the upper right where ‘code’ usually is.

Since I sort of started at the ending there, I’ll continue working back to my start. Adding my teammates to each repo was easy but time consuming, as there is no way I could find to automate adding them. Theoretically we could have made an organization which would own all the project repositories, but we would then need to pay for an account as we are using pro features with our student accounts. I also had to check off my desired branch protection rules for each and every repository, which was the largest and most boring time sink in this whole thing. I also needed to make sure to put them in place AFTER I was done fixing lines from the template to the actual repo name so that I didn’t have to annoy my teammates with all the minor changes.

The ‘Add Rule’ button will be in line with the ‘Branch protection rules’ header regardless of if you already have any rules in place or not.
You can get very fancy with branch name patterns, but for my case targeting only ‘main’ is enough.

Since I only had the barest skeleton of code, I only needed to fix the README and a few lines on the Node package files to point at the specific repository instead of the template repo. Monotonous, but not as bad as needing to fix a bad assumption I made when copying all the repos: I elected to copy the main and dev branches I had set up, assuming settings and history would transfer. No. I had to manually set main as the upstream for each and every dev and force a push to overwrite the non-history with the new configuration. Again, not bad except for having to do it ten times; especially with messing up orders of operation and needing to wait for a teammate to approve a fix.

Monotony aside, the larger and more satisfying part of this whole experience was researching and actually configuring the template project. I started with the gateway, as it’s the only outside facing part of the microservice ecosystem and if nothing else exists it can still feature dummy API calls to pretend there’s more of a backend behind it. Not that I actually put in any of those dummy routes yet. I found in one of the tutorials I followed an excellent placeholder route that let me run a generic test to ensure my testing suite was actually running correctly, an about page pulling the repo name and version from the package JSON. From there, I was able to set up Mocha and Chai to compare the data in the about page to the package JSON and prove both that the data was being passed successfully and that the test was testing things. I also have Nock installed and ready to intercept calls to other APIs, but that’s a problem for future Robert for now.

I learned a lot this week and had a large share of frustrations, but overall I’m happy with what I got done and am looking forward to actually getting some routes going next week.

And So It Begins

  October 8th, 2021

Group made, project chosen, team standards made, time to get going. For those just joining us, we are making an app that is supposed to be ‘the Wayze for shopping’ in which users will generate price data for groceries and then use that data to find the best deals for their shopping lists. As with all things, much easier to summarize than to actually figure out the details for. The broke up into frontend wireframes, backend microservice ecosystem, and database structure to create the diagrams and design documentation; I took backend. Behold:

Worry not, I can explain. Directional arrows show what will be calling what. The titled boxes are all microservices. At the top is the frontend app which is only aware of the gateway service. The gateway service provides an API which provides access to and obfuscates details for all of the other microservices. The database microservice provides an API so that no other microservice needs to know anything about how data is stored, just that their data of interest can be accessed via the API. That whole mess between them will take a bit more.

Let me explain... No, there is too much. Let me sum up.
  • User Management Service
    • Provides CRUD for user entities on the database
    • Login authentication
    • Updates include lists and reputation
    • Stretch goal is to make a full user profile
  • Item Management Service
    • Provides CRUD for item entities on the database
    • Stretch goal is to be able to provide substitution suggestions
  • Price Management Service
    • Provides CRUD for price entities on the database
    • Stretch goal is to ask users to verify prices still stand, part of reputation upgrade
  • Tag Management Service
    • Provides CRUD for tag entities on the database
    • Stretch goal is to have tags apply to stores as well as to items
    • Stretch goal is to be able to vote on tag applicability
  • Store Management Service
    • Provides CRUD for store entities on the database
    • Also used by the shopping comparison to get store inventory
  • Review Management Service
    • Provides CRUD for review entities on the database
    • Stretch goal is to add voting on review helpfulness
  • Reputation Management Service
    • Provides tools to alter user reputation
    • Extremely barebones for MVP, only increments reputation for activity
    • Stretch goals make it more of an ‘event’ system, allowing penalties and revocation on bad actors
  • Shopping List Management Service
    • Provides CRUD for shopping list entities on the database
    • Stretch goal is to allow a shopping list to be shared between users
    • Stretch goal is to be able to save a shopping list as recurring
  • Shopping Comparison Service
    • The real meat of the application, this one only has a single API call exposed which causes a whole heap of trouble
    • Takes in a shopping list and limits on what stores to search
    • Accesses all stores which are within limits, checking for items on shopping list
    • Returns array of stores with all items that are on the list, sorted by number of item matches and then by savings
  • Live Feed Service
    • Checks database for updates to all the tables to apply to a subscribable stream

So, there’s a pile of services which provide CRUD to a single table in the database with a couple of extra functions related to their relationships and function, the live feed service that provides a stream based on updates to all the tables, and the pièce de résistance – transforming all that delicious data into recommendations of where to shop to save money. The MVP is actually pretty simple other than the comparison, so I’m hoping we can tear through at least the low-hanging fruit stretch goals. We’ll see how well time bloat is avoided.

Introduction and Salutations

  September 29th, 2021

I’ve been playing with computers for as long as I can remember, starting with a cast-off Macintosh in my dad’s office. Way too much of that time was spent on videogames, and that led to me looking into mods and making my own when I was a teen. That led to my first pass at computer science; unfortunately I was a classic ‘gifted’ case and fell pretty hard on my face when reaching college level classes. I switched over to food science and got my act together to actually graduate.

I ended up landing in brewing, which turns out to be much like the videogame industry: long hours, hard work, and pay below scale for the skill set. I stuck with it because I did enjoy it and was in a pretty special position. I was the only distiller for a mid-size brewery that had plans to expand the distillery into a full department, placing me in management once that happened. Once my wife and I started planning for children, I gave up on that promotion ever happening and got started on this program.

I’m not entirely sure what I want to do beyond ‘work’ once I graduate. I’ve specialized into app development with Mobile, Networks, and Cloud as my electives as I have some personal project ideas and they are conducive to making a strong public-facing portfolio I hope will help in my job hunt. However, I have a soft spot for VR and my ‘white whale’ that is far beyond anything I think I can ever manage is something akin to a virtual historical village smashed together with Wikipedia; being able to examine details in a scene and pull up deeper information or roll time forward and back to see changes through history.

My team chose the Crowd-Sourced Shopping Project for practicality and interest, it’s a good idea for an app we think is worthwhile. Runners up were Farm Match and Regeneration Central, both for the same reasons: while being very good ideas I would love to see exist the real-world proposer opened up more logistical complexity than we wanted to manage for a class project. I want to help technology help people, and apps to connect businesses with employees and support resources are right up that alley.

Outside of school, I am currently hacking together a home automation system. I’m stubbornly refusing to use any of the main brand products, not for privacy concerns but the required connectivity. I prefer to have local control with remote backup, as opposed to how Alexa and Google Assistant work with remote servers controlling core logic. They aren’t likely to go anywhere and connectivity issues aren’t common but it irks me. I’m also working on a portfolio website to link from my resume, building the same design in multiple architectures.

I’m looking forward to taking this course with y’all, plan to read some other blogs and hopefully someone wanders into here to follow along with me.