Getting Started & Local Setup
Relevant source files
The following files were used as context for generating this wiki page:
LV.AI is an autonomous AI expert for construction specifications (AVA) in the D/A/CH region (Germany, Austria, Switzerland). The system supports creating, managing, and exporting GAEB-compliant documents using a chat-based interface.
Sources: README.md:1-12, CLAUDE.md:1-8
This guide details the steps required to configure the development environment, install dependencies, and initialize the database. The setup ensures compliance with GAEB DA XML standards and localized legal frameworks such as VOB, ÖNORM, and SIA.
Sources: README.md:58-65, CLAUDE.md:65-72
Prerequisites
Before starting the setup, ensure your system meets these technical requirements:
- Node.js: Version 20 or higher.
- pnpm: Version 10 or higher.
- Database: Neon Postgres or another PostgreSQL instance.
- AI Access: MiMo AI API Key (OpenAI-compatible via 9Router).
Sources: README.md:37-42, package.json:151
Installation Steps
Follow these steps to initialize the project locally:
- Clone the Repository:
git clone <repository-url> cd leistungsverzeichnis - Install Dependencies: Use pnpm to install the required packages defined in
package.json.pnpm install - Configure Environment: Copy the example environment file and populate it with required keys.
cp .env.example .env - Initialize Database: Execute migrations to set up the schema in your PostgreSQL instance.
pnpm db:migrate - Start Development Server: Launch the Next.js application.
pnpm dev
Sources: README.md:44-63, package.json:7-22
Setup Flow Diagram
The following diagram illustrates the local initialization process from cloning to running the server.
The flow shows the sequential dependencies between environment configuration and database readiness. Sources: README.md:44-63
Configuration
The application requires specific environment variables to manage authentication, AI routing, and database connections.
| Variable | Description | Requirement |
|---|---|---|
AUTH_SECRET | Secret key for Auth.js sessions. | Required |
POSTGRES_URL | Connection string for the PostgreSQL database. | Required |
OPENAI_API_KEY | API Key for the 9Router gateway. | Required |
OPENAI_BASE_URL | Endpoint for AI requests (http://127.0.0.1:20128/v1 for local). | Required |
LV_PASSWORD | Password for the MVP gate (Default: LV2026!!). | Optional |
MEM0_API_KEY | API key for memory persistence. | Optional |
Sources: README.md:67-76, CLAUDE.md:37-47
AI Integration Architecture
LV.AI uses 9Router as a multi-provider gateway to interact with LLMs like DeepSeek V4.
This diagram shows the communication path between the application and the local or public AI router. Sources: CLAUDE.md:37-47
Database Schema
The system uses Drizzle ORM to manage a PostgreSQL database. The schema is organized into core tables and AVA-specific entities.
| Table Category | Key Entities | Purpose |
|---|---|---|
| Core | User, Project, Chat, Message | Handles identity and conversation history. |
| LV-Core | LvDocument, LvPosition | Stores GAEB-compliant specifications and items. |
| Procurement | Offer, OfferPosition | Manages bidder prices and evaluations. |
| Operations | Invoice, Reminder, Drawing | Handles billing, deadlines, and technical plans. |
Sources: lib/db/schema.test.ts:74-142, CLAUDE.md:21-30
Project Scripts
Manage the lifecycle of the project using the following commands:
| Command | Action |
|---|---|
pnpm dev | Starts Next.js with Turbo-mode enabled. |
pnpm build | Migrates the database and builds the production application. |
pnpm test | Runs unit tests via Vitest. |
pnpm test:e2e | Executes Playwright end-to-end tests. |
pnpm db:studio | Opens the Drizzle Kit GUI for database exploration. |
Sources: package.json:7-22, README.md:92-102
Compliance Mapping
The system automatically configures the legal and technical foundation based on the project country.
| Country | Procurement (Vergabe) | Contract (Vertrag) | Technical (ATV) |
|---|---|---|---|
| DE | VOB/A | VOB/B | VOB/C (DIN 18299) |
| AT | ÖNORM B2110 | ÖNORM B2111 | ÖNORM Anhang C |
| CH | SIA 118 | SIA 102 | SIA 118 C |
Sources: README.md:78-84, CLAUDE.md:49-55
Proper setup ensures that all generated documents and AI responses adhere to these specific regional standards and the GAEB DA XML structure.
Sources: CLAUDE.md:32-35, README.md:86-90