Building and shipping in under a week
Published: 2023-12-15 16:09:46

---
title: Building and shipping in under a week
published: true
description: How I built the MVP for imaginanki.com Anki flashcard generator in less than a week  
tags: 
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-12-15 07:38 +0000
---

[Imaginanki](https://imaginanki.com) is my first attempt at building and shipping *something* as fast as I can.

It's an app for [generating Anki decks with AI](https://imaginanki.com) (flashcards) for language learning with various AI models. You specify the level, theme and language you want to learn, and you get back a deck of flashcards with embedded images and audio that is fully compatible with Anki.

This was the first time I thought to myself "F it, I won't worry about code cleanliness, feature completeness, tests, extensibility, or anything like that; I'm just going to *ship*."

Here's what that looked like.

# The first step

A lot of people say "find your first customer before you write a line of code".

I didn't do that. 

Was that my first mistake?

I honestly don't know. Come back in a few weeks and we'll have a better idea.

I did, however, start with a single feature - auto-generating images for *existing* Anki decks. 

The implementation is pretty simple:
- pass the front and back of an Anki card to an LLM
- ask it to generate a prompt to use as an image for the flashcard
- pass the prompt to Stable Diffusion

# Choosing a framework

Choosing the framework/language/etc for this first rough iteration was definitely a no-brainer.  

Aside from a smattering of PHP, I haven't touched any web-specific frameworks (Vue/React/Ruby-on-Rails/etc) in years. 

I've mostly been working with Flutter (mobile + desktop) in that time, so it was logical to stick with it for this new app. 

It's not perfect, but I was comfortable I'd be able to deliver something good enough for an MVP. 

"Ship fast" means "stick with what you know", so I wasn't going to waste time picking up another front-end framework for some theoretical future benefit.

# The backend

I haven't really touched a database in a long time, either (I have an aversion to running servers).

I instinctively reached for Firebase Cloud Storage, but then I realized I didn't need persistent storage - at least, not for the first iteration.

I had to be *ruthless*. I needed to avoid writing any code that wasn't absolutely, positively necessary to deliver that first iteration.

Persistence just wasn't necessary. I knew I could do everything client-side (i.e. in browser). 

# The ML 

This was really the most important issue, so it was worth the extra time experimenting.

I tried Stable Diffusion XL and mistral on Cloudflare AI workers.

This is really promising, and I'm sure it'll be great in about 6 months.

Right now, though, it's too unreliable. It has a tendency to drop out randomly, and it also seems to serve up cached results every time, so there's no diversity in the model output. 

To be fair, it's still in beta; even Cloudflare explicitly tell you not to use it for production purposes.

I signed up for replicate.ai and played around with generating prompts via their various models (LLaMa, Mistral, Vicuna). 

Unfortunately the cold-boot time for these was too long. I figured noone would wait around for 30-60 seconds before seeing any progress whatsoever.

The SDXL model on replicate.ai, however, was fairly reliable.

I assume it's so popular that it's almost always kept warm.

In the end I chose the Claude API (which is really fast, and offers decent multilingual generation) and SDXL via replicate.

# The client

I hacked together the most barebones UI I could tolerate.

Most of this was straightforward glue code, though handling the Anki deck collection file format did take some time. 

This is a zip file with an embedded sqlite database and some JSON for storing media.  

This did actually cost me a lot of unnecessary hassle on the second iteration - but that's a story for another post.

# The release

My first commit was on 29 November:

![Screenshot of first git commit on 29 November](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/beasi9xvsqy94uyttu5r.png)

And my Reddit post sharing the first release was 6 December:
![Screenshot of reddit post on 6 December](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/625o4zp290gr6ans5etc.png)

There were a couple of days in there where I was also busy with other work, but it's basically a week from concept to release.

I think I did well at stripping away literally everything but the bare minimum needed to release a barebones - but functional - product.

Should I have lead with the marketing first? I don't know.

I definitely made some mis-steps after that initial iteration, but I'll leave those for another day.

Any thoughts about what I could have done better/faster/cheaper?