4.3 KiB
Arcology FastAPI + Org Site Engine
Arcology in Brief
The Arcology Project is one of my "forever projects" – a system for refining and publishing the ideas in my Concept Operating System or a programming project to build a small web-server for my org-mode files.
This current iteration is self-hosted, implemented in a Python 3 "batteries-included" webserver package called FastAPI. The database is, rather unfortunately, generated by Emacs still as there is not a good enough parser for Org Mode which can extract the required metadata, in Python or any other language. This is handled by another piece of abstraction scaffolding in my Concept Operating System called Arroyo Systems Management.
This version of the Arcology is the most well-defined yet, I feel like I am boiling this down to something which could be executed in most programming languages, and that is good.
Table of Contents
- Arcology is built with Poetry.
poetry2nix
turns thepyproject.toml
file in to a set of Nix derivations that can provide a dev shell and deploy to a NixOS Wobserver. -
Arcology uses a databases generated with Arroyo: Arroyo Arcology Generator containing:
- An Arroyo Module which extracts metadata from my org-mode files and persists them in a SQLite database
- SQLModels for the metadata tables in the Arroyo database centered around the Arcology Page which represents a single org-mode document with an Arcology publishing keyword.
- Arcology can Generate and Expose Atom Feeds for pages' date-stamped headlines
- Arcology queries the metadata and prints HTML presentations of the documents with a FastAPI server and a somewhat hacky encapsulation of the Routing Logic including Pandoc HTML generation and post-processing.
- An Arcology presents multiple Sites, each with their own design language and content themes.
- Arroyo's database is encoded with s-expressions, so sexpdata python package">
sexpdata
python package is used to parse these - inotify and a watchdog service">
inotify
and a watchdog service will be used to wait for files to be sent to the Wobserver via Syncthing
Developing the Arcology
In The Arcology, the org-mode documents which it renders is meant to be the source code. It fits in to the author's personal emacs development paradigm -> Arroyo Systems Management. Like Arroyo and The Complete Computing Environment, this system is not really designed to be used by others right now. Over the next few years, I plan to make this system reproduceable, a system and documentation to bootstrap new Arroyo Systems with an Arcology running within it. Until then, Hey Smell This.
The author's development environment consists of:
-
A customized Emacs distribution with the Arroyo Systems Management scripts installed
- LSP + lsp-pyright">
lsp-pyright
lsp-org
- LSP + lsp-pyright">
-
Nix package management for ease of local development and of system deployment on NixOS
nix-shell
will build the dependencies and application and placePATH
in their way- direnv can load this environment in to the editor
Running the Arcology
- direnv or nix-shell
- Run the Arcology Automated Database Builder: shell:python -m arcology.inotify &
- Run the Arcology FastAPI webserver: shell:uvicorn arcology.server:app --reload &