Skip to content

MonarchCastleTech/prepturk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PrepTurk logo

PrepTürk

Türkiye's sovereign, airgapped preparedness command center

🇬🇧 English · 🇹🇷 Türkçe · 🇷🇺 Русский · 🇸🇾 العربية

status division Monarch Castle license airgap

Executive summary — PrepTürk is a high-availability, airgapped intelligence and survival orchestration platform engineered for the Republic of Türkiye's geographic and geopolitical risk profile. It turns consumer-grade hardware — a Raspberry Pi, laptop, or home server — into a hardened command center that runs a local LLM over verified government documents, drives real radio and mesh hardware, and operates with zero internet connectivity. It serves households, community responders, and field operators who must keep working when the cloud, the grid, and the cell network are gone.

✨ Highlights

  • Sovereign local AI — Retrieval-augmented generation over a library of 36 verified Turkish government source manifests (AFAD, Ministry of Health, MEB, NDK, MGM, MTA, and more), served entirely on-device via Ollama with Qdrant semantic search. No queries ever leave the box.
  • Airgap-by-defaultAIRGAP_MODE ships enabled; a software-level lock prevents outbound network requests from backend workers. Telemetry is stripped and fonts are served locally.
  • Physical-layer integration — Native interfaces for RTL-SDR (emergency frequency scanning, NOAA weather imagery) and Meshtastic LoRa mesh for off-grid SOS and community sync.
  • Verified civil-defense protocols — AFAD CBRN ("Siyah Alarm") and air-raid ("Kırmızı Alarm") procedures, first-aid libraries, and a conservative medical triage assistant.
  • Provenance-first content pipeline — every document carries source, rights status, and a content hash; storage mode (mirrored / cached / pointer-only) is governed per-source to respect redistribution rights.
  • Multilingual by design — fully localized in Turkish, English, Russian, and Arabic to serve all residents and displaced persons in crisis zones.
  • Reproducible deployment — the entire stack stands up from a clean checkout with docker compose up -d; backup, restore, and province-pack tooling included.

🖼️ Preview

PrepTürk — command center, desktop PrepTürk — offline document library PrepTürk — local RAG search

🧭 What it does

PrepTürk consolidates four operational domains into a single self-hosted command center.

1. Intelligence & sovereign AI

Local RAG powered by Ollama (default qwen2.5:7b-instruct for generation, nomic-embed-text for embeddings) answers natural-language questions by citing its own offline library of verified Turkish government sources. Qdrant provides high-performance vector search across thousands of pages of legislation and emergency manuals — no external index server, no API calls.

2. Physical layer & hardware integration

  • SDR (Software-Defined Radio) — RTL-SDR interface that scans and logs emergency frequencies and decodes weather-satellite imagery.
  • LoRa mesh (Meshtastic) — node-to-node mesh networking for SOS signals and community boards when cell towers fail.
  • Environmental & CBRN sensing — local logging hooks for radiation, air quality, and climate data.
  • Local Whisper — on-device voice-to-text; no audio ever leaves the device.

3. Tactical emergency operations

Verified civil-defense procedures, an emergency first-aid library, and a conservative symptom checker. Hyper-local mapping is served from local vector tiles so navigation works without a single packet from the internet.

4. Logistics & continuity

Offline file sharing via QR packages and ad-hoc Wi-Fi, inventory and resource tracking with depletion alerts, province-calibrated planning for all 81 provinces, and modules for traditional Anatolian food-preservation and provincial agricultural calendars.

🗂️ Data & provenance

Per Monarch Castle doctrine — evidence before assertion. PrepTürk's content set is not scraped at random; it is a curated catalogue of 36 source manifests (content/manifests/sources/*.yaml), each declaring its origin, trust level, rights status, and a default storage mode:

Storage mode Used for Behaviour
Mirrored Public-download official documents (AFAD, Ministry of Health, MEB, Anayasa) Full local copy of original + extracted text
Cached Public-read sources with limited redistribution rights (TİTCK, MGM, MTA, EBA) Local cache for access; original remains canonical
Pointer-only Service portals and pages that must not be scraped Metadata and source URL only; no auto-redistribution

Every record carries its source, rights status, and a content hash for integrity verification (scripts/hash_manifest.py). Collection respects each source's redistribution terms and Turkish data-protection law. See docs/rights-and-provenance.md, docs/source-policy.md, and docs/ingestion.md for the full provenance and ingestion model.

🛠️ Tech stack

Component Technology Role
Frontend Next.js 15 · React 19 · TypeScript · Tailwind · Radix UI Hardened PWA with service-worker caching
API FastAPI · Python 3.12 (async) High-throughput command layer
Worker Python 3.12 ingestion service Document fetch, extraction, OCR, embedding
Database PostgreSQL 16 Relational metadata and roles
Vector DB Qdrant 1.8 Semantic indexing and similarity search
AI engine Ollama Local LLM + embedding orchestration
Reverse proxy Caddy Internal HTTPS and static serving
Orchestration Docker Compose · Makefile One-command bring-up
CI GitHub Actions ruff · mypy · ESLint · Prettier · pytest · jest

🔒 OPSEC & hardening

PrepTürk follows a paranoid-by-default model: airgap enforcement at the worker layer, telemetry stripped from the frontend, a fully local font stack (no external CDNs), and an AES-256-GCM encrypted local enclave for family documents. Database and vector-store ports are not exposed to the host by default.

🚀 Getting started

Prerequisites

  • Hardware: 4 GB RAM minimum (16 GB recommended for the 7B AI model).
  • Software: Docker and Docker Compose; a local Ollama runtime for AI features.

Quick launch

git clone https://github.com/monarchcastletech/prepturk.git
cd prepturk
cp .env.example .env        # review AIRGAP_MODE, model, and secret settings
docker compose up -d

Access the command center at http://localhost:3000 (API on :8000).

Common operations (Makefile)

make up        # start the full stack
make down      # stop the stack
make test      # backend (pytest) + worker + frontend (jest) tests
make lint      # ruff + mypy + ESLint + Prettier
make backup    # snapshot data; make restore to recover

PrepTürk is a self-hosted, airgapped stack — it is not a hosted web service and intentionally ships no public cloud endpoint.

🧱 Part of Monarch Castle

A product of Emergency Intelligence · Monarch Castle Technologies — an operating company of Monarch Castle Holdings. Sister companies: Monarch Castle Technologies · Strategic Data Company of Ankara

⚖️ License & responsibility

Licensed under AGPL-3.0 — see LICENSE.

Important: PrepTürk is a supplementary tool. In any emergency within the Republic of Türkiye, always prioritize official government directives and call 112. This software is provided "as is", without warranty of any kind.

"Assume nothing will be there when you need it. Own the infrastructure of your survival."

© 2026 Monarch Castle Holdings · Ankara, Türkiye
🏰 Monarch Castle Holdings — turning open-source noise into lawful, verified, decision-grade intelligence.

About

Türkiye's sovereign, airgapped preparedness command center — local AI (RAG over verified AFAD/Health docs), SDR, and Meshtastic mesh that run with zero internet.

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors