Running the portal
Where to run the trackr portal - Cloudflare, Docker or your own server - what each needs, and how to get from an empty install to the first measured page view.
The portal (dashboard and API, apps/README.md) does not tie you to a platform. It is one codebase with two ways to run it, and both use the same pages, API and migrations. Pick what fits where you already host things.
| Cloudflare | Docker or any Node host | |
|---|---|---|
| Runs as | One Worker, pages as static assets, cron trigger | Node server in a container (or node dist-node/server.js) |
| Database | D1 (SQLite), or Postgres through Hyperdrive | Postgres 15 or newer |
| Nightly maintenance | Cron trigger in wrangler.toml |
The server runs it itself |
| First admin | A SQL statement run with wrangler d1 execute |
trackr admin <email> |
| Good when | You already use Cloudflare and want no server to look after | You have a server, or want everything in one region you choose |
Nothing else depends on the choice: the Astro integration, Zaraz, forwarding and the pixel only need the portal’s address.
Steps, whatever the platform
- Run the portal with one of the two ways in the
installation section.
The repository holds no ready-made deployment: copy
apps/dashboard/wrangler.tomlorcompose.yamland replace the names, IDs andDEMO_SITE_IDwith your own. - Choose the region of the data. D1: create it with
--jurisdiction eu. Postgres: a region in the EU. See Privacy policy and records. - Create the first admin and sign in.
- Add the site in the admin area. Its domains decide which pages the portal accepts events from.
- Build in the tracker the way that suits the site: the Astro integration, Zaraz,
createHandlerin your own server, or the pixel. - Check that the page views show up in the dashboard.
Choosing the database
D1 is the least to run: no server, no connection string. Postgres suits larger volumes, reports you write yourself, and hosting where D1 is not an option. A Worker can use Postgres through a Hyperdrive binding. Both keep the same tables; you can start on one and import the history into the other later.