Project Configuration
Relevant source files
The following files were used as context for generating this wiki page:
Project Configuration defines the fundamental settings, environment variables, and architectural boundaries of the LV.AI platform. It ensures compliance with D/A/CH region standards (Germany, Austria, Switzerland) for construction industry processes like GAEB DA XML data exchange and VOB/ÖNORM/SIA legal frameworks.
The system integrates a modern web tech stack including Next.js 16, Vercel AI SDK, and Neon Postgres, while maintaining strict configuration for AI provider gateways and database schemas.
Sources: CLAUDE.md:1-20, README.md:1-25
Tech Stack Overview
The project utilizes a specific set of technologies to handle autonomous AVA (Ausschreibung, Vergabe, Abrechnung) tasks.
| Component | Technology | Description |
|---|---|---|
| Framework | Next.js 16 (App Router) | Core application framework. |
| UI | shadcn/ui + Tailwind CSS 4 | Frontend component library and styling. |
| AI Engine | Vercel AI SDK 6 + 9Router | Gateway for DeepSeek V4 and multi-provider LLMs. |
| Database | Neon Postgres + Drizzle ORM | Relational data storage and TypeScript ORM. |
| Memory | mem0 | Management of Project-Scope and Global-Scope memory. |
| Auth | Auth.js | Authentication via password-gate. |
Sources: CLAUDE.md:24-33, package.json:35-85
AI Provider Integration
The AI architecture relies on 9Router, a Multi-Provider-Gateway developed by NeXify. This gateway provides an OpenAI-compatible API for various models.
Integration Flow
The application connects to 9Router either locally for VPS deployments or via a Public HTTPS endpoint secured by Cloudflare Tunnels for remote environments.
The diagram shows the request flow from the application through the 9Router gateway, utilizing headroom for token-caching before hitting specific LLM backends.
Sources: CLAUDE.md:46-59
Environment Variables for AI
| Variable | Value/Endpoint | Purpose |
|---|---|---|
OPENAI_API_KEY | User-defined | Authentication for the 9Router gateway. |
OPENAI_BASE_URL | http://127.0.0.1:20128/v1 | Local endpoint for VPS deployment. |
OPENAI_BASE_URL | https://ai-router.nexifyai.cloud/v1 | Public endpoint via Cloudflare Tunnel. |
Sources: CLAUDE.md:52-56, README.md:65-75
Database Schema Configuration
The project uses Drizzle ORM to define a PostgreSQL schema that maps bau-specific entities. The core concept is that every Chat is equivalent to one Project (Bauprojekt).
Entity Relationship Diagram
This diagram illustrates the relationship between users, projects, and the specialized construction documents (LVs, Offers, Invoices).
Sources: lib/db/schema.ts:1-300, CLAUDE.md:40
Core Tables
- Project: Stores metadata including
land(DE/AT/CH),gewerk(trade), andstatus(entwurf, ausschreibung, etc.). - LvDocument: Manages GAEB-related documents with specific
gaebFormat(X81–X89). - LvPosition: Detailed line items with
oz(Ordnungszahl),menge(quantity), andeinheitspreis(unit price).
Sources: lib/db/schema.ts:55-75, lib/db/schema.ts:175-210
Compliance and Regional Settings
The platform automatically adjusts its logic based on the country configuration. This affects currency, bidding rules, and contract law.
| Land | Legal Framework (Vergabe) | Contract Law (Vertrag) | Technical Standards (ATV) | Currency |
|---|---|---|---|---|
| DE | VOB/A | VOB/B | VOB/C (DIN 18299) | EUR |
| AT | ÖNORM B2110 | ÖNORM B2111 | ÖNORM Anhang C | EUR |
| CH | SIA 118 | SIA 102 | SIA 118 C | CHF |
Sources: CLAUDE.md:63-68, README.md:83-88
System Prompts and Persona Configuration
The AI's behavior is governed by a modularized prompt system defined in lib/ai/prompts.ts. The configuration splits prompts into stable (cached) and dynamic (request-specific) parts to optimize token usage.
Prompt Structure
- Expertise: Defined as LV.AI, an expert in AVA D/A/CH.
- Artifact Rules: Constraints for generating scripts (
code), documents (text), and spreadsheets (sheet). - Request Hints: Dynamic context including user location (lat/lon) and project-specific metadata.
Sources: lib/ai/prompts.ts:9-85, lib/ai/prompts.ts:107-139
Development and Deployment Configuration
The project uses pnpm for package management and includes several scripts for database management and testing.
Common Scripts
{
"scripts": {
"dev": "next dev --turbo",
"db:migrate": "npx tsx lib/db/migrate.ts",
"db:push": "drizzle-kit push",
"test:e2e": "export PLAYWRIGHT=True && pnpm exec playwright test"
}
}
Sources: package.json:7-22
Global Layout Configuration
The root layout (app/layout.tsx) configures the theme (light/dark) via a MutationObserver script and sets the default language to German (lang="de"). It also integrates SessionProvider for authentication and TooltipProvider for UI components.
Sources: app/layout.tsx:40-90
Project Configuration establishes the LV.AI environment by binding regional compliance, specialized AI gateways, and a construction-specific database schema into a unified Next.js 16 application.