mirror of
https://github.com/zvx-echo6/central.git
synced 2026-05-21 18:14:44 +02:00
scaffold: initial repository structure
This commit is contained in:
commit
36ebbcb250
12 changed files with 102 additions and 0 deletions
15
.gitignore
vendored
Normal file
15
.gitignore
vendored
Normal 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
21
LICENSE
Normal 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
20
README.md
Normal 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
0
docs/.gitkeep
Normal file
31
etc-templates/central.toml
Normal file
31
etc-templates/central.toml
Normal 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
15
pyproject.toml
Normal 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
0
scripts/.gitkeep
Normal file
0
sql/.gitkeep
Normal file
0
sql/.gitkeep
Normal file
0
src/central/__init__.py
Normal file
0
src/central/__init__.py
Normal file
0
src/central/adapters/__init__.py
Normal file
0
src/central/adapters/__init__.py
Normal file
0
systemd/.gitkeep
Normal file
0
systemd/.gitkeep
Normal file
0
tests/__init__.py
Normal file
0
tests/__init__.py
Normal file
Loading…
Add table
Add a link
Reference in a new issue