1
Fork 0
mirror of https://github.com/benkoppe/drawthis synced 2026-09-19 17:59:52 -07:00
No description
  • TypeScript 87.1%
  • Svelte 11.8%
  • Nix 0.6%
  • JavaScript 0.3%
  • HTML 0.1%
  • Other 0.1%
Find a file
2026-06-26 18:20:49 -07:00
.opencode Sveltekit: init project 2026-06-22 18:25:51 -07:00
.vscode Sveltekit: init project 2026-06-22 18:25:51 -07:00
nix web: tighten iPhone mobile viewport layout 2026-06-26 17:38:01 -07:00
src web: canonicalize viewport height class 2026-06-26 18:20:49 -07:00
static references: refine taxonomy feed model 2026-06-25 23:22:27 -07:00
.env.example server: require explicit reference providers 2026-06-23 21:53:39 -07:00
.envrc Nix: init flake 2026-06-22 18:47:18 -07:00
.gitignore repo: add claude local settings to gitignore 2026-06-24 19:01:54 -07:00
.mcp.json Sveltekit: init project 2026-06-22 18:25:51 -07:00
.npmrc Sveltekit: init project 2026-06-22 18:25:51 -07:00
.prettierignore Sveltekit: init project 2026-06-22 18:25:51 -07:00
.prettierrc Sveltekit: init project 2026-06-22 18:25:51 -07:00
AGENTS.md docs: add GUIDELINES.md 2026-06-22 18:55:11 -07:00
CLAUDE.md docs: add GUIDELINES.md 2026-06-22 18:55:11 -07:00
eslint.config.js Sveltekit: init project 2026-06-22 18:25:51 -07:00
flake.lock Nix: init flake 2026-06-22 18:47:18 -07:00
flake.nix Nix: init flake 2026-06-22 18:47:18 -07:00
GUIDELINES.md docs: add GUIDELINES.md 2026-06-22 18:55:11 -07:00
package.json references: simplify history IndexedDB access 2026-06-23 20:18:59 -07:00
PLAN.md web: add initial reference practice loop 2026-06-23 04:22:07 -07:00
playwright.config.ts web: add initial reference practice loop 2026-06-23 04:22:07 -07:00
pnpm-lock.yaml references: simplify history IndexedDB access 2026-06-23 20:18:59 -07:00
pnpm-workspace.yaml pnpm: add empty packages list to fix cloudflare 2026-06-23 21:19:32 -07:00
README.md server: require explicit reference providers 2026-06-23 21:53:39 -07:00
tsconfig.json web: add initial reference practice loop 2026-06-23 04:22:07 -07:00
vite.config.ts Sveltekit: init project 2026-06-22 18:25:51 -07:00
worker-configuration.d.ts references: make category filter drive next image 2026-06-25 13:15:56 -07:00
wrangler.jsonc wrangler: set env vars 2026-06-24 18:35:12 -07:00

DrawThis ✏️

DrawThis is a fast drawing-reference practice tool. It brings a reference image to the user immediately so they can practice visual replication without searching, curating, or deciding what to draw next.

Reference providers are configured server-side through private environment variables. Pexels is the preferred external provider when enabled, Openverse can be enabled as an optional fallback, and local references are a dev/mock provider that should be disabled for production if you do not want users to see them.

Development

Development commands assume the Nix dev shell from this repository. If direnv is not active, enter it manually:

nix develop

Install dependencies:

pnpm install

Configure at least one reference provider before starting the development server.

Reference provider setup

Create a local environment file:

cp .env.example .env

Every reference provider is explicitly toggleable through private server env vars and defaults to disabled. At least one provider must be explicitly enabled. When multiple providers are enabled, DrawThis tries them in this order: Pexels, Openverse, then local.

Pexels-only production-style setup:

DRAWTHIS_PEXELS_ENABLED=true
DRAWTHIS_PEXELS_API_KEY=your-pexels-api-key
DRAWTHIS_OPENVERSE_ENABLED=false
DRAWTHIS_LOCAL_REFERENCES_ENABLED=false

Local development without API keys:

DRAWTHIS_LOCAL_REFERENCES_ENABLED=true

Optional Pexels override for tests against a local/mock Pexels-compatible endpoint:

DRAWTHIS_PEXELS_ENABLED=true DRAWTHIS_PEXELS_API_KEY=test DRAWTHIS_PEXELS_API_BASE_URL=http://localhost:8788/v1 pnpm dev

Optional Openverse fallback:

DRAWTHIS_OPENVERSE_ENABLED=true pnpm dev

Optional Openverse override for tests against a local/mock Openverse-compatible endpoint:

DRAWTHIS_OPENVERSE_ENABLED=true DRAWTHIS_OPENVERSE_API_BASE_URL=http://localhost:8788/v1 pnpm dev

At least one provider must be explicitly enabled. Local references are mock/dev assets, not a production-quality fallback. Keep provider credentials server-side and never commit secrets or expose them to the browser.

Start the development server after configuring a provider:

pnpm dev

Provider search metadata is cached server-side through the Cloudflare Cache API when available, with an in-memory fallback for local/dev/test runtimes. DrawThis caches normalized provider results according to each provider's cache policy and does not proxy or cache provider image bytes unless a provider explicitly allows that separately.

Run type and Svelte checks:

pnpm check

Run linting and formatting checks:

pnpm lint

Run unit tests once:

pnpm test:unit -- --run

Run end-to-end tests:

pnpm test:e2e

Playwright uses the Nix-provided browser binaries from the dev shell. Do not run playwright install on Nix; those downloaded generic Linux binaries will not run reliably here.

Build for production:

pnpm build

Preview the Cloudflare worker build:

pnpm preview

Product Direction

The early interface should stay plain, utilitarian, and focused on the practice loop: see a reference, draw it, advance to the next reference. Decorative UI work is intentionally deferred unless it directly improves clarity, accessibility, or practice speed.