Skip to content

Architecture

SUDIGITAL runs on a single backend monorepo — sudi.engine — that serves all three products through one API, one database, and one authentication system.

System Overview

┌─────────────────────────────────────────────────────────────────┐
│                        FRONTENDS                                │
│                                                                 │
│  hub.sudigital.com    neptu.sudigital.com    pasar.sudigital.com  │
│                       (neptu.day)            (thepasar.com)       │
│  (React/Vite)         (React/Vite)           (React/Vite)         │
│                                                                 │
└──────────┬────────────────┬──────────────────┬──────────────────┘
           │                │                  │
           ▼                ▼                  ▼
┌─────────────────────────────────────────────────────────────────┐
│                      sudi.engine API                            │
│                       (Elysia)                                  │
│                                                                 │
│  /hub/*       /neptu/*       /pasar/*       /v1/*               │
│  missions     oracle         strategies     auth                │
│  nft          subscriptions  bots           users               │
│  chat         referrals      alerts         health              │
│  blockchain   payments       markets                            │
│  xp           api-platform   automation                         │
│                                                                 │
├─────────────────────────────────────────────────────────────────┤
│                       SERVICES                                  │
│                                                                 │
│  Privy Auth    Drizzle ORM    Azure OpenAI    ccxt/Jupiter      │
│  (JWT)         (PostgreSQL)   (LLM)           (Exchange)        │
│                                                                 │
└──────────┬────────────────────────────────────┬─────────────────┘
           │                                    │
           ▼                                    ▼
┌──────────────────────┐              ┌──────────────────────┐
│     PostgreSQL       │              │      Worker          │
│   (single DB)        │              │   (background jobs)  │
│                      │              │   (cron tasks)       │
│   users              │              └──────────────────────┘
│   hub_* tables       │
│   neptu_* tables     │              ┌──────────────────────┐
│   pasar_* tables     │              │    Telegram Bot      │
│   shared tables      │              │   (raw Bot API)      │
│                      │              └──────────────────────┘
└──────────────────────┘

Monorepo Structure

sudi.engine/
├── apps/
│   ├── api/          — Elysia REST API
│   ├── worker/       — Background jobs & cron
│   ├── cli/          — Terminal dashboard
│   └── telegram/     — Telegram bot

├── packages/
│   ├── shared/       — Types, constants, configs
│   ├── db/           — Drizzle ORM (PostgreSQL)
│   ├── logger/       — Pino structured logging
│   ├── exchange/     — CEX/DEX trading (ccxt, Jupiter)
│   ├── neptu/        — Balinese calendar engine
│   ├── graphify/     — Knowledge graph (graphology)
│   └── miro-fish/    — Multi-agent prediction engine

└── docs/             — This documentation site

Dependency Order

shared -> logger -> db -> exchange -> neptu -> graphify -> miro-fish -> apps

Authentication

All three products share one auth system via Privy:

  • Users authenticate with wallet (Phantom, MetaMask) or social login
  • Privy issues ES256/EdDSA JWTs
  • sudi.engine validates JWTs on every request
  • One user account works across all three products
  • No separate registration per product

Database Design

Single PostgreSQL database with domain-organized schemas:

Core (cross-cutting):

  • users — Unified user table (Privy auth, wallet address)
  • audit_log — System-wide audit trail
  • job_queue — Worker job queue
  • market_data — Shared market data

Hub tables:

  • nft_collections, nft_traits — NFT system
  • missions, mission_participants — Mission system
  • chat_sessions, chat_messages — Chat
  • xp_accounts, stake_accounts — XP and staking

Neptu tables:

  • people — Public figures for astrology analysis
  • subscriptions, payments — Billing
  • referrals — Referral system
  • oracle_usage — AI oracle quota

ThePasar tables:

  • trading_connections, trading_balances — Exchange connections
  • strategies, strategy_versions, bots — Trading strategies
  • alerts, automation_tasks — Automation

API Design

Routes are organized by product domain:

GET  /v1/auth/me              — Current user (shared)
GET  /v1/health               — System health (shared)

POST /hub/missions             — Create mission
GET  /hub/nft/collections      — List NFT collections
GET  /hub/xp/balance           — XP balance

GET  /neptu/oracle/insight     — Daily oracle insight
POST /neptu/subscriptions      — Create subscription
GET  /neptu/calendar/wuku      — Wuku calendar data

GET  /pasar/strategies         — List strategies
POST /pasar/bots               — Create trading bot
GET  /pasar/markets            — Market data

Next Steps

  • Products — detailed look at each product
  • Tokenomics — how $SUDIGITAL connects the ecosystem

One backend. Three products. One token.