StatsHub Docs

StatsHub documentation

Four apps over one Postgres database, and a Go API being ported route-for-route from a Next.js one. Start with the app you are working in.

Start with the app you are working in. Each has its own section — what it does, how a screen is put together, where its data comes from, and the rules for writing code in it.

An app is a deployable: it has a Dockerfile, a service in docker-compose.yml and a port. Code that two of them share is a package instead, and the HTTP surface they all read through is the API — one Go service behind two prefixes, not an app.

Ports

AppDev port
legacy3000
docs3001
web3002
api8080
expo (Metro)8142

bun run dev starts all of them except legacy. Two apps sharing a port fail in a way that reads like a caching bug, so check this table before picking one for a new app.

How each app's pages are laid out

The bigger apps carry the same five, in the same order, so you can read one app against another:

PageWhat is on it
OverviewWhat the app is, the stack in it, what it does and how it is built
FeaturesEvery screen or surface it serves, and what each one is for
ArchitectureHow a screen is put together — routing, layout, the seams
DataWhere the data comes from, what caches it, what invalidates it
ConventionsThe rules for writing code in it, and what breaks when you skip one

Smaller apps stop earlier. legacy is one page because it is being deleted.

What every deployable has

  • apps/<name>/Dockerfile, built with the repository root as the context, not the app directory. The first stage runs turbo prune <name> --docker so a change in an unrelated app does not invalidate the layer cache.
  • A service in docker-compose.yml.
  • Scripts named dev, build, lint, typecheck — Turbo picks a task up by script name, so nothing has to be registered.
  • Root shortcuts: bun run dev:<name>, build:<name>, start:<name>.
  • A /api/health route, or an equivalent, that answers before its dependencies are reachable. It is what the container HEALTHCHECK and Coolify both call.

Add an app is the walkthrough, and it ends with the docs page — an app without one is invisible from here.

Not an app

Working here

Every doc in the repo is a file under apps/statshub-docs/content/docs. There is no docs/ at the repository root and none inside an app — if you find one, it is a leftover, and it belongs here.

On this page