James Randall Musings on software development, business and technology.
Give By The Mile: Setting up

In 2022, according to Strava’s annual “state of strava” report 24 billion, yes billion, miles were recorded on their platform. Imagine if you could convert 5% of those miles into 1 pence (GBP) and donate it to charity. That would be £12 million collected even before you factor in (in the UK at least) gift aid.

That, basically, is what Give By The Mile is about. A platform for connecting athletes, both aspiring and experienced, with sponsors to collect ongoing recurring donations based around the amount of miles a cyclist covers or ascent they gain, meters a swimmer swims, or miles run by a runner each month.

I’d like it to be a positive contribution on all sides: the donations to the charities and a motivational tool to those, of all levels of fitness, trying to reach their goals. It, in and of itself, is hopefully a public health good.

In practice I see this working as follows:

  1. Fundraisers sign up and pick a charity and set up a donations page. Ideally I’d like to be able to do all this directly and with recurring billing but for the initial MVP I’m looking to make use of the JustGiving API. That means I can notify people about how much they need to donate but can’t directly collect the money.
  2. Fundraisers connect Give By The Mile to their fitness platform. I’m starting with Strava as they have an easy to access API. I’ll then look to move on to things like Garmin (who you have to apply to to gain access the API and seem to want you to already have your software before they’ll commit to you - very chicken and egg), Apple HealthKit (probably need an app), Wahoo etc. I’ll also support the upload of FIT files for folk who would rather do things that way.
  3. Sponsors sign up and find an athlete - either someone they know, someone through a search on the site to find compatible athletes (charity and probably donation range). They then pick how they want to sponsor that athlete and optionally set a maximum donation.
  4. At the end of each month the totals are tallied and the sponsors and athletes notified. Along the way their will be some graphs and things like that so people can see progress. And eventually you can imagine building a reward system in.

And this, here, is the developer diary that I’m going to try and maintain while I build this platform out. Partly because hopefully there will be some interesting things to talk about but also because the difficulty won’t be in building the platform: it will be getting attention and traction. So I’ll be using every outlet I have to promote this!

First a bit of history. Give By The Mile is actually an idea I had probably about 15 years ago. I wasn’t really a cyclist then but I had started riding my heavy commuter bike longer and longer distances as I’d entered a London to Paris charity ride. It was really hard work! And I kept thinking to myself: this is the hard bit! Back then the ecosystem wasn’t really their - I looked into building it but there were just too many pain points on all sides to make it feasabile for me to do as a tiny project and so I shelved it. I’d registered the domains back then but for some reason had let them go fallow - thankfully no one had grabbed them in the interim so they are mine again!

However its stuck in the back of my mind and a few things have come together to really bring this to the front of my mind:

  1. I’ve got really stuck into training for a couple of charity endurance events I’m hoping to do next year. Spent soooo much time on a turbo trainer going up virtual mountains that I could use that bit of extra motivation!

  2. I don’t know if its because as I get older I notice it more or if its actually the case but there seems to be so much struggling and suffering around and I’d like to do something about it. Sure I can do individual events but being a moderately talented software developer what I can really do is build things that act as multipliers.

  3. My mum is quite ill and it is absolutely shocking how little support there is available from the National Health Service. I’m not going into the politics of all that here, the subject is complex to say the least, and I’m certainly not suggesting there aren’t hard working people in the NHS but essentially support (what little their is) comes from the various charities in the space. This sort of thing really brings things into focus.

I’ve spent time over the last couple of weeks talking to people who ride bikes, who run charities, and folk who’s broad view on sectors I respect and I’ve had nothing but encouragement. I figure the absolute worst that can happen is that it fails, it costs me a little time (but likely I’m having fun in that time!), and I move on. But best case - it takes off and makes a real difference to peoples lives. How awesome would that be!

So that’s the history and my motivations out of the way. On with what I’ve been up to over the last week or two.

As its gestated for over 10 years in my head how the system works is pretty well explored in my mind so I’ve been focused on picking the tools and technologies I’m going to be using and doing some proof of concept work where they are new to me. I always start a new project by thinking about my obvious constraints. For this project the two big ones are fairly obvious.

  1. I’m working on this on my own. I need tools, and an architecture, that supports a tiny team in being productive. Even though its not a huge project there is a lot of ground for one person to cover.

  2. It needs to be cheap to run. To begin with I’m funding this myself and I’d like to be able to do that for some time. But even if I get to the point where I’m funding it externally or more directly the lower the overhead the more money goes to the charities.

I’m going to give my thoughts on the first point here and we’ll pick up (2) in a future post.

If you’ve followed me for a while or seen me present you’ll know I’m a big fan of using Fable with F#. This lets you write end to end F# on both the server and the client - it transpiles the F# to JavaScript and their are bindings for React and other libraries. And you can get fairly seamless interaction between the server and the client by using Fable Remoting.

However I’m not using F# for this project. But I am using some of the key takeaways I learned from that. They were:

  1. Using the same language end to end is a massive productivity boost. The obvious benefit is that you can share code (models for example) but the real, and massive, benefit is the increase in “flow state” for a developer. I’m a pretty comfortable polyglot but not having to context switch between, say, C# and TypeScript is a huge productivity boost. Transformative.

  2. For small to medium projects dispensing with as much ceremony as possible makes things far more maintainable and quicker to iterate on. That’s not to say your code should be chaos and carnage. Absolutely not. You need a structure. But bringing things closer together rather than decoupling to the nth degree makes it a lot easier to get stuff built. Heresy to some I know but a lot of the patterns people habitually use are there to support testing and large or multiple teams. There are other ways to achieve the former and if you’re not a large or multiple team organisation…

So why am I not using F#? Doesn’t it tick those boxes? Yes. But…. I am almost certainly going to open source this project once I’ve got enough of a foundation in place and with a bit of luck perhaps I can get some help in the development. That’s far more likely to happen if I’m using a more mainstream language and runtime. Additionally there has been some really interesting things happening in the JavaScript/TypeScript space that, after doing some research, I want to take advantage of.

If I know .NET (I also know TypeScript and JavaScript so its not really a deciding factor for me but anyway) why not C# and Blazor? Every time I’ve looked at Blazor its felt unfinished in some way. And its very much in its own little world. I like ASP.Net Core (and they’ve made strides in reducing ceremony for sure) but the UI options just don’t jive with me. I don’t know what it is about Microsoft and UI technology but I always find it…. grim. That’s a personal thin sure. But I’m a person. And I have to use this stuff to write a lot of code and stay engaged. So for all those reasons that stack is out….

I feel I’ve written a lot here. And I have some more code to write! And so I’m going to leave this on a bit of a cliffhanger. Stay tuned for the next update where I’ll talk about where I’ve headed (hint: React is in the mix but its not React).

Featured photo by Aditya Wardhana on Unsplash