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.

46 lines
1.2 KiB
Markdown

# quotesdb UI
Yew/Wasm single-page application for browsing and submitting quotes. Compiled by Trunk and hosted on Cloudflare Pages.
## Running locally
```sh
# Terminal 1 — start the API server
cargo run
# Terminal 2 — start the Trunk dev server
trunk serve
```
Open `http://localhost:8080`. The Trunk proxy forwards `/api/*` to `localhost:3000`.
## Building for production
```sh
trunk build --release
```
Output is in `dist/`. Deploy with:
```sh
wrangler pages deploy dist/ --project-name quotesdb-ui
```
## Pages
| Route | Description |
|-------|-------------|
| `/` | Home — random quote + Browse link |
| `/browse` | Paginated list with author/tag filters |
| `/quotes/:id` | Single quote — view, edit, delete |
| `/author/:name` | All quotes by an author |
| `/submit` | Create a new quote |
## Architecture
- **Framework:** Yew 0.22 with `yew-router` 0.19
- **API calls:** `gloo::net::http::Request` (not reqwest — wasm32 incompatible)
- **Auth storage:** `sessionStorage` via `web_sys` — key: `auth_code_{quote_id}`
- **CSS:** Plain CSS, BEM naming (no Tailwind)
- **SPA routing:** `_redirects` file (`/* /index.html 200`) copied to `dist/` by Trunk