2026-05-18 12:13:27 +02:00
2026-05-18 12:13:27 +02:00
2026-05-18 12:13:27 +02:00
2026-05-11 11:16:47 +02:00
2026-05-18 12:13:27 +02:00
2026-05-18 12:13:27 +02:00
2026-05-11 11:16:47 +02:00
2026-05-11 11:16:47 +02:00
2026-05-11 11:16:47 +02:00
2026-05-18 12:13:27 +02:00
2026-05-18 12:13:27 +02:00
2026-05-11 11:16:47 +02:00
2026-05-11 11:16:47 +02:00
2026-05-11 11:16:47 +02:00
2026-05-18 12:13:27 +02:00
2026-05-11 11:16:47 +02:00
2026-05-18 12:13:27 +02:00

apXtri — Build, Host & Decentralize

Why apXtri?

Are you a system administrator or a web developer (backend, frontend, or fullstack) looking for a project that goes beyond the usual stack?
apXtri is an open-source infrastructure designed to create a decentralized economy around hosting, development, and community management.

With apXtri, you can:

  • Host web apps, APIs, and pages for groups (tribes) on your own servers (towns).
  • Manage encrypted identities via PGP for users (pagans), ensuring anonymity and security.
  • Define and enforce nested rules (tribe → town → nation) automatically recorded on a blockchain.
  • Generate and exchange tokens to pay for hosting, dev, or community services.
  • Create traceable digital contracts and handle disputes through decentralized arbitration.

👉 In short: apXtri is your toolbox to launch a decentralized SaaS platform.


⚙️ Tech stack (100% open source & auditable)

  • Ubuntu LTS (desktop for dev, server for production)
  • Caddy: native HTTPS & reverse proxy
  • Node.js / Express.js: RESTful endpoints
  • JSON Schema: structured data management
  • Internal blockchain: rules & traceability

🏗️ Architecture Overview

Multi-tenant Hierarchy

🌍 Nation (Network)
 └── 🏛️ Towns (Servers)
      └── 👥 Tribes (Communities)
           └── 🔑 Pagans (Users with PGP identities)

New Directory Structure

/opt/apxtowns/{TOWN}.{NATION}/           # Code directory
├── apxtri/                              # Core runtime
│   ├── apxtri.js                        # Main entry point
│   ├── models/                          # Business logic
│   ├── routes/                          # API endpoints
│   ├── middlewares/                     # Auth middleware
│   ├── schema/                          # JSON Schema definitions
│   └── setup/                           # Installation scripts
│
/var/lib/apxtowns/{TOWN}.{NATION}/      # Data directory
├── {tribe}/                             # Tribe namespace
│   ├── objects/{objname}/itm/           # JSON database
│   └── wwws/{app}/                      # Webapp runtime
│
/opt/apxtowns/{TOWN}.{NATION}/{tribe}/  # Webapp source
└── wwws/{app}/src/                     # Templates, styles, scripts

Web Application Routing

Routes DNS: {app}.{tribe}.{TOWN}.{NATION}

  • Example: apidoc.dev.dev.test → apidoc webapp in dev tribe
  • Each webapp has conf.json with configuration
  • Caddy auto-discovers and routes traffic

🛠️ Quick Installation

Requirements:

  • Ubuntu LTS 22.04+ (Desktop for dev, Server for prod)
  • Physical or VM: 8 GB RAM / 500 GB SSD minimum
  • Sudo-enabled user
  • Public domain name (for production)

Step 1: Create Sudo User (if needed)

# Create user (replace {user} with your username)
sudo adduser {user}
sudo passwd {user}
sudo usermod -aG sudo {user}
groups {user}  # Verify: should show "{user} : {user} sudo users"
su - {user}    # Switch to new user

Step 2: Download and Run Installer

# Download and run init.sh
sudo apt install wget -y && \
sudo wget -O init.sh https://gitea.ndda.fr/apxtri/apxtri/raw/branch/main/setup/init.sh && \
sudo chmod +x init.sh && \
./init.sh

Options:

  • ./init.sh - Interactive installation (choose town, nation, dev/prod)
  • ./init.sh --town mytown --nation test - Non-interactive dev
  • ./init.sh --clean - ⚠️ Erase all data and reinstall

Step 3A: Development Mode

# Start development server
apxdev

# Access admin interface (same machine)
http://admin.apxtri.{townName}.test/apxtriadmin/apxid_fr.html

Dev mode features:

  • Local testing without public domain
  • No SSL/HTTPS required
  • Data persists in /var/lib/apxtowns/{TOWN}.{NATION}/

Step 3B: Production Mode

# Install with domain
./init.sh --town mytown --nation ants --domain mytown.example.com

# After installation, complete setup via web interface
# Then run post-setup:
sudo /opt/apxtowns/{TOWN}-{NATION}/apxtri/setup/post-setup.sh

# Manage service
sudo systemctl {start|stop|restart} apxtri

Automated Features:

  • Daily blockchain backups (1:00 AM)
  • System updates via git pull (3:00 AM)
  • Auto-restart on failure
  • SSL certificate renewal (Let's Encrypt)

🎯 Why join apXtri?

  • 🧩 For sysadmins: a ready-to-install, auditable, and scalable project.
  • 💻 For developers: a playground to build apps, endpoints, and interfaces in a decentralized environment.
  • 🌍 For communities: an ecosystem outside centralization, giving power back to users.

🤖 AI-Assisted Development with OpenCode

apxtri is configured for AI-assisted development using OpenCode. The project uses agents, skills, and rules to provide contextual AI help for every part of the codebase.

Quick Start

# From the project root (/opt/apxtowns/{TOWN}.{NATION})
opencode

Available Agents

Agent Use case
@be-apxtri Backend core — routes, models, middlewares
@schema Odmdb schema creation and optimization
@be-dev Backend for the dev tribe

Example Prompts

@schema create a products collection with price and category
@be-apxtri add CRUD routes for products with tplstrings
@be-dev list persons from the dev tribe

How It Works

  1. Each repo (apxtri/, dev/, etc.) contains its own .opencode/ folder with skills and agents
  2. On server start, _syncOpenCode() merges everything into the root .opencode/
  3. opencode.json configures OpenCode to load all AGENTS.md files

See documents/04-AIOPENCODE.md for the full documentation.


FAQ

Q: Do I need blockchain expertise to run apXtri?
A: No. The blockchain is managed automatically by each town node. You only need basic sysadmin skills.

Q: Can I use apXtri for private projects?
A: Yes. Tribes can be public or private (invite-only).

Q: What happens if my server goes offline?
A: Each town manages its own data. If your node goes offline, your hosted tribes become unavailable, but other towns remain unaffected.

Q: Can I integrate my own apps or APIs?
A: Absolutely. Add webapps to {tribe}/wwws/{app}/ and they'll be auto-discovered.

Q: Is there a way to contribute as a developer?
A: Yes. Build web interfaces, extend APIs, or improve the core. Contributions welcome!


Ready to build your digital nation? 👉 Start here

S
Description
Main tribe that manage many other tribes in an apXtri town
Readme 11 MiB
Languages
JavaScript 85.3%
Shell 14.4%
HTML 0.3%