Skip to content

Commit ea47738

Browse files
committed
Dev docs
1 parent a0b1892 commit ea47738

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

README.md

+35-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,37 @@
11
# Low-traffic neighbourhood tool v2
22

3-
This is a WIP next iteration of <ltn.abstreet.org>
3+
This is a new version of [ltn.abstreet.org](https://ltn.abstreet.org). It
4+
doesn't have all features from v1 yet, but it solves many problems with the
5+
original. Please try both versions and give feedback.
6+
7+
## Developer docs
8+
9+
### Installation
10+
11+
You'll need:
12+
[npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm),
13+
[wasm-pack](https://github.com/rustwasm/wasm-pack), and
14+
[cargo](https://www.rust-lang.org/tools/install).
15+
16+
`cd web`, and then:
17+
18+
- `npm i` to install dependencies
19+
- `npm run wasm` to rebuild the Rust backend
20+
- vite doesn't automatically rebuild when you edit things
21+
- `npm run dev` to run locally
22+
- Changes to the Svelte/CSS usually auto-reload in your browser
23+
- `npm run fmt` to auto-format code
24+
- `npm run check` to see TypeScript errors
25+
26+
The `tests` directory has some diff-based tests. `cd backend; cargo test
27+
--release` will run them.
28+
29+
### Architecture
30+
31+
The Rust `backend` crate gets compiled to WASM, with generally type-unsafe APIs
32+
in `lib.rs`. The Svelte frontend calls these in the main thread (though moving
33+
to web workers later is a possibility). The "important" state is kept in the
34+
backend, while the frontend has more ephemeral UI state. The main state is
35+
serialized as GeoJSON and kept in the user's browser local storage. The
36+
frontend is effectively a single page app, with the `Mode` toggling between
37+
different pages.

0 commit comments

Comments
 (0)