How We Built kecker.co
A guide for Android developers stepping into web for the first time.
If you have shipped Android apps, you already know how to think in components, build systems, and deployment pipelines. The web uses different words for the same ideas. This post maps the concepts you already know onto the tools we used to build kecker.co, so you can read the codebase and understand every decision without having to learn web from scratch first.
1. The Stack at a Glance
Here is everything involved in building and shipping kecker.co:
- Astro 5 — static site generator (the build system for HTML)
- Cloudflare Pages — hosting and global CDN
- Wrangler — Cloudflare's CLI deployment tool
- GitHub — source code hosting and version control
- EB Garamond + Inter — typefaces, loaded from Google Fonts
- CSS custom properties — design tokens (colors, spacing, type scale)
- Storybook — isolated component development environment
No React. No Vue. No Angular. No JavaScript framework at all. The site is plain HTML and CSS generated at build time. That is the whole point of static site generation, and we will get into exactly what that means.
2. Astro: A Build System for HTML
Astro is a static site generator. The simplest way to understand it: Astro takes your source
files and transforms them into plain HTML, CSS, and JavaScript files that any web server can
serve. Think of it like Gradle, but instead of compiling Kotlin into an APK, it compiles
.astro files into a dist/ folder full of HTML files.
In Android, your UI exists at runtime. Activities, Fragments, and Views are instantiated
by the framework when the user launches your app, and the layout is inflated on-device.
In Astro, there is no runtime. Pages, Layouts, and Components are rendered once during
npm run build, and the output is a set of static files. When someone visits
kecker.co, the server is not running any code. It just sends back a pre-built HTML file.
The build command comparison is nearly one-to-one:
# Android
./gradlew assembleRelease → outputs build/outputs/apk/release/app-release.apk
# Astro
npm run build → outputs dist/ folder full of .html files
Astro files end in .astro and have two sections. The top is a frontmatter
block, wrapped in --- delimiters, where you write TypeScript that runs at
build time. Below the frontmatter is the HTML template. Think of the frontmatter like a
Gradle build script: it runs during compilation, can import other modules, fetch data, and
compute values that get injected into the HTML template below it.
---
// This TypeScript runs at build time, not in the browser
import Header from '../components/Header.astro';
const title = "Hello from build time";
---
<!-- This HTML is the output template -->
<h1>{title}</h1> 3. File Structure: How Routing Works
Astro uses file-based routing. Every .astro file inside src/pages/
automatically becomes a URL. No router configuration. No manifest. No intent filters to
register. Just put a file in the right folder.
src/pages/index.astro→kecker.co/src/pages/privacy.astro→kecker.co/privacysrc/pages/404.astro→ served when any URL is not foundsrc/pages/blog/how-we-built-kecker.astro→kecker.co/blog/how-we-built-kecker
The Android analogy: in Android, each Activity declares which Intents it handles in
AndroidManifest.xml. You explicitly register every screen. In Astro, the
file path is the declaration. A file's location in src/pages/ is its own
routing configuration. Fewer places to look when something is broken.
4. Layouts and Components: Like Fragments and ViewGroups
Almost every page on kecker.co starts with the same wrapper:
---
import SiteShell from '../layouts/SiteShell.astro';
---
<SiteShell title="Page Title" description="...">
<!-- page content goes here -->
</SiteShell> SiteShell.astro is the master layout. It wraps every page with the
<html> and <head> tags, mounts the
Header component at the top, and the Footer component at the
bottom. Compare this to having a BaseActivity in Android that all your
activities extend, automatically providing a toolbar and bottom navigation. Every page
gets the site chrome without repeating it.
Inside SiteShell.astro, there is a single <slot /> tag.
This is the insertion point where child page content gets placed. Think of
<slot /> as a FrameLayout in a base layout XML: it is the
container that child Fragments (or in this case, page content) inflate into.
Components like Header.astro, Footer.astro, and
BaseHead.astro live in src/components/. They are reusable pieces
of UI, exactly like custom Views or reusable Fragment classes in Android. The difference is
that they produce HTML strings at build time rather than View objects at runtime.
Components accept props, declared with a TypeScript interface at the top of the frontmatter:
---
interface Props {
title: string;
description: string;
}
const { title, description } = Astro.props;
---
This is the same pattern as passing a Bundle of extras to a Fragment, or
exposing properties on a ViewModel. The parent passes values in; the component uses them
to render its output.
5. CSS: Like XML Layouts, But More Powerful
In Android, you define how things look in res/layout/*.xml and style them
with styles.xml and attrs.xml. On the web, CSS handles all of
that in one language. Instead of android:textColor="#111111", you write
color: #111111. Instead of android:layout_marginTop="16dp",
you write margin-top: 16px.
CSS custom properties are the web equivalent of your colors.xml resource
file. You define them once on the root element and reference them everywhere:
/* global.css */
:root {
--color-accent: #971b2f;
--font-body: 'EB Garamond', serif;
--space-lg: 2rem;
}
/* Use them anywhere */
h1 {
color: var(--color-accent);
font-family: var(--font-body);
margin-bottom: var(--space-lg);
}
Change --color-accent in one place and every element that references it
updates automatically. This is exactly how @color/accent works in Android
resource references.
Astro also scopes styles automatically. When you write a <style> block
inside a .astro component, those styles only apply to that component's HTML.
Astro achieves this by injecting a unique attribute (like data-astro-cid-xxxxxx)
onto the component's elements and adding that attribute to all the CSS selectors at build
time. It is similar to how a custom View in Android that draws its own background does not
affect its neighbors. Styles stay local unless you explicitly make them global.
Global styles live in src/styles/global.css and are the web equivalent of
your base AppTheme in styles.xml. They set defaults for typography,
spacing, and color that apply site-wide.
6. The Design System: A tokens.ts Shared Resource
src/design-system/tokens.ts exports all color, font, and spacing values as
TypeScript constants. Think of it as a DesignTokens.kt file in your Android
project that defines every value in your Material theme, kept outside of XML so it can be
referenced from code.
// tokens.ts
export const colors = {
accent: '#971b2f',
ink: '#1a1a1a',
paper: '#faf8f3',
};
export const fonts = {
serif: "'EB Garamond', Georgia, serif",
sans: "'Inter', system-ui, sans-serif",
}; Both the CSS custom properties and the Storybook configuration pull values from this file. When you change a token here, every consumer updates. This is the single source of truth principle: design values live in one place, not scattered across multiple files where they can drift out of sync.
7. The Logo: SVG Vector Format
The K mark is stored as an SVG file in public/logo/. SVG stands for Scalable
Vector Graphics. It is the exact same concept as a Vector Drawable in Android: a resolution-
independent format defined with mathematical paths rather than a fixed grid of pixels. It
looks sharp at any size, from a 16px favicon to a full-screen display.
The SVG uses fill="currentColor" on its path elements. This is a CSS keyword
that means "inherit the text color from my parent." In CSS you can then write
color: white on the parent element to make the logo white, or
color: var(--color-accent) to make it the brand color. This is equivalent to
applying android:tint programmatically, except it is pure CSS with no code
required.
The public/ folder is Astro's equivalent of res/raw/ or
res/drawable/. Files placed there are copied directly to the output
dist/ folder without any processing or transformation. Static assets like
fonts, images, and favicons live here.
8. Storybook: Like a UI Component Gallery
Storybook is a development tool that lets you view and interact with individual components
in isolation, without running the full site. You launch it with npm run storybook
and it opens a local web app where every component is listed and rendered on its own.
The Android parallel: imagine having a standalone debug app in your project that renders all your custom Views and Composables in a scrollable list, letting you tweak their props and see how they look in different states. No need to navigate through six screens to reach the component you are working on. Storybook is exactly that, for web components.
Each file in src/stories/ defines a "story": a specific rendered state of a
component. A button story might show the default state, a loading state, and a disabled
state side by side. This makes it easy to develop and review components without touching
the rest of the site.
9. Deployment: Cloudflare Pages Instead of Google Play
Google Play distributes APKs to users' devices. Cloudflare Pages distributes HTML, CSS, and JavaScript files to servers around the world. The concept is the same: you upload your built artifact to a distribution network, and users receive it from there.
Cloudflare operates a global edge network, which is a CDN (Content Delivery Network). When a user in Tokyo visits kecker.co, Cloudflare serves the files from a data center near Tokyo rather than from wherever your origin server happens to be. This is similar to how Google Play mirrors APKs to regional servers so that downloads are fast regardless of where the user is located.
Wrangler is the CLI tool for deploying to Cloudflare. It is the bundletool
of the web world. After running npm run build, you deploy the output folder:
npx wrangler pages deploy dist --project-name kecker-docs dist is the folder Astro wrote during the build step. kecker-docs
is the name of the project in your Cloudflare Pages dashboard, which does not have to match
your repository name. Wrangler uploads the files, Cloudflare propagates them to its edge
nodes, and the new version is live within seconds.
GitHub stores the source code, not the built output. Pushing to GitHub is your version control commit, not your deployment. The two steps are intentionally separate. Cloudflare can also be configured to auto-deploy whenever you push to a branch (continuous deployment), but the site currently deploys manually via the Wrangler command above.
10. The Build-Deploy Cycle
Here is the full workflow from edit to live, written out as a recipe:
- Edit files in
src/. -
Run
npm run dev. This starts a local development server atlocalhost:4321. Like running the app in the Android Emulator: your changes appear in the browser instantly as you save files, no rebuild required. -
When you are happy with the changes, run
npm run build. Astro compiles all pages and writes the output todist/. This is your release build. Checkdist/to confirm the files look right. -
Deploy to Cloudflare:
npx wrangler pages deploy dist --project-name kecker-docs -
Save to GitHub:
git add . && git commit -m "Your message" && git push
Steps 4 and 5 are independent. Cloudflare does not know about GitHub unless you configure integration. Deploying to Cloudflare makes the site live. Pushing to GitHub saves your history. Both matter.
11. What "Static Site Generation" Actually Means
There are two broad models for delivering web pages to users. The first: a server receives a request, runs code, builds an HTML response, and sends it back. This is what most app backends do. The second: HTML is generated once at build time from source files, the output is stored as plain files, and a server sends those files directly without running any code. Astro does the second.
When someone visits kecker.co, Cloudflare sends back a pre-built HTML file from its edge node. There is no application server. No database query. No server-side code execution. Just a file transfer. This is extremely fast and costs almost nothing to operate.
Here is the Android analogy that makes this click: imagine if, instead of inflating layouts at runtime, you pre-rendered every screen as a bitmap during the Gradle build and just displayed the right bitmap when the user navigated to that screen. No inflation, no binding, no layout pass. Just read a file and display it. That is static site generation. It works perfectly for content that is the same for every visitor, which describes a marketing and documentation site like kecker.co completely.
The tradeoff: because everything is pre-built, pages cannot vary per user. There is no "show this user's name in the header." For that you would reach for a framework with server-side rendering. But for kecker.co, static is exactly the right choice.
12. Where to Go From Here
If you want to go deeper on any of these topics, these are the resources worth your time:
- docs.astro.build — the official Astro documentation. Well-written, with clear examples. Start with the "Getting Started" guide and the "Core Concepts" section.
- web.dev — Google's web fundamentals guide. Particularly good for Android developers because it explains performance, layout, and CSS in terms that align with how mobile engineers already think. The "Learn CSS" course is excellent.
- developer.mozilla.org (MDN Web Docs) — the authoritative reference for every web API, CSS property, and HTML element. Think of it as the Android developer documentation, but for the web platform. Whenever you see an unfamiliar CSS property or HTML tag, MDN is the first place to look.
The web platform is large, but the fundamentals are stable. HTML, CSS, and the idea that a URL maps to a file have not changed in thirty years. Once those are solid, every framework you encounter is just a different way of generating the same output.