This is a template for an app using Dossier, Astro and SQLite.
npm init using dossierhq/dossier-astro-sqlite-app my-projectcd my-projectgit init && git add . && git commit -m '🚀 Created project 🚀'pnpm installpnpm run buildpnpm start
You should now have a working app running at http://localhost:4321. To access the Dossier web interface open http://localhost:4321/dossier/content in your browser. Try to add an entity type to the schema and create some entities.
The home page fetches some published entities and displays their names in a list.
The database is a SQLite database, stored in database/dossier.sqlite.
A Typescript file is generated in src/generated/SchemaTypes.ts based on the Dossier schema whenever you run pnpm run build (or if you explicitly run pnpm run schema-types:generate).
There is no authentication in this example. However, there are two different users used:
- In development mode (
pnpm start), theeditorprincipal is used (specified inDOSSIER_PRINCIPAL_IDin.env.development) - In production mode (
pnpm build && pnpm start:production), thereaderprincipal is used (specified inDOSSIER_PRINCIPAL_IDin.env). Thereaderprincipal can't access the Dossier API.
The Dossier web interface is disabled in production mode.
N.B. Supporting multiple users and real authentication is left as an exercise.