Installation
Installation
Section titled “Installation”This is the full setup guide. For a minimal 5-minute setup, see Quickstart.
System Requirements
Section titled “System Requirements”| Requirement | Version | Notes |
|---|---|---|
| Node.js | 20+ | LTS recommended. Verify: node -v |
| npm | 10+ | Ships with Node 20 |
| Git | 2.x+ | With Git LFS for large data files |
| C++ build tools | — | Required for better-sqlite3 native compilation |
| Docker | — | Optional, only for local Neo4j |
Step-by-Step Setup
Section titled “Step-by-Step Setup”1. Clone the Repository
Section titled “1. Clone the Repository”git clone https://github.com/sensdiego/juca.gitcd jucaIf the repository uses Git LFS for data files, also run:
git lfs installgit lfs pull2. Install Dependencies
Section titled “2. Install Dependencies”npm installThis installs ~670 packages including the better-sqlite3 native module. If compilation fails:
- macOS:
xcode-select --install - Linux (Debian/Ubuntu):
sudo apt-get install build-essential python3 - Linux (RHEL/Fedora):
sudo dnf groupinstall "Development Tools"
3. Environment Configuration
Section titled “3. Environment Configuration”Copy the example file and fill in your values:
cp .env.example .env.localRequired variables (minimum):
# LLM Providers — at least Anthropic + GroqANTHROPIC_API_KEY=sk-ant-...GROQ_API_KEY=gsk_...
# Dev auth bypassENABLE_DEV_AUTH=trueOptional but recommended:
# Valter integration (the primary backend)VALTER_API_URL=https://valter-api-production.up.railway.appVALTER_API_KEY=your-key
# Additional LLM providersOPENAI_API_KEY=sk-...GEMINI_API_KEY=...DEEPSEEK_API_KEY=sk-...
# Knowledge Graph (local mode by default)KG_PROVIDER=jsonSee Environment Variables for the complete reference of 30+ variables.
4. Local Neo4j (Optional)
Section titled “4. Local Neo4j (Optional)”If you want to use the Neo4j knowledge graph locally instead of JSON files:
docker compose up -dThis starts a Neo4j Community 5 instance. Then configure:
KG_PROVIDER=neo4jNEO4J_URI=bolt://localhost:7687NEO4J_USERNAME=neo4jNEO4J_PASSWORD=password5. Git Hooks
Section titled “5. Git Hooks”The project uses custom git hooks in .githooks/:
| Hook | Action |
|---|---|
pre-commit | Runs ESLint on staged files |
pre-push | Runs the full test suite |
post-checkout | Housekeeping tasks |
post-commit | Housekeeping tasks |
post-merge | Housekeeping tasks |
Hooks are configured automatically via the prepare script in package.json:
npm run prepare # Runs: git config core.hooksPath .githooks6. Verify Installation
Section titled “6. Verify Installation”# Start the dev servernpm run dev
# In another terminal, run testsnpm testExpected outcomes:
- Dev server starts at
http://localhost:3000with no errors - Tests execute (some may fail due to known issue #270)
Docker Setup (Production)
Section titled “Docker Setup (Production)”Juca uses a multi-stage Docker build for production deployment:
# Build the image (NOTE: for CI/Railway only — do NOT run locally)docker build -t juca .The Dockerfile:
- deps stage — Installs npm dependencies
- build stage — Runs
next buildwith standalone output - runtime stage — Minimal Node.js image with only production artifacts
Deployment to Railway happens automatically on push to main.
Troubleshooting
Section titled “Troubleshooting”| Problem | Solution |
|---|---|
better-sqlite3 compilation fails | Install C++ build tools (see step 2) |
| Git LFS files are pointer files | Run git lfs pull |
| Auth errors on every page | Set ENABLE_DEV_AUTH=true in .env.local |
| ”No API key configured” | Add at minimum ANTHROPIC_API_KEY and GROQ_API_KEY |
For more issues, see Troubleshooting.