An open API service indexing awesome lists of open source software.

https://github.com/bkowshik/flashcards

๐Ÿ“‡ A fast, fully client-side flashcard tool. No login, no server, no analytics.
https://github.com/bkowshik/flashcards

client-side flashcards svelte webapp

Last synced: 17 days ago
JSON representation

๐Ÿ“‡ A fast, fully client-side flashcard tool. No login, no server, no analytics.

Awesome Lists containing this project

README

          

# ๐Ÿ“‡ flashcards

A fast, fully client-side flashcard tool. No login, no server, no analytics. Cards live in your browser; export the whole library to JSON any time.

- **Live:**
- **Source:**

## Quick start

Requires Node 20+ and npm.

```bash
npm install
npm run dev
```

Opens at `http://localhost:5173` with hot module reload.

## Scripts

| Command | What it does |
|---|---|
| `npm run dev` | Vite dev server with HMR |
| `npm run build` | Production build โ†’ `dist/` |
| `npm run preview` | Serve the production build locally |
| `npm run check` | `svelte-check` (types + Svelte diagnostics) |

## Stack

- **[Vite](https://vite.dev)** โ€” build tool and dev server with HMR.
- **[Svelte 5](https://svelte.dev)** โ€” UI framework with the runes API.
- **TypeScript** โ€” type safety across the app.
- **[`idb-keyval`](https://github.com/jakearchibald/idb-keyval)** โ€” tiny IndexedDB wrapper for local card storage.
- **[`marked`](https://marked.js.org) + [`DOMPurify`](https://github.com/cure53/DOMPurify)** โ€” markdown rendering, sanitized.
- **[Geist Sans + Geist Mono](https://vercel.com/font)** โ€” self-hosted via [Fontsource](https://fontsource.org).

Builds to **~46 KB gzipped JS** + ~3.5 KB CSS, under the 50 KB target.

## Project layout

```
src/
โ”œโ”€โ”€ App.svelte โ† top-level layout + view switch
โ”œโ”€โ”€ app.css โ† CSS tokens, shared button system, base styles
โ”œโ”€โ”€ main.ts โ† font imports, mount()
โ”œโ”€โ”€ components/
โ”‚ โ””โ”€โ”€ Header.svelte โ† brand + nav tabs
โ”œโ”€โ”€ lib/
โ”‚ โ”œโ”€โ”€ router.ts โ† hash-based router
โ”‚ โ”œโ”€โ”€ storage.ts โ† IndexedDB get/save/delete
โ”‚ โ”œโ”€โ”€ markdown.ts โ† marked + DOMPurify
โ”‚ โ”œโ”€โ”€ theme.ts โ† light / dark / system
โ”‚ โ”œโ”€โ”€ shortcuts.ts โ† global g-chord nav handler
โ”‚ โ”œโ”€โ”€ keyboard-help.ts โ† shortcut reference rendered on About
โ”‚ โ”œโ”€โ”€ export.ts โ† JSON backup download
โ”‚ โ”œโ”€โ”€ import.ts โ† JSON merge restore
โ”‚ โ”œโ”€โ”€ id.ts โ† URL-safe 8-char id generator
โ”‚ โ””โ”€โ”€ types.ts โ† Card type
โ””โ”€โ”€ views/
โ”œโ”€โ”€ Add.svelte โ† capture / edit a card
โ”œโ”€โ”€ Browse.svelte โ† list, export, import, delete
โ”œโ”€โ”€ Quiz.svelte โ† shuffled queue with flip animation
โ””โ”€โ”€ About.svelte โ† intro, settings, shortcuts, data location
```

## Routes

- `#/add` โ€” capture a new card (default)
- `#/edit/:id` โ€” edit an existing card
- `#/browse` โ€” list of all cards
- `#/quiz` โ€” flip through a shuffled queue
- `#/about` โ€” intro, theme picker, keyboard shortcuts, data location

## Keyboard

Nav is Gmail-style chord shortcuts: `g a` (Add) ยท `g b` (Browse) ยท `g q` (Quiz). Quiz: `Space` to flip, `n`/`p` (or `โ†’`/`โ†`) to navigate, `e` to edit. Save in Add is `โŒ˜/Ctrl + Enter`; `Esc` clears or cancels.

Full list on the [About page](https://flashcards.bkowshik.in/#/about).

## Data

Cards live in your browser's IndexedDB under the `flashcards` database. Nothing is sent anywhere.

- **Export** (Browse) โ€” download the whole library as JSON.
- **Import** (Browse) โ€” merge a JSON file back in.
- Wipe everything: DevTools โ†’ Application โ†’ IndexedDB โ†’ `flashcards` โ†’ Delete database.

## Deploy

Hosted on [Cloudflare Pages](https://pages.cloudflare.com) with Git integration โ€” every push to `main` rebuilds and ships.

| Setting | Value |
|---|---|
| Build command | `npm run build` |
| Build output | `dist/` |
| Node version | `20` (via `NODE_VERSION` env var) |

## License

[MIT](LICENSE) ยฉ 2026 Bhargav Kowshik.