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.
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.
| 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 |
| 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 |
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 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) β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| 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 |
| 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 | β |
- 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 devOpen http://localhost:3000.
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
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) |
| 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 |
Contributions are welcome! Here's how to get started:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing) - Make changes with clear commit messages
- Run
npm run lintandnpm testto validate - Push to your fork and open a Pull Request
- 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.prismaand relevant SQL setup scripts
- 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)
MIT Β© 2026 ceaserzhao (Oasis Company)
See LICENSE for details.
Built with care by Oasis Company.
Open identity context infrastructure for the AI era. π