Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# AGENTS.md

## Cursor Cloud specific instructions

### Architecture overview

ExpandProject is a data modeling and import platform for Neo4j graph databases with three components:

| Service | Technology | Port | Start command |
|---------|-----------|------|---------------|
| **Neo4j** | Neo4j 5.17.0 (Docker) | 7474/7687 | `docker run -d --name neo4j-expand -p 7474:7474 -p 7687:7687 -e NEO4J_AUTH=neo4j/expand123456 neo4j:5.17.0` |
| **API** | Java 17+ / SparkJava / Maven | 8080 | `NEO4J_AUTH=neo4j/expand123456 NEO4J_BOLT_URI=bolt://localhost:7687 java -jar importdata/target/expandproject-importdata.jar --api 8080` |
| **UI** | Vue 3 / Vuetify / Vite | 5173 | `cd ui && VITE_API_BASE=http://localhost:8080 npx vite --host 0.0.0.0 --port 5173` |

### Running services

1. **Neo4j must start first** — the API connects to it on startup. Wait ~10s for Neo4j to accept connections before starting the API.
2. **Build the backend JAR** before starting the API: `mvn clean install -DskipTests` (from repo root). The fat JAR is at `importdata/target/expandproject-importdata.jar`.
3. **UI dependencies**: `cd ui && npm ci` before starting the dev server.
4. The API uses **embedded SQLite** for auth (auto-created at `~/.expandproject/access.sqlite`). No extra DB setup needed.

### Default credentials

- **Neo4j**: `neo4j` / `expand123456` (Docker) or `neo4j` / `expand` (local install)
- **API admin**: `admin` / `admin` (auto-bootstrapped on first run)

### Testing

- Backend tests: `NEO4J_AUTH=neo4j/expand123456 NEO4J_BOLT_URI=bolt://localhost:7687 mvn test -pl importdata -DfailIfNoTests=false` (requires running Neo4j).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Add -am to backend test command

The documented test command uses mvn test -pl importdata -DfailIfNoTests=false without --also-make, which can fail from a clean checkout because importdata depends on sibling module fr.expand.project:commonspackage (importdata/pom.xml). Maven’s own help says -pl builds only the specified projects and -am is required to also build projects required by that list, so this command is not reliably runnable unless dependencies were installed beforehand.

Useful? React with 👍 / 👎.

- Frontend build check: `cd ui && npm run build`
- The CI workflow (`.github/workflows/ci.yml`) runs backend tests with a Neo4j service container and a frontend build check.

### Gotchas

- Java 21 is installed on the VM but the project targets Java 17 (`maven.compiler.source/target=17`). This is compatible; no downgrade needed.
- The default Maven surefire version (2.12.4) silently reports "no tests" even when test classes exist — use `-DfailIfNoTests=false` and explicit `-Dtest=...` if needed.
- The API requires auth via `Authorization: Bearer <token>` header. Get a token by POSTing to `/api/auth/login` with `{"username":"admin","password":"admin"}`.
- Docker must use `fuse-overlayfs` storage driver and `iptables-legacy` in the Cloud VM (nested container environment).
Loading