A monorepo project for AI-powered block generation with support for multiple AI providers (Mistral, Claude, OpenAI). This project includes a backend API, a user-facing frontend application, and a VS Code extension.
This is a Turborepo monorepo that consists of:
http-backend: Express.js backend API that integrates with multiple AI providers (Mistral AI, Anthropic Claude, OpenAI) to generate code blocks. Features include:
user-frontend: React + Vite frontend application providing a user interface for:
vs-code-block-generation: VS Code extension for generating code blocks directly within the editor@repo/typescript-config: Shared TypeScript configuration files@repo/eslint-config: Shared ESLint configurations@repo/ui: Shared UI component libraryBefore you begin, ensure you have the following installed on your system:
http-backend)Core Dependencies:
express: Web framework for Node.js@prisma/client: Prisma ORM client for database operations@supabase/supabase-js: Supabase client for authentication and backend servicescors: Cross-Origin Resource Sharing middlewaredotenv: Environment variable managementmulter: File upload handlingAI SDKs:
@mistralai/mistralai: Mistral AI SDK@anthropic-ai/sdk: Anthropic Claude SDKopenai: OpenAI SDKDevelopment Dependencies:
prisma: Prisma CLI for database migrationstypescript: TypeScript compileruser-frontend)Core Dependencies:
react & react-dom: React libraryvite: Build tool and development serverreact-router-dom: Client-side routing@supabase/supabase-js: Supabase client for authenticationaxios: HTTP client for API requestsEditor & UI:
@monaco-editor/react: Monaco Editor React wrappermonaco-editor: Code editor componentlucide-react: Icon librarytailwindcss: Utility-first CSS frameworkDevelopment Dependencies:
@vitejs/plugin-react: Vite plugin for Reacttypescript: TypeScript compilereslint: Code lintingturbo: Turborepo for monorepo task orchestrationprettier: Code formattertypescript: TypeScript compilergit clone <repository-url>
cd living-on-edge
npm install -g pnpm@10.12.4
Or using other methods:
# Using Homebrew (macOS)
brew install pnpm
# Using npm
npm install -g pnpm
# Using curl
curl -fsSL https://get.pnpm.io/install.sh | sh -
From the root directory, install all dependencies:
pnpm install
Create a .env file in apps/http-backend/ with the following variables:
# Database
DATABASE_URL="postgresql://user:password@localhost:5432/dbname?schema=public"
# Supabase Configuration
SUPABASE_URL="your-supabase-project-url"
SUPABASE_ANON_KEY="your-supabase-anon-key"
SUPABASE_SERVICE_ROLE_KEY="your-supabase-service-role-key"
# AI API Keys (at least one required)
MISTRAL_API_KEY="your-mistral-api-key"
ANTHROPIC_API_KEY="your-anthropic-api-key"
OPENAI_API_KEY="your-openai-api-key"
# Server Configuration
PORT=3000
# AI Model Selection (optional, defaults to mistral)
aiModel=mistral
# Mock Mode (optional, for testing)
mock=false
# Stream Configuration (optional)
STREAM_CHAT_MAX_TOKENS=4096
PROMPT_ENHANCEMENT_MAX_TOKENS=2048
Create a .env file in apps/user-frontend/ with the following variables:
# Backend API URL
VITE_BACKEND_URL="http://localhost:3000"
# Supabase Configuration
VITE_SUPABASE_URL="your-supabase-project-url"
VITE_SUPABASE_ANON_KEY="your-supabase-anon-key"
createdb your_database_name
cd apps/http-backend
npx prisma migrate dev
npx prisma generate
From the root directory:
pnpm dev
This will start both the backend and frontend applications concurrently.
Backend:
cd apps/http-backend
pnpm dev
The backend will start on http://localhost:3000 (or the port specified in your .env file).
Frontend:
cd apps/user-frontend
pnpm dev
The frontend will start on http://localhost:5173 (default Vite port).
You can specify which AI model to use:
# Use Mistral AI
cd apps/http-backend
pnpm mistral
# Use Claude
cd apps/http-backend
pnpm claude
http://localhost:3000 or checking the console logshttp://localhost:5173 in your browser# Build all apps and packages
pnpm build
# Run development servers for all apps
pnpm dev
# Lint all packages
pnpm lint
# Format code
pnpm format
# Type check all packages
pnpm check-types
cd apps/http-backend
# Development mode (default: Mistral)
pnpm dev
# Production mode
pnpm prod
# Use specific AI model
pnpm mistral
pnpm claude
cd apps/user-frontend
# Development server
pnpm dev
# Build for production
pnpm build
# Preview production build
pnpm preview
# Lint code
pnpm lint
PORT in your backend .env file or kill the process using the portDATABASE_URL is correct and PostgreSQL is running.env filenpx prisma generate in the apps/http-backend directorynpx pnpm insteadliving-on-edge/
├── apps/
│ ├── http-backend/ # Express.js backend API
│ ├── user-frontend/ # React + Vite frontend
│ └── vs-code-block-generation/ # VS Code extension
├── packages/
│ ├── eslint-config/ # Shared ESLint config
│ ├── typescript-config/ # Shared TypeScript config
│ └── ui/ # Shared UI components
├── package.json # Root package.json
├── pnpm-workspace.yaml # pnpm workspace configuration
├── turbo.json # Turborepo configuration
└── README.md # This file