Inspiration
I wanted to move my usual workout tracking onto Reddit, so I made Workit. I kept thinking about 100 Days of SwiftUI's point that if you post progress to social media every day, it helps keep you accountable and solidifies the routine (https://www.hackingwithswift.com/100/swiftui)--and I think Interactive Posts are a good vehicle to do exactly that with fitness routines, which are critical to health and longevity, and can also be tricky to stick with. After trying several different apps and methods for logging workouts, it feels like there's a clear set of features everyone expects, and they're each pretty easy to tackle, though collectively it adds up to a lot of work and UI complexity to juggle. I also know there are hundreds of different programs, dozens of different ways to work out, etc. and so I wanted to serve a large portion of those well, but also specifically start with something concrete. So, initially Workit is focussed on Stronglifts, and for about 3 weeks I've been using it as my own tracker at r/workit5x5. While it's been awesome to see and play a variety of games in Devvit, the platform makes me want so much more for it's app in addition to games, and I think it starts by thinking about where our time goes, what we value, and what people interact and find community for. Fitness is an obvious fit, as shown by all the fitness subreddits, but finding the right places for the app to start and stop is nuanced, and keeping it social is critical.
There's plenty that's better left to humans, like form checks, questions, and education. But workout sessions are maximally efficient when you go in knowing exactly what to do, down to the number of reps to target and which plates to load. Removing all that mental burden also helps people stay consistent when the rest of life is stressful and consuming--this is a huge part of why exercise classes and trainers can be so valuable for consistency and enjoyment. But a lot of these details are easily within the grasp of an app, especially if there are power users and mods on the other side of that app authoring or importing programs.
What it does
The meat and potatoes of Workit is to help you remember and record weights and reps as you do them. I'm working with the assumption that you can use the rest of the internet (especially posts and comments in an appropriate subreddit!) to learn about routines and exercises between workouts, and that an app is not well suited to that. So, anything that I could imagine helping you progress smoothly during that workout is in the app. And there's some extra stuff to encourage people to get into a workout and help them feel good about it after. I suspect most people will use a phone while exercising, so it's critical that Workit feels great on mobile, and the app has some logic built in to improve the experience within narrow dimensions. But I also want users to discuss and learn when they're not in the middle of a workout, often using a Workit post in combination with its comments, so the app needs to make use of wider screens when available, too.
How we built it
Workit is built in blocks and stores everything in Redis continually. It uses forms for some user entry, but not within the most common user stories. It tries to lean into existing Reddit design, using RPL as much as possible for colors, buttons when it can, and not adding too much in the way of art or styling beyond what the rest of Reddit feels like. It benefits from the fact that animated gifs are as easy to upload and display as any other image. Workit leans heavily on the React-like hooks (useState, useAsync, useInterval) and components.
Challenges we ran into
Many of these are covered in more detail, including suggestions, in my feedback submission.
- Mods are not generally open to working with or discussing a new app (see more in the final section)
- Blocks has some shortcomings and missing features that would have been useful: sound, video, hover handling, more fine-grained control of some properties, animations. And forms, which are the only good feeling way to accept user input in Blocks, aren't as customizable as Blocks themselves.
- It's hard to get users testing and giving critical feedback. For an experienced dev, Devvit (through its ease of use and providing so much in the way of infrastructure and support) allows you to get to the point of "I implemented everything I can think of and also took every suggestion I could solicit, and I don't really know where to go next."
- I don't have extensive React experience, but I really miss having something like Redux available. There's a lot of complexity in how the state is handed around between components and persisted into Redis. It's great to get Redis and all the React hooks for free, but state management was definitely the biggest source of complexity in the codebase, and Workit badly needs a refactor on this front. I think a library that does this well, alongside some documentation and examples suggesting best practices could cut down development time for an app like Workit for someone like me to about 50%.
Accomplishments that we're proud of
I personally like using Workit more than any other solution for my own workouts! I feel like I can easily adjust it to make that true for other interested users down the road, too. It's cool to be able to build within Reddit and get to that point within a month, and that bodes so well for the platform. I thought it was particularly fun that every app I've looked at charges for calculating plates and warm up sets (and spreadsheets and paper can only do so much for that), yet it was only a day or two to develop the critical parts of that.
What we learned
- RPL is really powerful, and I wish I had learned about it and leaned into it a bit earlier. I'm sure other Blocks devs would benefit from using it more.
- Mobile is pretty important, and it's pretty easy to develop in a way that supports and optimizes for both. Testing on both mobile and web from early on helps a lot, and I think it's totally reasonable in particular to use context.dimensions.width to make things perform differently on narrow views.
- Ask AI recommended a solution for showing changes immediately in the UI while still eventually persisting them to Redis that was critical for the app, and I think would help lots of other developers: https://discord.com/channels/1050224141732687912/1334199006087221440/1334202386733989938 -- a state management library in Devvit would be ideal, but I think this approach is the next best thing for a while category of apps.
- There's a ton of value in apps that go beyond games and fit into existing kinds of Reddit (or even just internet or mobile) usage. It's roughly as easy to build in Devvit as any other framework (because for every Devvit-related challenge, you're getting a piece of infrastructure for free), and then you end up with an app that ties perfectly into a social platform. When the app (game or otherwise) makes enough use of that platform that it wouldn't make sense as just an isolated thing on an app store, Devvit is a total game changer.
What's next for Workit
I'd really like to get Workit installed to an active fitness sub like r/Stronglifts5x5, r/StartingStrength, or r/WorkoutRoutines. This is tricky, because mods see a ton of people who want to solicit users for their apps, products, research, and content. I'm hoping to find a mod or mod team who view the app more like "I'm getting a custom-built tool to support the sub and things it already wants to do, and keep people within the community when they would otherwise be outside of the platform." But so far the median mod doesn't seem to know about Interactive Posts, and so any attempts at contact just feel to them like the thousandth: "Let me post my survey!" I can't wait to see Workit posts surrounded by form checks, personal bests, questions, and the like, with a pool of ready-and-waiting users who align really well to its workouts, but it will take just the right connection and plan to get to that point now that the coding is mostly done.
Built With
- blocks
- devvit
- forms
- redis
- svg
- typescript
Log in or sign up for Devpost to join the conversation.