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
- View a list of books.
- View a list of authors.
- View a list of genres.
- Search for books by title or description.
- View detailed information about a book (title, description, author, genre, year, and ratings).
- View detailed information about an author (birth year and a list of their books).
- View detailed information about a genre (description and a list of books in that genre).
- Rate a book.
- Update an existing rating.
- Node.js
- pnpm
- A Turso account
- Create a
.env
file based on.env.example
and include the connection details for your Turso database. - Seed the local database using the command
pnpm seed
(this runs theseed.sql
script). - Install the dependencies by running
pnpm install
. - Start the development server with
pnpm dev
.
Note: The seed.sql
file contains a large number of fake ratings to populate the database for demonstration purposes.