How ryu220/kitanoadchecker works
Project type and purpose
• This is a full-stack web application built on Next.js that provides both a React-based UI and a set of RESTful API routes.
• Purpose: automatically check advertising copy against Japanese legal regulations (薬機法, 景表法, etc.) by combining rule-based checks, retrieval-augmented generation (RAG), and LLM/A I.
File structure
• app/
• page.tsx, layout.tsx → front-end UI (Next.js App Router)
• app/api/v2/* → API endpoints (segment, evaluate, report, validate-api-key)
• components/ → React UI components (modals, selectors, report display)
• lib/ → core business logic
• segmentation, RAG engine, prompt management, cache manager, validation, vector-db interface
• knowledge/ → raw text files for legal knowledge (common, HA, SH)
• scripts/ → initialization and maintenance scripts (vector DB setup, env checks)
• config/ → static rules and product configurations (keywords, priority mappings)
• docker-compose.yml, Dockerfile → Docker setup for Next.js server and ChromaDB
• docs/ → detailed delivery, deployment, and architecture documentation
README for additional insights
• Four-layer “check engine”:
1. NG keyword filtering
2. Annotation-based rules
3. RAG search against vector DB
4. LLM (“Gemini 2.5 Flash Lite”) judgment
• RAG pipeline: chunk knowledge base (~5,129 chunks) → embed → store in ChromaDB → retrieve at runtime
• Two “faces” to the system:
• Web UI (React/Next.js pages)
• API (Next.js serverless functions under app/api/v2)
• Deployment: Docker Compose locally, Railway in production