AI-powered tool voor het automatisch controleren van jaarrekeningen tegen SRA (Standpunt Revisie Accountantsorganisaties) checklist criteria. Het systeem gebruikt Retrieval Augmented Generation (RAG) en OpenAI GPT-4o-mini om criteria te evalueren op basis van de jaarrekening context.
- Node.js 18+ en npm
- OpenAI API Key (wordt via frontend ingevoerd)
npm install
npm run devDat is alles! De applicatie start op http://localhost:3000
Wat gebeurt er automatisch bij npm install:
- ✅ Alle dependencies worden geïnstalleerd
- ✅ Database wordt aangemaakt (
prisma/dev.db) - ✅ Database schema wordt geïnitialiseerd (User, ChecklistCriteria, CheckResult tabellen)
- ✅ Prisma client wordt gegenereerd
Wat gebeurt er automatisch bij npm run dev:
- ✅ BetterAuth wordt geconfigureerd (hardcoded dev secret)
- ✅ Database connectie wordt opgezet
- ✅ Applicatie start op http://localhost:3000
- Open http://localhost:3000
- Maak een account aan en log in (BetterAuth werkt automatisch)
- Voer je OpenAI API key in (in "Bestanden Uploaden" tab)
- Wordt opgeslagen voor de huidige sessie
- Haal je key op van: https://platform.openai.com/api-keys
- Upload SRA checklist Excel bestand (.xlsm)
- Selecteer een sheet om te evalueren
- Upload jaarrekening PDF
- Klik "Bereid Data Voor" (RAG pipeline wordt geïnitialiseerd)
- Klik "Start Evaluatie"
"Cannot find module" errors:
rm -rf node_modules package-lock.json
npm install"OPENAI_API_KEY is not set" message:
- Voer je API key in via de frontend (Bestanden Uploaden tab)
Database errors:
rm prisma/dev.db
npm run db:pushPort 3000 already in use:
npm run dev -- -p 3001-
Account aanmaken:
- Registreer een nieuw account of log in met bestaande credentials
-
OpenAI API Key instellen:
- Ga naar "Bestanden Uploaden" tab
- Voer je OpenAI API key in (wordt veilig opgeslagen voor de sessie)
-
SRA Checklist uploaden:
- Upload je SRA checklist Excel bestand (.xlsm)
- Selecteer een specifieke sheet om te evalueren
- Wacht tot de checklist is geparsed en opgeslagen
-
Jaarrekening PDF uploaden:
- Upload de jaarrekening PDF
- Klik op "Bereid Data Voor" om de evaluatie data voor te bereiden
- Het systeem gebruikt RAG om relevante context te vinden voor elk criterium
-
Evaluatie starten:
- Klik op "Start Evaluatie" om de geautomatiseerde evaluatie te starten
- Het systeem evalueert elk criterium met OpenAI GPT-4o-mini
- Voortgang wordt getoond tijdens de evaluatie
-
Resultaten bekijken:
- Ga naar de "Resultaten" tab om alle evaluatie resultaten te zien
- Filter op status: Voldaan, Niet Voldaan, of Gedeeltelijk
- Elke resultaat bevat:
- Pagina referenties (waar in de jaarrekening)
- Uitleg van de evaluatie
- Gebruikte RAG context (uitklapbaar)
- Wetboek referenties (BW 2:xxx, RJ xxx)
BonsaiCase/
├── app/
│ ├── api/ # API routes
│ │ ├── auth/ # Authentication endpoints
│ │ ├── upload-checklist/ # Checklist upload & parsing
│ │ ├── check-annual-report/# PDF upload & RAG processing
│ │ ├── evaluate/ # Start evaluation
│ │ ├── results/ # Fetch evaluation results
│ │ └── settings/ # API key management
│ ├── dashboard/ # Main dashboard page
│ └── page.tsx # Landing page
├── components/ # React components
│ ├── FileUpload.tsx # File upload interface
│ ├── ResultsView.tsx # Results display
│ ├── ApiKeySettings.tsx # API key input
│ └── DashboardClient.tsx # Dashboard logic
├── lib/
│ ├── ai/ # AI services
│ │ ├── evaluate-service.ts # Main evaluation service
│ │ ├── openaiService.ts # OpenAI integration
│ │ ├── promptBuilder.ts # Prompt construction
│ │ └── review-service.ts # Review data preparation
│ ├── parsers/ # File parsers
│ │ ├── excel-parser.ts # SRA checklist parser
│ │ └── pdf-parser.ts # PDF text extraction
│ ├── rag/ # RAG pipeline
│ │ ├── processPdf.ts # PDF processing & chunking
│ │ ├── embeddings.ts # Embedding generation
│ │ ├── vectorStore.ts # Vector store (file-based)
│ │ └── retrieveContext.ts # Context retrieval
│ ├── auth.ts # Authentication setup
│ └── db.ts # Database client
├── models/ # TypeScript interfaces
├── prisma/
│ └── schema.prisma # Database schema
└── scripts/ # Utility scripts
npm run dev # Start development server
npm run build # Build voor productie
npm run start # Start productie server
npm run lint # Run ESLint
npm test # Run tests
npm run db:generate # Generate Prisma client
npm run db:push # Push schema naar database
npm run db:studio # Open Prisma Studio (database viewer)npm test # Run alle tests
npm run test:watch # Watch mode
npm run test:coverage # Met coverage report- ARCHITECTURE.md - Gedetailleerde technische uitleg over hoe het systeem werkt
- CASE_REQUIREMENTS.md - Case requirements checklist
- API Keys: OpenAI API keys worden alleen in de sessie opgeslagen (niet in database)
- Authentication: BetterAuth met secure session management
- Input Validation: Alle inputs worden gevalideerd voordat verwerking
- SQL Injection: Prisma ORM voorkomt SQL injection
- ✅ Excel Parsing: Automatische extractie van SRA checklist criteria
- ✅ PDF Parsing: Intelligente pagina detectie en tekst extractie
- ✅ RAG Pipeline: Volledige RAG implementatie met embeddings en vector search
- ✅ AI Evaluatie: OpenAI GPT-4o-mini voor criterium evaluatie
- ✅ Context Retrieval: Relevante context uit jaarrekening per criterium
- ✅ Page References: Automatische pagina referenties in Nederlandse format
- ✅ Wetboek Codes: Ondersteuning voor BW en RJ referenties
- ✅ Sheet Selection: Selecteer specifieke sheets uit Excel
- ✅ Filtering: Automatisch filteren op 'i+d' type ondernemingen
- ✅ Hallucinatie Preventie: Validatie en prompt engineering tegen AI hallucinaties
- Framework: Next.js 14+ (App Router)
- Auth: BetterAuth
- Database: SQLite (via Prisma ORM)
- AI: OpenAI GPT-4o-mini (evaluatie) + text-embedding-3-small (embeddings)
- Styling: Tailwind CSS
- File Parsing: xlsx, pdf-parse
- Language: TypeScript
- Checklist parser filtert automatisch op 'i+d' type ondernemingen
- Context gebruikt Nederlandse pagina format: "Pagina X"
- Resultaten bevatten uitleg in het Nederlands
- RAG vector store is file-based voor persistentie tussen requests
Dit is een case study project voor Bonsai Software.
Bonsai Software - Case Study Project