Adventures in Book Club

Book Club apps that is…

I just did the first iteration on the book club app I’ve been thinking about for a while. It’s not really doing much aside from listing out the books we’ve read (well as many as I’ve loaded in so far). But it’s a full-stack application and I even managed to deploy in via netlify.

On the backend:

I’m using a WordPress custom post type (‘Book’) and the Advanced Custom Fields (ACF) plugin to set-up the data on the back-end. Books have authors, cover URLs, descriptions, etc. I’ve added a field for the bookclub date, but some of these we read 5-6 years ago, so I’m not worrying about going back to fill them in. On top of WordPress, I’m using the delightful WPGraphQL plugin to expose nice, convenient endpoints.

Initially, I was excited to use the WPGraphQL extension for ACF, but I realized that with a couple lines of php, I could have a nice flat book object return client-side. Surprisingly easy, if you’re curious check out the plugin repo.

On the front-end:

It’s a pretty standard React app so far, bootstrapped really quickly with create-react-app and Apollo. I did a quick proof-of-concept a couple weeks ago, just messy loading in data and making sure that it works. Again, mostly easy. You can check out the repo here.

This morning and tonight, I focused on starting from scratch with what I’d learned and writing better, or at least less lazy code. I wrote a small set of tests (in Jest) for the various components, and that was a really great learning experience. I’ve used Jest a lot at work, but from within the Salesforce ecosystem (with their lightning web components). The basics are, of course, the same, but the way to mock data retrieval is quite different.

Although now that I’ve figured out how to mock the Apollo client and GraphQL queries, I’m realizing it’s kind of the same:

  1. Initialize component
  2. Provide a mock source of data
  3. Wait for DOM updates or other async stuff
  4. Make assertions.

Basically the same steps for any unit test, just in the Apollo client vs. Salesforce the way(s) available to do #2 & #3 are pretty different.

What’s Next?

Next minor thing is being able to click on each book and read more about it. After that, display each book’s categories and allow user to view all books in a given category. Pretty standard React routing and queries.

After that, the slightly trickier part – allow authenticated users to add new books via searching the Google Books API. The GraphQL part I’m not too worried about, but authentication just adds another level of complexity.

Oh yeah… If you want to see what we’ve been reading

SSL Certificates

So this is one of those things I thought would be hard. And then it just took me about 5 minutes…

I’ve been using greengeeks as my web host for years and years, and recently they added a one-click Let’s Encrypt SSL certificate. I have a few hosted clients where the free Let’s Encrypt product might not be the right choice, but for a very small personal blog, it’s a fine choice in my opinion.

And like seriously, it took 5 minutes. Maybe would have been less, but I made a cup of tea while I was waiting for it to install. And then I came into my WordPress backend and did a couple things and poof. Cute little lock up there…

If I had a larger or messier WordPress set-up, there could have been some weird things to also do, like find-replace of hard-coded urls, but this site is really basic so far (and also doesn’t have hard-coded urls anywhere…).

So, if you’re on the fence about it, or nervous or whatever, I’d say just give it a try somewhere low stakes. I mean the worst that happens really is you uninstall the certificate and go back to normal. The best that happens is you contribute to an ecosystem where having secure websites is normal and approachable for everyone.

Progress

So it’s been a while since I’ve made development progress on my side-project. First I was in England for a few weeks, then I had family in town, and now it’s the middle of August…

But I made some good progress tonight and it’s a thing I can sort of talk about on here. The thing I want to do is an app for my bookclub to keep track of our books that we’ve read. We tried making a goodreads group, but it’s so painful to use that we basically just have a note in someone’s phone that has a list. But having actual information about the books we’ve read, and the books we want to read would be so handy!

So, in the spirit of using what I know but also learning lots along the way, the planned stack is:

  • Headless WordPress for the backend
    • custom WordPress plugin, with wpgraphql
  • React app for the frontend
    • plan will be to do an offline-first app eventually, but first iteration is just a regular old webpage with React
    • integration into Google Books API to search for and add new books

