Innersync_Core

Innersync Core

Production-ready landing hub for the Innersync platform with a dark, neural aesthetic and the App → Alphapy → Mind → Core hero morph.

Innersync Core preview

Highlights

Stack

Getting Started

pnpm install
pnpm dev

Then visit http://localhost:3000.

Shared Schemas

This repo now contains shared data contracts under schemas/:

See schemas/README.md for details on how to consume them inside the other Innersync services.

Core API (FastAPI Service)

The core-api/ directory contains a separate FastAPI service that provides backend data APIs. This is deployed as a separate Railway service at api.innersync.tech.

Local Development:

cd core-api
uvicorn app.main:app --reload

Available Routes:

See the Railway Deployment section below for deployment details.

Supabase schema

Initial SQL to provision the shared profiles, reflections, trades and insights tables (plus RLS policies) lives in supabase/0001_core_tables.sql. Execute it inside the Supabase SQL editor or through supabase db push before wiring up the Core API or the Alphapy sync jobs.

Environment

Copy .env.example to .env.local and adjust if needed:

NEXT_PUBLIC_CORE_BASE=https://innersync.tech
NEXT_PUBLIC_APP_URL=https://app.innersync.tech
NEXT_PUBLIC_MIND_URL=https://mind.innersync.tech
NEXT_PUBLIC_ALPHAPY_URL=https://alphapy.innersync.tech
SUPABASE_SERVICE_ROLE_KEY=
BUILD_TIME=
COMMIT_SHA=

Key values:

Scripts

Railway Deployment

This repository contains two separate services that should be deployed as two separate Railway services:

1. Core (Next.js) - core.innersync.tech

Purpose: Marketing/landing page, documentation, and status dashboard
Tech: Next.js 15, Node.js
Dockerfile: Dockerfile.dashboard
Railway Config: railway.toml

Service Configuration

This service is deployed as a submodule within the main Alphapy repository. Configure Railway manually:

  1. Railway Dashboard → Service Settings
  2. “Railway Config File”: /shared/innersync-core/railway.toml
  3. “Root Directory”: /shared/innersync-core
  4. “Watch Paths”: /shared/innersync-core/**
  5. “Dockerfile Path”: Dockerfile.dashboard (auto-detected)

Environment Variables

Health Checks

Endpoints

2. Core API (FastAPI) - api.innersync.tech

Purpose: Backend data API for user resources and telemetry
Tech: FastAPI, Python 3.12, asyncpg
Dockerfile: core-api/Dockerfile
Railway Config: core-api/railway.toml

Service Configuration

Deploy as a separate Railway service:

  1. Railway Dashboard → New Service → Connect Repository
  2. “Railway Config File”: core-api/railway.toml
  3. “Root Directory”: Root (or core-api/ if needed)
  4. “Dockerfile Path”: core-api/Dockerfile

Environment Variables

SUPABASE_URL=https://<project-ref>.supabase.co
SUPABASE_ANON_KEY=<public-anon-key>
SUPABASE_SERVICE_ROLE_KEY=<service-role-key>  # Required for telemetry persistence
SUPABASE_DB_URL=postgresql://<user>:<password>@<host>:6543/postgres
CORS_ALLOWED_ORIGINS=https://app.innersync.tech,https://mind.innersync.tech,https://core.innersync.tech,https://alphapy.innersync.tech

Health Checks

Endpoints

Why Two Separate Deployments?

Dockerfile Summary

Core (Next.js):

node:20-alpine → pnpm 10.19.0 (corepack)
deps  → install dependencies
build → pnpm build (standalone output)
run   → copy .next/standalone + static + public, run `node server.js`

Core API (FastAPI):

python:3.12-alpine
deps  → pip install requirements.txt
run   → uvicorn app.main:app --host 0.0.0.0 --port 8080

Accessibility & Performance

Status Endpoints

/status polls both endpoints every 15 seconds. The metrics endpoint returns a payload shaped like:

{
  "generatedAt": "2025-01-05T10:52:00.000Z",
  "summary": {
    "overallStatus": "operational",
    "incidentsOpen": 0,
    "totalRequests24h": 172800
  },
  "subsystems": {
    "core": {
      "id": "core",
      "label": "Core",
      "status": "operational",
      "uptimeSeconds": 268000,
      "throughputPerMinute": 184,
      "errorRate": 0.42,
      "latencyP50": 108,
      "latencyP95": 162,
      "queueDepth": 7,
      "notes": "Event bus nominal",
      "lastUpdated": "2025-01-05T10:52:00.000Z"
    },
    "api": { "...": "..." },
    "alphapy": { "...": "..." }
  },
  "trends": {
    "throughput": [{ "timestamp": "2025-01-05T10:48:00.000Z", "value": 480 }],
    "errorRate": [{ "timestamp": "2025-01-05T10:48:00.000Z", "value": 0.6 }]
  }
}

Mind (and other services) can publish real metrics in this format; the marketing surface renders it immediately without a schema switch.

Supabase Configuration

Both services connect to the same Supabase instance but serve different purposes:

Important: Add the telemetry schema to Exposed Schemas in Supabase Studio (Settings → API). Otherwise PostgREST only accepts public and graphql_public, causing 406 errors.

License

See LICENSE for project licensing details.