You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Elijah Voigt c64b6bf56e fix(quotesdb): fix D1 exec() newline truncation in migrations, add justfile and migrate command
D1's exec() treats newlines as statement separators, causing multiline
CREATE TABLE statements to be truncated after the first line and return
"incomplete input: SQLITE_ERROR" on every request.

Fix: switch run_migrations() in D1Repository to use prepare(sql).run()
instead of exec(sql), which treats the full string as a single statement.

Also moves db and handlers modules from src/bin/api/ to src/ (library
modules), adds justfile with build/deploy/migrate recipes, adds
migrations/schema.sql for direct wrangler d1 execute usage, and adds
wrangler.toml for worker deployment configuration.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3 months ago
..
.claude quotesdb scaffolding 3 months ago
.nbd chore(quotesdb): close ticket 3f22f2 3 months ago
api feat(quotesdb): add reports table and POST /api/quotes/:id/report endpoint 3 months ago
docs feat(quotesdb): add Cloudflare WAF rate limiting rules via OpenTofu 3 months ago
infra feat(quotesdb): add Cloudflare WAF rate limiting rules via OpenTofu 3 months ago
migrations fix(quotesdb): fix D1 exec() newline truncation in migrations, add justfile and migrate command 3 months ago
src fix(quotesdb): fix D1 exec() newline truncation in migrations, add justfile and migrate command 3 months ago
tests feat(quotesdb): implement API DB layer and all HTTP handlers 3 months ago
.env.example feat(quotesdb): implement API DB layer and all HTTP handlers 3 months ago
.gitignore fix frontend proxy issue 3 months ago
CLAUDE.md chore(quotesdb): resolve all triage tickets and create implementation tickets 3 months ago
Cargo.lock feat(quotesdb): Cloudflare Turnstile CAPTCHA on submit 3 months ago
Cargo.toml feat(quotesdb): Cloudflare Turnstile CAPTCHA on submit 3 months ago
README.md refactor(quotesdb): collapse to single crate with api and ui binaries 3 months ago
TODO.md chore(quotesdb): commit tickets, TODO, and infra README update 3 months ago
Trunk.toml fix frontend proxy issue 3 months ago
_redirects chore(quotesdb): add _redirects SPA fallback for Cloudflare Pages routing 3 months ago
build.rs feat(quotesdb): add build.rs to convert api/openapi.yaml to JSON at compile time 3 months ago
index.html feat(quotesdb): Cloudflare Turnstile CAPTCHA on submit 3 months ago
justfile fix(quotesdb): fix D1 exec() newline truncation in migrations, add justfile and migrate command 3 months ago
wrangler.toml fix(quotesdb): fix D1 exec() newline truncation in migrations, add justfile and migrate command 3 months ago

README.md

quotesdb

A quotes web application — browse, submit, and manage memorable quotes.

What

quotesdb is a full-stack web application with:

  • A JSON REST API (api binary) backed by Cloudflare Workers + D1 (SQLite)
  • A Yew/Wasm frontend (ui binary) hosted on Cloudflare Pages
  • NanoID-identified quotes protected by a 4-word passphrase auth code

How

Single Cargo crate with two binaries sharing common types via src/lib.rs:

  • api: Axum on Tokio, targeting Cloudflare Workers via workers-rs, SQLx + D1
  • ui: Yew compiled to wasm32-unknown-unknown via Trunk

Run

# Start API server (local dev)
cargo run

# Start UI dev server (requires wasm32 toolchain + trunk)
trunk serve

Test

cargo fmt && cargo check && cargo clippy && cargo test

License

Licensed under either of Apache License, Version 2.0 or MIT License at your option.

Disclaimer

This software was written with Claude Code (claude-sonnet-4-6).