scaffold: initial repository structure

This commit is contained in:
Matt Johnson 2026-05-15 19:16:24 +00:00
commit 36ebbcb250
12 changed files with 102 additions and 0 deletions

15
.gitignore vendored Normal file
View file

@ -0,0 +1,15 @@
.venv/
__pycache__/
*.pyc
.env
etc/
var/
*.creds
*.key
*.pem
db.env
.envrc
.idea/
.vscode/
*.swp
.DS_Store

21
LICENSE Normal file
View file

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2026 Matt Johnson
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

20
README.md Normal file
View file

@ -0,0 +1,20 @@
# Central
Central is the data hub spine for the infrastructure. Adapters normalize upstream sources into a canonical event shape, publish CloudEvents to NATS/JetStream, and archive to TimescaleDB for historical query. Single-LXC deployment.
## Status
Phase 0 — scaffold. Not yet operational.
## Architecture
- Python 3.12 (uv-managed)
- NATS + JetStream for live event bus
- TimescaleDB + PostGIS for archive and geospatial query
- One supervisor process managing adapter lifecycle
- One archive consumer process persisting events to TimescaleDB
- Both processes systemd-managed
## License
MIT. See LICENSE.

0
docs/.gitkeep Normal file
View file

View file

@ -0,0 +1,31 @@
# Central Configuration Template
# ==============================
# This is a TEMPLATE. Copy to /etc/central/central.toml on the deployment host.
# Replace all CHANGE_ME values with real configuration.
# NEVER commit the real /etc/central/central.toml to version control.
# === NWS adapter ===
# Fetches weather alerts and observations from the National Weather Service API.
# contact_email is required by NWS User-Agent policy.
[adapters.nws]
enabled = true
cadence_s = 60
states = ["ID", "OR", "WA", "MT", "WY", "UT", "NV"]
contact_email = "CHANGE_ME@example.invalid"
# === CloudEvents wire format ===
# All events published to NATS follow the CloudEvents 1.0 specification.
[cloudevents]
type_prefix = "central"
source = "central/adapters/nws"
schema_version = "1.0.0"
# === NATS ===
# Connection URL for the NATS server with JetStream enabled.
[nats]
url = "nats://localhost:4222"
# === Postgres / TimescaleDB ===
# DSN for the archive database. Must have TimescaleDB and PostGIS extensions.
[postgres]
dsn = "postgresql://central:CHANGE_ME@localhost/central"

15
pyproject.toml Normal file
View file

@ -0,0 +1,15 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "central"
version = "0.1.0"
requires-python = ">=3.12,<3.13"
description = "Data hub spine — adapters, bus, archive."
readme = "README.md"
license = {text = "MIT"}
authors = [{name = "Matt Johnson"}]
[tool.hatch.build.targets.wheel]
packages = ["src/central"]

0
scripts/.gitkeep Normal file
View file

0
sql/.gitkeep Normal file
View file

0
src/central/__init__.py Normal file
View file

View file

0
systemd/.gitkeep Normal file
View file

0
tests/__init__.py Normal file
View file