Prerequisites
Before you begin, ensure you have:- Node.js 18 or higher installed (download)
- A Supabase project (create one)
- A Google AI Studio API key for Gemini (get one)
Installation
1. Clone or download the source code
If you have access to the Yggdrasil repository:2. Install dependencies
Install all required packages using npm:- Next.js 15 with React 19 and TypeScript 5.7
- Supabase client (
@supabase/supabase-js,@supabase/ssr) - Google Gemini SDK (
@ai-sdk/google,ai) - PDF parsing (
unpdf) - CSV parsing (
papaparse) - UI components (Tailwind CSS 4, shadcn/ui, Radix UI, Lucide icons)
- State management (Zustand)
- Validation (Zod 4)
3. Set up environment variables
Create a.env.local file in the project root:
.env.local with your credentials:
4. Set up the database
Yggdrasil uses Supabase PostgreSQL with Row-Level Security (RLS). You’ll need to create the required tables and RLS policies.Database Schema
The application requires the following tables:policies— Policy metadata (one per audit)rules— Extracted compliance rules with compound condition logicscans— Scan execution records with compliance scoresviolations— Detected compliance violations with evidencepii_findings— PII detection results from uploaded datasets
RPC Functions
You’ll also need to create theincrement_rule_stat RPC function for Bayesian feedback:
Full SQL migration scripts are included in the repository. Check the
supabase/migrations/ directory for table definitions and RLS policies.5. Run the development server
Start the Next.js development server:6. Build for production
To create an optimized production build:- Compile TypeScript to JavaScript
- Optimize React components
- Bundle and minify CSS
- Generate static pages where possible
Deployment Options
Vercel (recommended)
Yggdrasil is built on Next.js 15 and deploys seamlessly to Vercel:- Push your code to GitHub, GitLab, or Bitbucket
- Import the project in Vercel
- Configure environment variables in the Vercel dashboard
- Deploy
- Run
npm run buildon each push - Serve the application from a global CDN
- Support serverless API routes
Self-hosted (Docker, VPS, etc.)
For self-hosted deployments:- Build the production bundle:
npm run build - Start the server:
npm start - Configure a reverse proxy (nginx, Caddy) to handle HTTPS
- Set
NEXT_PUBLIC_APP_URLto your production domain
Verification
To verify your installation:- Navigate to
http://localhost:3000 - Sign up for an account (or use demo mode)
- Create a new audit and upload a test CSV
- Run a compliance scan
Troubleshooting
”Error: Invalid Supabase URL”
EnsureNEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_ANON_KEY are correctly set in .env.local. The URL should start with https:// and end with .supabase.co.
”Error: Gemini API key not found”
EnsureGEMINI_API_KEY is set in .env.local. This key is server-side only and should not have the NEXT_PUBLIC_ prefix.
Build errors with TypeScript
If you encounter TypeScript errors duringnpm run build, ensure you’re using TypeScript 5.7 or higher:
Database connection issues
Check that your Supabase project is active and the anon key has not expired. You can regenerate keys from the Supabase dashboard under Settings → API.Next Steps
Configuration
Learn about all environment variables and deployment settings
Quickstart
Run your first compliance scan