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.
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
- A new
/settingsroute 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.ymlfor frontend, backend, PostgreSQL, and Redis.
cd frontend
npm install
npm run devIn another terminal:
cd backend
npm install
npm run devdocker compose up --buildFrontend: http://localhost:5173
Backend: http://localhost:3001
PostgreSQL: localhost:5432
Redis: localhost:6379
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
SubscriptionandInvoice. - Back session revocation and MFA workflows with authenticated backend endpoints.
- Import the repo into Vercel.
- Set the root directory to
frontend. - Configure:
VITE_API_URLVITE_SUPABASE_URLVITE_SUPABASE_ANON_KEY
- Build command:
npm run build - Output directory:
dist
- Create a Railway project and add:
- PostgreSQL
- Redis
- A service from
backend/
- Set backend variables:
DATABASE_URLREDIS_URLJWT_SECRETSUPABASE_URLSUPABASE_SERVICE_ROLE_KEY
- Backend start flow:
- Install:
npm install - Build:
npm run build - Start:
npm run start
- Install:
- Deploy the frontend separately to Vercel, pointing
VITE_API_URLat the Railway backend URL.
- Replace the mock settings data with TanStack Query loaders and mutations.
- Add server endpoints for sessions, API keys, connector health, Stripe billing, and MCP server registration.
- Persist encrypted preferences and environment variables using a KMS or sealed secret strategy.
- Add middleware enforcement for CSRF, session challenge flows, and role-aware settings access.