# LexiChain — Documentation

> **Version:** 1.0.0 · **Stack:** Next.js 16 · React 19 · TypeScript · PostgreSQL · Solidity

Welcome to the LexiChain documentation. This folder contains everything needed to understand, develop, and deploy the platform.

---

## Table of Contents

| Document | Description |
|----------|-------------|
| [01 — Project Overview](./01-project-overview.md) | What LexiChain is, its features, architecture, and user flows |
| [02 — Services Reference](./02-services.md) | Every internal service: AI, Blockchain, Email, Notifications, RAG, etc. |
| [03 — Database Schema](./03-database-schema.md) | Full Prisma schema, models, relationships, and index rationale |
| [04 — API Reference](./04-api-reference.md) | All Next.js route handlers and key server actions |
| [05 — Smart Contract](./05-smart-contract.md) | DocumentRegistry.sol: design, functions, ABI, deployment |
| [06 — Deployment Guide](./06-deployment-openstack.md) | Step-by-step OpenStack VPS deployment with Docker, Nginx, and Sepolia |

---

## Quick Start (Development)

```bash
# 1. Install dependencies (auto-generates Prisma client via postinstall)
npm install

# 2. Copy and fill environment variables
cp .env.example .env

# 3. Run database migrations
npx prisma migrate dev

# 4. Start development server (includes local Hardhat blockchain)
npm run dev
```

The dev server starts at **http://localhost:3000**.  
The local Hardhat blockchain starts at **http://localhost:8545**.

---

## Quick Links

- [Environment Variables Reference](./.env.example)
- [Prisma Schema](../prisma/schema.prisma)
- [Smart Contract Source](../blockchain/contracts/DocumentRegistry.sol)
- [Deployment Guide](./06-deployment-openstack.md)
