Part I — Preparing the ground
01 · Concepts: the names of things
Before touching the tree, learn the name of each of its parts. In Baobáxia the concepts have Portuguese names, and the code respects those names.
Everything is a Saber
The most important idea in the project: there is only one entity, the Saber ("knowledge", baobaxia/core/saber.py). A photo, an article, a person, a community, a whole collection — everything is a Saber with a different nature field.
| nature | What it represents | Where it lives on disk |
|---|---|---|
galaxia | a collection (the git repository) | the root of the galaxy |
mucua | a community's machine, with Baobáxia installed (see below) | mucuas/<slug>+<uuid8>/ |
territorio | the ground, geographic and symbolic | territorios/ |
mocambola | a person | mucuas/…/mocambolas/ |
grupo | a set of mocambolas | mucuas/…/grupos/ |
midia, artigo, evento, colecao | the published collection | mucuas/…/saberes/<folder>/ |
relacao | a link between two saberes | mucuas/…/saberes/relacao/ |
pedido, rota | the network machinery (store-and-forward) | mucuas/…/pedidos/, …/rotas/ |
Why "mucua" and not "server". Elsewhere, the machine that keeps and hands out data is called a server. We don't like that name: it carries the idea of a machine that serves, put to work without end — a relationship of exploitation. We prefer a relationship of care: the mucua is the baobab's fruit, which keeps the seed and feeds; whoever keeps it running cares for it (the PAJÉ). The word shows up in code and in other tools' docs ("XMPP server",
hooks.server.ts); in Baobáxia, it's mucua.
Natures live in a registry (baobaxia/natures/__init__.py), and each one has a pydantic validation schema (natures/schemas.py). Communities can create new natures through the API (POST /natures, services/nature_defs.py).
classDiagram
direction LR
class Saber {
+str uuid
+str nature
+str slug
+str|dict name
+str galaxia
+str mucua
+str creator
+datetime created
+datetime updated
+str signature
+list~str~ applications
+str visibility
+dict data
+list~ContentRef~ content
+to_metadata() dict
+to_index_metadata() dict
+to_public_dict(lang) dict
}
class ContentRef {
+str filename
+str mimetype
+int size
+str hash «git-annex key»
+bool is_local «index only»
+float duracao
}
class NatureSpec {
+str name
+str folder
+bool structural
+list indexes
+list default_applications
}
class Ref {
+str galaxia
+str mucua
+str saber
}
Saber "1" *-- "0..*" ContentRef : attachments
Saber ..> NatureSpec : nature
Saber ..> Ref : relations and collection members
The words of the network
- Mucua — the baobab fruit. Each installation is a mucua, with its own UUID stored in
~/.baobaxia/mucua.yaml(infra/mucua_local.py). The mucua owns a home territory and a default galaxy. - Galaxy (
galaxia) — a collection, which is a git + git-annex repository. A mucua keeps several galaxies; the same galaxy lives in several mucuas. - Mocambola — the person (from mocambo, a quilombo). They have the same UUID and the same key across the whole network; the role is per galaxy.
- Territory (
territorio) — the ground the mucua anchors. Saberes inherit the mucua's territory unless they say otherwise. - Link / route — the way a galaxy synchronizes: a git remote (link) or a sneakernet path (route,
rota). - Request (
pedido) — "I want a copy of this file": it travels through the network to someone who has the file and brings it back. - Lens / application — a way of looking at the same saberes: collection, blog, map, calendar, timeline, stories (
applications/).
Roles
USER ⊂ PAJÉ ⊂ OXALÁ (constants.ROLE_LEVEL). USER looks after their own saberes; PAJÉ looks after everything in their mucua; OXALÁ administers the galaxies where they hold that role. Module 05 goes into detail.
Visibility and protection
Two axes that add up:
visibility:public|mucua|private(a field of the saber);data.protecao:publico|acl(only theleitores, the readers) |cifrado(only the readers, with real cryptography).
And the galaxy can have acesso: membros — a door before all the others.
Practice
- Open
natures/schemas.pyand find the schema forevento. Which fields are required? Create an event through the/docsAPI and watch validation reject a wrong field. - In
core/saber.py, compareto_metadata()andto_index_metadata(). Why can'tis_localgo into the file? - List the relations in
natures/relacoes.py. Which are symmetric? What is the inverse ofe_copia_de?
To talk about
- Why does "everything is a Saber" help a community create new things (a
receita(recipe),cantiga(song),planta(plant) nature) without needing a programmer? - Who decides what is public? The person, the mucua, the galaxy?
