Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dossierhq/dossier-astro-sqlite-app
Template for an app using Dossier, Astro and SQLite
https://github.com/dossierhq/dossier-astro-sqlite-app
astro cms dossier sqlite template
Last synced: 3 months ago
JSON representation
Template for an app using Dossier, Astro and SQLite
- Host: GitHub
- URL: https://github.com/dossierhq/dossier-astro-sqlite-app
- Owner: dossierhq
- License: mit
- Created: 2023-11-29T23:58:56.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-12T11:16:20.000Z (10 months ago)
- Last Synced: 2024-04-14T03:10:54.108Z (10 months ago)
- Topics: astro, cms, dossier, sqlite, template
- Language: TypeScript
- Homepage: https://dossierhq.dev
- Size: 1.56 MB
- Stars: 2
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# dossier-astro-sqlite-app
[![Node CI](https://github.com/dossierhq/dossier-astro-sqlite-app/actions/workflows/node.js.yml/badge.svg)](https://github.com/dossierhq/dossier-astro-sqlite-app/actions/workflows/node.js.yml)
This is a template for an app using [Dossier](https://dossierhq.dev/), [Astro](https://astro.build/)
and [SQLite](https://www.sqlite.org/).## Getting started
- `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`).
## Auth
There is no authentication in this example. However, there are two different users used:
- In development mode (`pnpm start`), the `editor` principal is used (specified in `DOSSIER_PRINCIPAL_ID` in `.env.development`)
- In production mode (`pnpm build && pnpm start:production`), the `reader` principal is used (specified in `DOSSIER_PRINCIPAL_ID` in `.env`). The `reader` 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.