Introducing Keypress

Three weeks ago, I shared a tidbit in a Discord channel, and someone commented that I should write a blog post about it.

But, I didn’t have a blog.

So I made this one.

I’ve done the static-site-generator thing before. It’s fine – rockwellschrock.com and ww1x.com are static sites. But I’m a web app developer, and I like developing web apps.

So, three weeks ago, I opened a new Obsidian document and hashed out a plan. Here’s the entirety of that document, with a few items crossed-out that didn’t make the final cut.

Requirements

  • Minimal dependency upkeep
  • Simple auth system
  • Swappable themes
  • Posts
    • Post types: short, long, link
    • Drafts
    • Slugs
  • Code blocks with syntax highlighting
  • Mobile-first design

Specifications

  • Phoenix 1.7
    • Controllers only, no LiveView
  • Postgres
  • Tailwind
  • esbuild
  • Markdown
  • HTTP basic auth

After working so closely with LiveView over the past two years, it’s just too good to pass over. Writing controllers and JS feels too clunky now, even (especially?) for simple use cases. And it made it even easier to add stretch features that I hadn’t originally planned out, like previewing posts before publishing.

Swappable themes are implemented, but I didn’t design any fun new styles yet. This feature was built into one of my original static home pages when I first started out on the Web, and it’s time to bring it back.

Slugs? We don’t need no stinking slugs! And how do you generate a slug for a Tweet-style post that doesn’t have a title, anyway? Integer IDs are fine, and will continue to be fine.

And yes, the backend is protected by HTTP basic authentication. If it ain’t broke…

Some Future Ideas

It would be great if this could automatically cross-post to Mastodon.

I’ve been really enamored with Gemini lately. Could this server double-up and serve Gemini content? The biggest unknown there is how to handle the graceful degradation from Markdown to Gemtext, whose formatting options are extremely stripped-down.

Share and Enjoy

You can find the source for Keypress on GitHub.

See more posts