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.
- Host: GitHub
- URL: https://github.com/bkowshik/flashcards
- Owner: bkowshik
- License: mit
- Created: 2026-05-27T05:40:09.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2026-05-27T07:08:58.000Z (30 days ago)
- Last Synced: 2026-05-27T08:16:58.933Z (30 days ago)
- Topics: client-side, flashcards, svelte, webapp
- Language: Svelte
- Homepage: https://flashcards.bkowshik.in
- Size: 188 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.