Skip to content

Oasis-Company/OasisBio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

365 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

OasisBio

Open Identity Context Infrastructure for the AI Era. Stop reintroducing yourself to every AI.

Quick Start β€’ Architecture β€’ Tech Stack β€’ Docs β€’ Live Demo β†’


The AI era needs a new identity layer. Every time you use a new AI assistant, you re-explain who you are. OasisBio fixes this β€” create your structured identity once, let machines understand you everywhere.


Next.js TypeScript Prisma Tailwind CSS Supabase Vercel License

✨ What is OasisBio?

OasisBio is an open identity context infrastructure for the AI era.

Build structured, machine-readable identity profiles that AI assistants and applications can instantly understand. Stop reintroducing yourself to every AI β€” create your context once, use it everywhere.

Core Modules

Module What it does
🧬 Identity Context Structured profiles with AI-readable data format
πŸ”— Context API REST endpoint GET /api/context/:slug for machine access
πŸ” OAuth Provider "Continue with Oasis" β€” OAuth 2.0 + PKCE + OIDC with context:read scope
⚑ Ability Pool Machine-consumable skill profiles with proficiency levels
πŸ“œ DCOS Repository Core operating scripts that define your decision-making framework
πŸ” References Library External knowledge that shapes your identity context
🌍 World Context Environments and settings that influence your identity
🧠 Nuwa AI Cognitive framework distillation for AI understanding
🏷️ Tag System Polymorphic tags across entities for categorization
πŸ‘₯ Relationships Connections between identities for network context

Identity Context Features

Feature Description
Machine-Readable Structured JSON format that AI can parse instantly
Portable Use via REST API, OAuth, or .well-known endpoint
Privacy-Controlled Fine-grained permissions, you decide what each app reads
OAuth-Enabled Standard OAuth 2.0 integration for third-party apps
Version-Tracked Evolution of identity over time

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Next.js 16 (App Router)                   β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚ SSR+RSC β”‚ β”‚ API Routesβ”‚ β”‚ Middlewareβ”‚ β”‚ OAuth Provider   β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚       β”‚          β”‚           β”‚              β”‚               β”‚
β”‚  β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚            Prisma 6 ORM (PostgreSQL via Supabase)        β”‚ β”‚
β”‚  β”‚              23 models Β· RLS Β· RPC functions             β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚                           β”‚                                    β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚  Supabase Auth (OTP) Β· Storage (images) Β· Edge Functions β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚                           β”‚                                    β”‚
β”‚                    Cloudflare R2 (3D models Β· exports)         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

By The Numbers

Metric Value
Source Code ~71K lines across 222 files
API Endpoints 53 REST routes
Database Models 23 Prisma models
Test Suites Jest + fast-check property-based testing
Commits 305+ commits of iterative development
License MIT

πŸ› οΈ Tech Stack

Layer Technology Version
Framework Next.js (App Router) 16.2
Language TypeScript 5.4 (strict)
Styling Tailwind CSS 3.4 (OKLCH color space)
Database PostgreSQL via Supabase β€”
ORM Prisma 6.19
Auth Supabase Auth (OTP/passwordless) β€”
AI Pipeline OpenAI-compatible LLM β€”
3D Rendering Three.js (GLTFLoader) 0.183
Testing Jest + fast-check latest
Deployment Vercel β€”

πŸš€ Quick Start

Prerequisites

  • Node.js 18+
  • A Supabase project (free tier works)
  • A Cloudflare account with R2 enabled (for 3D models)
# Clone the repository
git clone https://github.com/zbbsdsb/oasisbio.git
cd oasisbio && npm install

# Configure environment
cp .env.example .env

# Push schema & generate Prisma client
npx prisma db push && npx prisma generate

# Run database setup scripts in Supabase SQL Editor (in order):
#   scripts/db/01_enable_rls.sql
#   scripts/db/02_add_indexes.sql
#   scripts/db/04_storage_policies.sql
#   scripts/db/05_domain_events_audit_logs.sql
#   scripts/db/06_publish_bio_rpc.sql
#   scripts/db/07_oauth_tables.sql

# Start development server
npm run dev

Open http://localhost:3000.


πŸ“ Project Structure

