| | @@ -6,38 +6,63 @@ |
| 6 | 6 | |
| 7 | 7 | ## Status |
| 8 | 8 | |
| 9 | | −Milestone 0 is in progress and the app doesn't boot yet. Everything below marked |
| 10 | | −**(#2)** is carried from the previous attempt and needs re-verifying against Topcoat |
| 11 | | −before it can be trusted. |
| 9 | +The app boots and serves. Everything marked **(#2)** is carried from the previous |
| 10 | +attempt and has **not** been re-verified against Topcoat — treat it as a sketch. |
| 11 | + |
| 12 | +## Requirements |
| 13 | + |
| 14 | +- **rustc ≥ 1.95** — Topcoat 0.5 requires it, and on an older toolchain `cargo add |
| 15 | + topcoat` silently resolves to an empty `topcoat v0.0.0` placeholder rather than |
| 16 | + failing. Verified on 1.97.1. |
| 17 | +- `git` on `PATH` (from Milestone 3 — the protocol server shells out to it) |
| 12 | 18 | |
| 13 | 19 | ## Dev setup |
| 14 | 20 | |
| 15 | 21 | ```bash |
| 16 | | −cargo install topcoat-cli # dev server, asset bundling, watch mode |
| 17 | | −cargo run # or the topcoat CLI once routing is wired |
| 22 | +cargo run # serves on http://127.0.0.1:3000 |
| 23 | +cargo test |
| 24 | +``` |
| 25 | + |
| 26 | +```bash |
| 27 | +cargo install topcoat-cli # dev server: watch, rebuild, asset bundling |
| 28 | +topcoat dev # not yet tried on this project |
| 18 | 29 | ``` |
| 19 | 30 | |
| 20 | | −Topcoat's CLI builds the app, bundles assets, and watches source directories for |
| 21 | | −rebuilds. How that interacts with the embedded SSH server is unresolved — see |
| 22 | | −[current.md](current.md#open-questions). |
| 31 | +`topcoat dev` builds, bundles assets, watches sources, and live-reloads pages that |
| 32 | +include `topcoat::dev::script()`. How that interacts with an embedded SSH server is |
| 33 | +unresolved — see [current.md](current.md#open-questions). |
| 34 | + |
| 35 | +## Configuration |
| 36 | + |
| 37 | +`STEID_`-prefixed env vars via `dotenvy` + `envy`, read into `AppConfig`. Every value |
| 38 | +has a default, so a bare `cargo run` works with no environment at all. |
| 39 | + |
| 40 | +Live now: |
| 41 | + |
| 42 | +``` |
| 43 | +STEID_DATABASE_URL=sqlite:steid.db?mode=rwc # default |
| 44 | +STEID_DATA_DIR=./data # default; bare repos, used from M2 |
| 45 | +``` |
| 46 | + |
| 47 | +The bind address is **not** a `STEID_` variable — Topcoat owns it: |
| 48 | + |
| 49 | +```bash |
| 50 | +HOST=0.0.0.0 PORT=8080 cargo run |
| 51 | +``` |
| 23 | 52 | |
| 24 | | −## Configuration (#2) |
| 53 | +That supersedes attempt #2's `STEID_LISTEN_ADDR`. |
| 25 | 54 | |
| 26 | | −Env vars, `STEID_` prefixed, loaded with `dotenvy` + `envy`. From attempt #2's |
| 27 | | −`.env.dev`: |
| 55 | +Arriving with Milestone 1 (#2) — owner bootstrap and registration policy: |
| 28 | 56 | |
| 29 | 57 | ``` |
| 30 | 58 | STEID_REGISTRATION=personal # personal | invite | open |
| 31 | 59 | STEID_OWNER_EMAIL=admin@localhost.dev |
| 32 | 60 | STEID_OWNER_PASSWORD=changeme |
| 33 | 61 | STEID_OWNER_USERNAME=admin |
| 34 | | −STEID_DATABASE_URL=sqlite:steid.db?mode=rwc |
| 35 | | −STEID_LISTEN_ADDR=127.0.0.1:3000 |
| 36 | | −STEID_DATA_DIR=./data # bare repos live here |
| 37 | 62 | ``` |
| 38 | 63 | |
| 39 | 64 | In `personal` mode the owner account is bootstrapped from `STEID_OWNER_*` on first |
| 40 | | −boot. Keep `.env.prod` out of git. |
| 65 | +boot. Keep `.env` and `.env.prod` out of git — both are gitignored. |
| 41 | 66 | |
| 42 | 67 | ## Repo layout on disk (#2) |
| 43 | 68 | |