This is a template for an app using Dossier, Astro and SQLite.
npm init using dossierhq/dossier-astro-sqlite-app my-project
cd my-project
git init && git add . && git commit -m '🚀 Created project 🚀'
pnpm install
pnpm run build
pnpm 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
), theeditor
principal is used (specified inDOSSIER_PRINCIPAL_ID
in.env.development
) - In production mode (
pnpm build && pnpm start:production
), thereader
principal is used (specified inDOSSIER_PRINCIPAL_ID
in.env
). Thereader
principal 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.