Skip to content

Latest commit

 

History

History
112 lines (75 loc) · 2.95 KB

File metadata and controls

112 lines (75 loc) · 2.95 KB

Development

Guide for running Solarch from source (without the all-in-one Docker bundle).

Prerequisites

  • Node.js ≥ 20.19
  • pnpm 10 (see root packageManager field)
  • Docker — for Neo4j (apps/server/docker-compose.yml or root compose)
  • LLM provider env vars (same as production)

Clone & install

git clone https://github.com/solarch-dev/solarch.git
cd solarch
pnpm install

Monorepo layout: pnpm workspaces + Turborepo. Root scripts fan out to apps/web and apps/server.

Environment

cp .env.example .env
# Required: NEO4J_PASSWORD, LLM_GENERATION_PROVIDER, LLM_CHAT_PROVIDER, provider API key

For split dev (web on 5173, server on 4000), keep CORS_ORIGIN=http://localhost:5173 in server env when not using the Vite proxy-only flow.

Neo4j

From apps/server/:

pnpm neo4j:up        # docker compose up -d (Neo4j only)
pnpm neo4j:migrate   # constraints + vector index (needs .env with NEO4J_*)

Or use root docker compose up neo4j -d if you prefer the full stack file.

Run dev servers

Terminal 1 — API:

pnpm dev:server      # NestJS watch → http://localhost:4000/api/v1
                     # Scalar docs → http://localhost:4000/api/v1/docs (non-production)

Terminal 2 — Web:

pnpm dev:web         # Vite → http://localhost:5173
                     # proxies /api → :4000

Open http://localhost:5173 during development.

Tests

pnpm test:server     # unit tests (820+), excludes heavy Docker specs by default

From apps/server/:

pnpm test            # all unit specs in src/
pnpm test:e2e        # Testcontainers Neo4j + HTTP e2e (Docker required, ~2 min first run)
pnpm test:codegen-gate  # codegen golden gate

Vitest injects minimal NEO4J_* and LLM_* env for imports — see vitest.config.ts.

Build smoke check

pnpm build           # turbo: server + web production builds

There is no separate typecheck script — next build / nest build enforce types.

OpenAPI client sync

Web types come from the server OpenAPI document. After API changes, regenerate from apps/web/ (if a generate script exists in package.json) or run the documented openapi-typescript step in that package.

Optional: solarch-tools sibling checkout

Surgical fill and import resolution look for:

../solarch-tools/packages/cli/dist/index.js

relative to the server cwd. Clone solarch-tools next to the monorepo for local CLI dev; Docker images bundle a release CLI.

Project-specific READMEs

See also