Skip to content

bill143/NEXUS-AI

Repository files navigation

OC Pipeline Elite Settings Scaffold

This repository now includes an enterprise settings scaffold inside the existing Vite + React frontend and a matching Prisma/PostgreSQL data model for account controls, billing, connectors, and developer runtime management.

Project Map

frontend/
  src/
    features/
      settings/
        data.ts
        SettingsWorkspace.tsx
        types.ts
    pages/
      Settings.tsx
    components/
      layout/
        Sidebar.tsx
    App.tsx
backend/
  prisma/
    schema.prisma
database/
  migrations/
    013_elite_settings_engine.sql
docker-compose.yml
README.md

What Was Added

  • A new /settings route with a three-pane settings workspace.
  • Command-first search with Ctrl+K / Cmd+K.
  • Settings views for General, Security, Privacy, Billing, Connectors, and Developer runtime controls.
  • Prisma models for users, settings, subscriptions, invoices, usage, sessions, OAuth accounts, connectors, API keys, MCP servers, and environment variables.
  • A SQL migration scaffold aligned to the Prisma schema.
  • Local docker-compose.yml for frontend, backend, PostgreSQL, and Redis.

Local Run

App-only

cd frontend
npm install
npm run dev

In another terminal:

cd backend
npm install
npm run dev

Full stack with Docker

docker compose up --build

Frontend: http://localhost:5173

Backend: http://localhost:3001

PostgreSQL: localhost:5432

Redis: localhost:6379

Database Notes

The new schema lives in backend/prisma/schema.prisma and the SQL companion migration lives in database/migrations/013_elite_settings_engine.sql.

Key implementation expectations:

  • Encrypt UserSettings.personaInstructionsEncrypted, connector credentials, and environment variable values in the application layer before persistence.
  • Hash API keys before storing ApiKey.keyHash.
  • Wire Stripe webhooks into Subscription and Invoice.
  • Back session revocation and MFA workflows with authenticated backend endpoints.

Vercel Deployment

  1. Import the repo into Vercel.
  2. Set the root directory to frontend.
  3. Configure:
    • VITE_API_URL
    • VITE_SUPABASE_URL
    • VITE_SUPABASE_ANON_KEY
  4. Build command: npm run build
  5. Output directory: dist

Railway Deployment

  1. Create a Railway project and add:
    • PostgreSQL
    • Redis
    • A service from backend/
  2. Set backend variables:
    • DATABASE_URL
    • REDIS_URL
    • JWT_SECRET
    • SUPABASE_URL
    • SUPABASE_SERVICE_ROLE_KEY
  3. Backend start flow:
    • Install: npm install
    • Build: npm run build
    • Start: npm run start
  4. Deploy the frontend separately to Vercel, pointing VITE_API_URL at the Railway backend URL.

Next Integration Steps

  1. Replace the mock settings data with TanStack Query loaders and mutations.
  2. Add server endpoints for sessions, API keys, connector health, Stripe billing, and MCP server registration.
  3. Persist encrypted preferences and environment variables using a KMS or sealed secret strategy.
  4. Add middleware enforcement for CSRF, session challenge flows, and role-aware settings access.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors