A monorepo for a LegalTech starter application with a Next.js frontend and a NestJS backend.
frontend/— Next.js 16 applicationbackend/— NestJS 11 API serverdocker-compose.yml— local Docker development setup for both servicesdocker-compose.neo4j.yml— standalone Neo4j container for the Graph RAG system
- Frontend:
Next.js 16,React 19,TypeScript,Tailwind CSS,Axios,shadcn/ui,Radix UI. - Backend:
NestJS 11,TypeScript,TypeORM,PostgreSQL,Passport,JWT,Supabase SDK,bcrypt. - Graph RAG:
Neo4j 5plusOpenAIembeddings and LLM-based graph extraction
- Node.js 20+ and npm
- Docker and Docker Compose for containerized development
- Git for source control
Each service manages dependencies independently. Run installs inside each folder.
cd frontend
npm install
cp .env.example .env
npm run devOpen http://localhost:5173
cd backend
npm install
cp .env.example .env
npm run devOpen http://localhost:3000
If you want to use the Graph RAG features, start Neo4j separately:
docker compose -f docker-compose.neo4j.yml up -dWhen the backend runs inside Docker, point backend/config/graph-rag.config.json at http://host.docker.internal:7474 instead of http://localhost:7474.
Open two terminals and start both services from their folders:
cd frontend && npm run dev
cd backend && npm run devFrom the repository root:
docker compose up --buildThis starts both services with live reload enabled:
- Frontend:
http://localhost:5173 - Backend:
http://localhost:3000
Stop and remove containers:
docker compose downStop the external Neo4j container:
docker compose -f docker-compose.neo4j.yml down- The repository mounts source code into containers so edits are reflected immediately.
- If you need to change environment variables, update
frontend/.envandbackend/.envafter copying from.env.example. - Graph RAG settings live in
backend/config/graph-rag.config.json. - The hybrid Graph RAG also requires
OPENAI_API_KEYinbackend/.env. - For setup and usage of the hybrid GraphRAG flow, see GraphRAG.md.
npm run dev— start the frontend in development modenpm run build— build the production frontendnpm run lint— lint frontend source files
npm run start— start the backend servernpm run dev— start NestJS in watch modenpm run build— compile the backendnpm run lint— lint backend source filesnpm test— run unit testsnpm run test:e2e— run end-to-end tests
If you run into issues, first check that:
- Node and npm are installed
.envfiles have been created from.env.example- Docker is running when using Docker Compose
If problems persist, inspect container logs with docker compose logs or open an issue in the repository.