cosmic_applet_avestruz/guide/mod.rs
1// SPDX-License-Identifier: MIT
2
3//! The guide: how Avestruz is put together, and why. Documentation only.
4//!
5//! Every other module says what its own piece does, where the piece is.
6//! These pages say how the pieces go together: what talks to what, what
7//! happens in which order, which relay is asked what, and what was decided
8//! along the way. There is no code in them. They are built with the rest
9//! of the documentation (`just doc-open`), where their diagrams are drawn.
10//!
11//! | Page | What it answers |
12//! |---|---|
13//! | [`architecture`] | What the parts are, what each may know of the others, where each runs, and where things are kept |
14//! | [`flows`] | What happens, step by step: signing in, filling the feed, publishing, bookmarking, searching, zapping |
15//! | [`relays`] | Which relays there are, which of them is asked or told what, and whose word is taken for where a relay is |
16//! | [`protocol`] | Which NIPs are spoken and which kinds are read and written, and where in the code each is |
17//! | [`decisions`] | What was decided and why, the rules everything else keeps to, and what is not there yet |
18//! | [`testing`] | How it is tested, what is not, and every test by name |
19//!
20//! # Where to start
21//!
22//! ```mermaid
23//! flowchart LR
24//! new(["New here"]) --> architecture
25//! architecture --> flows
26//! flows --> relays
27//! change(["About to change something"]) --> decisions
28//! decisions --> testing
29//! nostr(["Wondering what is spoken"]) --> protocol
30//! protocol --> relays
31//! ```
32//!
33//! # How these pages are kept true
34//!
35//! They are doc comments, so they are read by whoever reads the code, and
36//! built by `just check`, which fails on a link that leads nowhere: a
37//! function that is renamed or removed takes the build of the page that
38//! names it down with it. Where a page gives a number (a timeout, a limit)
39//! it links the constant, and the constant is what counts. The diagrams
40//! are checked to parse by `just mermaid-check`. What a diagram *says* is
41//! checked by nobody but its reader: if one disagrees with the code, the
42//! code is right and the diagram wants fixing.
43
44pub mod architecture;
45pub mod decisions;
46pub mod flows;
47pub mod protocol;
48pub mod relays;
49pub mod testing;