Tonight’s progress was getting a good chunk of the WordPress up and running. I’d had a bit of a false start a few months ago, doing it as a WordPress theme, and then realizing that was pretty unnecessary once I decided to do things via graphql. So this evening I was able to whip up a quick start to things: https://github.com/smallbellows/bookclub-wordpress-plugin. It’s nothing fancy at all, but it’s a start.

If you’re interested in the other details, I’m using Local by Flywheel as my local WordPress machine, which was a super easy thing to set up. I’ve used MAMP and Vagrant over the years, and they’re fine but I was super impressed with how quickly I was up and running with Flywheel.

Next up, I’ll be getting the React app going with authentication. I know if I hosted the app on the same domain as the WordPress stuff, I wouldn’t have to worry about it, but I think I’d rather keep them separate so that I can put the app wherever it makes sense as that part grows. I haven’t figured out where I’m going to host any of this yet so I want to keep my options open. Any suggestions?

Been away for a while

Yes, been away from the blog for a while, but for mostly good reasons. I went to England for a couple weeks in June and then have just been enjoying summer since then. And working! And side-projects! And podcasting!

But, I’m popping in to share what I consider to be a big win! You know when there’s the way of doing things that you know about, and then you discover a new way of doing it and your world is just blown? Yeah, that’s where I’m at today.

Been working on getting a newsletter set up for a side project I do with friends. We haven’t announced the newsletter yet, and that’s turned out to be a good thing, because it turns out that Mailchimp just was being a pain in the butt for what we wanted to do. And then today I heard about MailPoet, which is a WordPress plugin that allows you to build newsletter content right inside your WordPress site. Yes, it’s really that amazing!

I mean, we haven’t actually sent anything yet, or figured out that end of it, but in the last 40 minutes, I’ve gone from completely dreading the whole process of figuring out this newsletter to completely delighted with the whole thing. With Mailchimp, I was going to have to figure out some sort of custom RSS feed or just do a lot of copy-pasting of content across – the plan for the newsletter was a bit of a highlight of the content for the week, so just having our standard RSS feed wasn’t going to cut it. But then we’re all super busy so manually copy-pasting stuff into Mailchimp every week also wasn’t going to be a reasonable solution.

But! Then! MailPoet. I initially installed it on this site (after doing some research and reading on my commute home today), and once I realized I liked how it worked, I signed up for their free account and installed it on our side project site. From initially installing it on my site to sending out a preview of my first draft to then coming and writing this blog post, it’s been 45 minutes. And that was mostly spent picking awesome photos for the newsletter…

There’s definitely some quirks in their drag-and-drop builder, but there’s always a bit of a learning curve with any new tool. In general, it’s just such a treat to find a tool and have it actually do what you’ve been struggling with.

And shoutout to MasterWP newsletter for having them as a sponsor – again just lovely to have thing that really highlights great stuff happening in the WordPress community (and beyond).

Mentorship

Tonight, I went to a great panel/workshop called “Devs Who Mentor Devs”. There were about 20 people there, I think ranging from students to intermediate developers.

The four panelists were all former/current instructors at RED Academy, the hosts of the workshop, and had also worked as devs at a various companies. There was about an hour of panel/questions/discussions, and then we broke into small groups to talk further. And then wrapped up with a brief practice exercise in coaching.

As someone who’s being asked to mentor/coach/support junior devs at my company and also still growing and learning in my own career, it was great to talk to other people at a similar stage. I think my biggest takeaways were:

  1. Being a mentor/leader/coach/teacher is important at any stage of your career, even when (especially when) you don’t feel ready. It allows you to reflect on how far you’ve come.
  2. Having a mentor in your career, whether formal or informal, is equally important. Especially as a junior – if they’re hiring you as a junior, part of that trade-off is that they support you in your growth.

Might seem obvious, but solidifying it in my head was a really great exercise. And I got to experience both sides of a mini coaching session – both super valuable!

Developing a Theme

I am not a graphic designer, and I try not to pretend to be one… I do, however, have Thoughts about how I want my website’s layout to look and function.

So, to that end, I’m starting with a starter theme – wprig.io

