chore: updated docs afc2ce33
Steve · 2026-04-25 12:02 4 file(s) · +158 −0
apps/library/README.md (added) +73 −0
1 +
# Library
2 +
3 +
A minimal personal book tracker
4 +
5 +
## Quickstart
6 +
7 +
```bash
8 +
git clone https://github.com/stevedylandev/andromeda.git
9 +
cd andromeda
10 +
cp apps/library/.env.example apps/library/.env
11 +
# Edit .env with your admin password
12 +
cargo run -p library
13 +
```
14 +
15 +
### Environment Variables
16 +
17 +
| Variable | Description | Default |
18 +
|---|---|---|
19 +
| `ADMIN_PASSWORD` | Password for admin login | `changeme` |
20 +
| `LIBRARY_DB_PATH` | SQLite database file path | `library.sqlite` |
21 +
| `GOOGLE_BOOKS_API_KEY` | Google Books API key for search | |
22 +
| `BASE_URL` | Public base URL | `http://localhost:3000` |
23 +
| `HOST` | Server bind address | `127.0.0.1` |
24 +
| `PORT` | Server port | `3000` |
25 +
| `COOKIE_SECURE` | Enable HTTPS-only cookies | `false` |
26 +
27 +
## Overview
28 +
29 +
A simple, self-hosted book tracker built with Rust. Highlights:
30 +
- Single Rust binary with embedded assets
31 +
- Password authentication with session cookies
32 +
- Track books across Read, Reading, and Want to Read
33 +
- Google Books search to add titles with cover art and ISBN
34 +
- Per-book notes
35 +
- JSON API for listing and fetching books
36 +
- SQLite for persistent storage
37 +
38 +
## Structure
39 +
40 +
```
41 +
library/
42 +
├── src/
43 +
│   ├── main.rs          # App entrypoint, env vars, router
44 +
│   ├── auth.rs          # Password verification and sessions
45 +
│   ├── db.rs            # SQLite layer (books)
46 +
│   └── google_books.rs  # Google Books API client
47 +
├── templates/           # Askama HTML templates
48 +
├── static/              # Favicons, og:image, styles
49 +
├── Dockerfile           # Multi-stage build (Rust + Debian slim)
50 +
└── Cargo.toml
51 +
```
52 +
53 +
## Deployment
54 +
55 +
### Docker (recommended)
56 +
57 +
From the repo root:
58 +
59 +
```bash
60 +
cp apps/library/.env.example apps/library/.env
61 +
# Edit .env
62 +
docker compose up -d library
63 +
```
64 +
65 +
This will start Library on port `4646` with a persistent volume for the SQLite database.
66 +
67 +
### Binary
68 +
69 +
```bash
70 +
cargo build --release -p library
71 +
```
72 +
73 +
The resulting binary at `./target/release/library` is self-contained with all assets embedded. Copy it to your server with a configured `.env` file and run it directly.
docs/docs/pages/apps/library.mdx (added) +80 −0
1 +
# Library
2 +
3 +
A simple, self-hosted book tracker built with Rust.
4 +
5 +
- Single binary with embedded assets
6 +
- Password authentication with session cookies
7 +
- Track books across Read, Reading, and Want to Read
8 +
- Google Books search to add titles with cover art and ISBN
9 +
- Per-book notes
10 +
- JSON API for listing and fetching books
11 +
- Dark themed UI with Commit Mono font
12 +
- SQLite for persistent storage
13 +
14 +
## Configure
15 +
16 +
### Environment Variables
17 +
18 +
| Variable | Description | Default |
19 +
|---|---|---|
20 +
| `ADMIN_PASSWORD` | Password for admin login | `changeme` |
21 +
| `LIBRARY_DB_PATH` | SQLite database file path | `library.sqlite` |
22 +
| `GOOGLE_BOOKS_API_KEY` | Google Books API key for search | |
23 +
| `BASE_URL` | Public base URL | `http://localhost:3000` |
24 +
| `HOST` | Server bind address | `127.0.0.1` |
25 +
| `PORT` | Server port | `3000` |
26 +
| `COOKIE_SECURE` | Enable HTTPS-only cookies | `false` |
27 +
28 +
The `GOOGLE_BOOKS_API_KEY` is optional — searches work without it but are rate-limited.
29 +
30 +
## Deploy
31 +
32 +
### Docker
33 +
34 +
From the repo root:
35 +
36 +
```bash
37 +
cp apps/library/.env.example apps/library/.env
38 +
# Edit .env with your admin password
39 +
docker compose up -d library
40 +
```
41 +
42 +
This will start Library on port `4646` with a persistent volume for the SQLite database.
43 +
44 +
### Binary
45 +
46 +
Build from source:
47 +
48 +
```bash
49 +
cargo build --release -p library
50 +
```
51 +
52 +
The resulting binary at `./target/release/library` is self-contained with all assets embedded. Copy it to your server with a configured `.env` file and run it directly.
53 +
54 +
## Use
55 +
56 +
Your library is publicly viewable at `/`, which redirects to `/read`. Three tabs split the collection:
57 +
58 +
| Page | Description |
59 +
|---|---|
60 +
| `/read` | Books you've finished |
61 +
| `/reading` | Books you're currently reading |
62 +
| `/want` | Books you want to read |
63 +
64 +
### Admin
65 +
66 +
Log in at `/admin/login` with your configured password to access the admin pages.
67 +
68 +
| Page | Description |
69 +
|---|---|
70 +
| `/admin` | Admin dashboard listing every book in your library |
71 +
| `/admin/search?q=...` | Search Google Books to add a title |
72 +
73 +
From the admin dashboard you can change a book's status, save notes, or remove a book.
74 +
75 +
### API
76 +
77 +
| Endpoint | Description |
78 +
|---|---|
79 +
| `GET /api/books` | List all books. Filter with `?status=read\|reading\|want` |
80 +
| `GET /api/books/{id}` | Fetch a single book by ID |
docs/docs/pages/deploy-railway.mdx +1 −0
39 39
40 40
- [Posts](/apps/posts) - A minimal CMS blog with an admin interface.
41 41
- [Jotts](/apps/jotts) - A minimal self-hosted markdown notes app.
42 +
- [Library](/apps/library) - A minimal personal book tracker.
42 43
- [Cellar](/apps/cellar) - A minimal wine collection tracker.
43 44
- [Feeds](/apps/feeds) - A minimal RSS reader that sends you back to the author's site to read posts in their original context.
44 45
- [Shrink](/apps/shrink) - A simple self-hosted tool for compressing and resizing images.
docs/vocs.config.ts +4 −0
53 53
          link: '/apps/jotts',
54 54
        },
55 55
        {
56 +
          text: 'Library',
57 +
          link: '/apps/library',
58 +
        },
59 +
        {
56 60
          text: 'OG',
57 61
          link: '/apps/og',
58 62
        },