Skip to content
Browse documentation
On this page

Project structure

Where the app, the CMS-driven site, the database and the Cloudflare config live.

Emberstack follows the usual Astro layout. Public pages come from EmDash, the app lives under /app, and Cloudflare configuration sits in wrangler.jsonc.

Top level

Path

What it holds

src/

Application code

migrations/

SQL migrations for the app database, generated by Drizzle

seed/seed.json

EmDash's starter content: collections, blocks, menus, settings, pages and posts

seed/docs/

The Markdown source for these docs

scripts/

db-query.ts for read-only SQL, resolve-urls.ts, sync-docs.mjs

public/

Static files served as-is, including /images

skills/emberstack/

Conventions for AI coding agents working on the project

wrangler.jsonc

Worker name, bindings, domains and variables

astro.config.mjs

Astro, the Cloudflare adapter, EmDash and its plugins

drizzle.config.ts

Drizzle Kit settings for migrations

Inside src

Path

What it holds

worker.ts

The Worker entry. It wraps EmDash's Worker and adds the maintenance cron

middleware.ts

Reads the Better Auth session and sets the signed-in user and team on every request

db/

schema.ts, queries.ts, the D1 client in index.ts, and seed.ts

lib/

Auth, payments, email, Datastar helpers and password hashing

actions/

Astro actions for account, team and checkout

pages/app/

The signed-in dashboard: notes, team, settings, activity

pages/api/

Better Auth's handler and the Stripe routes

pages/docs/, pages/blog/

Docs and blog, rendered from EmDash

pages/[slug].astro, pages/index.astro

EmDash pages, including the home page

components/daisy-ui/

The UI component set

components/blocks/

Marketing blocks for EmDash pages

plugins/docs-blocks/

Callout, steps, link card and file tree blocks for docs

layouts/

Base for public pages, App for the dashboard, Docs for these docs

styles/global.css

Tailwind, daisyUI themes and site styles

data/settings.json

Name and custom scripts for the app and sign-in pages

Two databases

The app and the CMS each have their own D1 database. DB holds users, teams, sessions, notes and activity. CMS_DB holds pages, posts, menus and settings, with uploaded media in the MEDIA R2 bucket. They're separate because both systems create a users table. See Database and The CMS.