Screen shot inception – at least until I make this theme mine

Right now, it’s in its starting state, I haven’t done anything with it yet other than get it running locally and install it on the live site. It’s kind of late here, and I spent a good chunk of time trying to figure out wprig 2.0 (beta). And I might go back to it, but for now, while I just want to have something working, I’m going to stick with 1.0.4 (latest release).

Reading through the code for 2.0, I realize that I’m also very out of practice with PHP. I can figure out the basics, and the structure of an older style of WordPress theme is pretty familiar to me. The class structure in wprig 2.0, though, in theory makes a lot of sense, but just wasn’t clicking with me about where to even start. Maybe once there’s documentation, I’ll feel a little more confident diving into it!

I work with classes and object-oriented programming all the time in my day job – Salesforce uses a language called Apex which is based on Java. And I use component-based architecture for front-end, as well (3 different flavours, depending on the day). So I’m confident I can figure out PHP with classes, etc. but it’s a school night and I still have a podcast to edit.

Hello world?

In a moment of inspiration combined perfectly with procrastination, I have decided to start a personal web page. This will be a place for me to explore and experiment, to try stuff out, and to talk “out loud” about those experiences. I was heartily inspired by Matthias Ott’s post on the perks personal website.

So far, all I’ve done is install WordPress. Something I’ve done many, many times. But this is my first official time using WordPress blocks (aka Gutenberg aka WordPress 5+?). The new WordPress. Just WordPress by this point I guess.

For someone with several years’ experience setting up, administering, configuring, and maintaining WordPress sites, it’s still almost all the same. But I’ll admit, I was slow off the mark to play around in the new back end UI. But in my defence, I’ve been a little insanely busy the past couple of years…

So I guess a bit about me:

I currently work as a software developer for a small SaaS company, where we build our products on the Salesforce platform. I’ve been here for around 2.5 years, and while it was an adjustment coming from WordPress to Salesforce, I’ve also really learned so much about data structuring, software architecture and app design, that I’m really looking forward to being back in the open-source realm, but now with more Knowledge.

Before my current role, I worked on websites as a side-gig of my previous career. WordPress and the community around it, as well as other free code learning resources online really lead me to wanting to go into this whole software thing full-time. I tried doing the self-taught route, but on top of an intense full-time job, it just wasn’t working for me.

I ended up attending RED Academy‘s 12 week web developer program in the spring of 2016. In those 12 weeks, I learned more than I ever could have imagined. We learned basic front-end web stuff (HTML, CSS, JS), we learned how to develop WordPress themes and plugins, and we learned how to build a basic React single-page app. Plus we built a webpage for a community partner. If you’re not sure, that’s a lot in 12 weeks!

But I think more importantly (and more long-lasting) than the specifics of what we learned, I learned how to figure stuff out. How to experiment, how to read the docs, how to ask questions, and how to work through a problem.

And it’s those skills that have really helped me in growing and expanding in my career. I went from a front-end web developer hired on a 4 month contract to an intermediate full-stack software developer in less than 2 years. I don’t know if that’s unusual or special or anything worth really bragging about, but I do know that I worked hard for it. And I also know that I have a lot to learn still.

So, hence, the purpose of this page. I really do love my full-time job. But at the same time, I am feeling more and more separated from what’s happening in the web development world. We work with what works with our product, for our clients, and with Salesforce technologies. I feel more and more that it’s important to me to have a way to explore and express myself beyond that.

So this website is where it’s all going to happen. Today, it’s just a blog on a very plain theme. Next steps, I want to try playing around with wprig.io for theme development, and I’m going to figure out how to load an SSL certificate onto my domain. Pretty basic stuff, but having an up-to-date build process and a domain that supports https are things that will help me going forward.

What to expect from this site:

  1. honest ramblings about my processes
  2. Star Trek references
  3. inconsistent posting schedule
  4. changing my mind about what to work on next

I’d love to have anyone and everyone along for the ride. You can follow me on twitter @sarakgiven or maybe by the time you see this, I’ll have a way for you to just subscribe to this blog….