A DCI (Data, Context and Interaction) project based on this use case which specifies an automatic library borrowing machine, consisting of a screen, printer and scanner. Using SvelteKit of course!
Install dependencies and start the development server:
pnpm install
pnpm dev
Drag and drop items to interact with the machine. PIN code for the card is 1234
.
library.ts
- Data for the libraryprinter.svelte.ts
,rfidScanner.ts
- Interfaces and components for the hardware simulation.errors.ts
,utils.ts
- Utilities
Data models for the library, based on schema.org, validation with Zod.
library.ts
- Library (librarySchema
) with members and current offerslibraryItem.ts
- Definitions of items that can be borrowedcommon.ts
- Common validation schemas
DCI Contexts for the app:
libraryMachine.ts
- Connects all the parts of the borrowing machine.borrowItem.ts
- Separate (reusable) Context for borrowing a library item.
Components for displaying the machine.
Entrypoint for the app, +page.svelte
.
- Bluray discs for borrowing (to demonstrate different item types)
- Force remove card after 3 failed attempts
- Error handling for unexpected Exceptions