oasisbio/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ api/                  # 53 REST endpoints
β”‚   β”‚   β”‚   β”œβ”€β”€ oauth/            # OAuth 2.0 + OIDC (authorize/token/userinfo/JWKS)
β”‚   β”‚   β”‚   β”œβ”€β”€ nuwa/             # AI distillation pipeline (5 endpoints)
β”‚   β”‚   β”‚   └── ...               # bios, worlds, abilities, dcos, refs, etc.
β”‚   β”‚   β”œβ”€β”€ dashboard/oasisbios/[id]/  # Character editor (8 sub-tabs)
β”‚   β”‚   β”‚   β”œβ”€β”€ page.tsx          # Identity editor
β”‚   β”‚   β”‚   β”œβ”€β”€ eras/page.tsx     # Era timeline
β”‚   β”‚   β”‚   β”œβ”€β”€ abilities/page.tsx # Ability pool
β”‚   β”‚   β”‚   β”œβ”€β”€ worlds/           # World builder (list + wizard + detail)
β”‚   β”‚   β”‚   β”œβ”€β”€ dcos/page.tsx    # DCOS documents
β”‚   β”‚   β”‚   β”œβ”€β”€ references/page.tsx # References library
β”‚   β”‚   β”‚   β”œβ”€β”€ relationships/page.tsx # Character relationships
β”‚   β”‚   β”‚   └── nuwa/page.tsx     # AI workspace (685 lines)
β”‚   β”‚   β”œβ”€β”€ bio/[slug]/page.tsx   # Public profile (SEO-optimized)
β”‚   β”‚   β”œβ”€β”€ developer/            # OAuth developer portal
β”‚   β”‚   └── page.tsx             # Landing page (7-section Swiss grid design)
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ world/                # World builder UI (StepWizard, ModuleSection)
β”‚   β”‚   β”œβ”€β”€ auth/                 # Login/register forms
β”‚   β”‚   └── Tooltip.tsx           # Accessible guidance system (22 test cases)
β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   β”œβ”€β”€ nuwa/                 # AI distillation core (5 modules)
β”‚   β”‚   β”‚   β”œβ”€β”€ types.ts          # Type contracts (~25 interfaces)
β”‚   β”‚   β”‚   β”œβ”€β”€ source-snapshot.ts # Snapshot builder + hash
β”‚   β”‚   β”‚   β”œβ”€β”€ llm.ts            # OpenAI-compatible LLM client
β”‚   β”‚   β”‚   β”œβ”€β”€ orchestrator.ts   # Pipeline coordinator
β”‚   β”‚   β”‚   └── apply.ts          # Suggestion applier
β”‚   β”‚   β”œβ”€β”€ oauth/                # OAuth provider (crypto/middleware/scopes)
β”‚   β”‚   β”œβ”€β”€ supabase/            # SSR/browser/middleware clients
β”‚   β”‚   └── storage.ts           # Unified Supabase + R2 storage layer
β”‚   └── services/                # Import/Export service (ZIP)
β”œβ”€β”€ prisma/schema.prisma         # 23 models, RLS enabled
β”œβ”€β”€ scripts/db/                   # 7 SQL setup scripts
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ technical.md             # Full architecture reference (2000+ lines)
β”‚   β”œβ”€β”€ nuwa-integration.md      # AI pipeline docs (620 lines)
β”‚   β”œβ”€β”€ design.md                # Design system (Swiss grid, OKLCH palette)
β”‚   β”œβ”€β”€ OasisBio Strategic Plan.md # Product roadmap (English)
β”‚   └── features/                # Feature specs (oauth, worlds, abilities...)
β”œβ”€β”€ public/assets/                # Logo, sample images, 3D models
β”œβ”€β”€ OasisBio Manifesto.md        # Vision statement
└── LICENSE                       # MIT

πŸ§ͺ Testing

npm test                  # Jest unit + property tests
npm run test:watch        # Watch mode
npm run test:coverage     # Coverage report
Area Tests Status
User sync (property-based) 4 properties βœ… Passing
Route protection (property-based) 1 property βœ… Passing
Auth state machine (property-based) 1 property βœ… Passing
OAuth crypto / validate / middleware 16 test files βœ… Passing
Tooltip component 22 test cases βœ… Passing
Nuwa Integration β€” πŸ”² Pending (Phase 4)

πŸ“– Documentation

Document Description
Technical Reference Architecture, auth flow, DB schema, all API endpoints, OAuth provider, testing, deployment
Nuwa AI Integration AI distillation architecture, data model, 5 API endpoints, caching strategy, roadmap
Strategic Plan Product roadmap: Phase 1–4, core mission, what we won't do
Design System Swiss grid, OKLCH color space, typography, component specs, accessibility
World Design Spec 6-module worldbuilding standard with field definitions
OAuth Developer Guide "Continue with Oasis" integration guide + React example
Manifesto Vision: digital immortality, cross-generational identity protocol

🀝 Contributing

Contributions are welcome! Here's how to get started:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing)
  3. Make changes with clear commit messages
  4. Run npm run lint and npm test to validate
  5. Push to your fork and open a Pull Request

Development Workflow

  • This project uses TypeScript strict mode β€” all code must pass type checking
  • Follow the existing code style (ESLint config included)
  • New features should include tests where practical (Jest + fast-check)
  • For database schema changes, update both schema.prisma and relevant SQL setup scripts

Code Quality Checklist

  • TypeScript compiles without errors (npx tsc --noEmit)
  • ESLint passes (npm run lint)
  • Tests pass (npm test)
  • New API routes use requireAuth() and proper error handling
  • New frontend components follow existing patterns (Tailwind, lucide-react icons)

πŸ“„ License

MIT Β© 2026 ceaserzhao (Oasis Company)

See LICENSE for details.


Built with care by Oasis Company.

Open identity context infrastructure for the AI era. 🌊

Report Bug Β· Request Feature Β· Live Demo

Releases

No releases published

Packages

 
 
 

Contributors