This is a demo application showcasing how to work with a SQLite database (hosted on Turso) and SvelteKit.
erDiagram
authors {
INTEGER id PK
TEXT name
INTEGER birth_year
}
genres {
INTEGER id PK
TEXT name
TEXT description
}
books {
INTEGER id PK
TEXT title
INTEGER author_id FK
INTEGER genre_id FK
INTEGER published_year
TEXT description
}
ratings {
INTEGER id PK
TEXT user_id
INTEGER book_id FK
INTEGER rating
TIMESTAMP created_at
TIMESTAMP updated_at
}
authors ||--o{ books : writes
genres ||--o{ books : includes
books ||--o{ ratings : receives
.env
file based on .env.example
and include the connection details for your Turso database.pnpm seed
(this runs the seed.sql
script).pnpm install
.pnpm dev
.Note: The seed.sql
file contains a large number of fake ratings to populate the database for demonstration purposes.