-
Notifications
You must be signed in to change notification settings - Fork 109
doc: add AGENTS.md, update README and project config #711
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,157 @@ | ||
| # AGENTS.md | ||
|
|
||
| This file provides guidance to AI coding assistants (Claude Code, Cursor, GitHub Copilot, etc.) when working with code in this repository. | ||
|
|
||
| ## Project Overview | ||
|
|
||
| Apache HugeGraph Toolchain - a multi-module Maven project providing utilities for the HugeGraph graph database. Current version: 1.7.0. | ||
|
|
||
| ## Build Commands | ||
|
|
||
| ### Full Build | ||
| ```bash | ||
| mvn clean install -DskipTests -Dmaven.javadoc.skip=true -ntp | ||
| ``` | ||
|
|
||
| ### Module-Specific Builds | ||
|
|
||
| **Java Client:** | ||
| ```bash | ||
| mvn -e compile -pl hugegraph-client -Dmaven.javadoc.skip=true -ntp | ||
| ``` | ||
|
|
||
| **Loader (requires client):** | ||
| ```bash | ||
| mvn install -pl hugegraph-client,hugegraph-loader -am -DskipTests -ntp | ||
| ``` | ||
|
|
||
| **Hubble (requires client + loader):** | ||
| ```bash | ||
| mvn install -pl hugegraph-client,hugegraph-loader -am -DskipTests -ntp | ||
| cd hugegraph-hubble && mvn package -DskipTests -ntp | ||
| ``` | ||
|
|
||
| **Tools:** | ||
| ```bash | ||
| mvn install -pl hugegraph-client,hugegraph-tools -am -DskipTests -ntp | ||
| ``` | ||
|
|
||
| **Spark Connector:** | ||
| ```bash | ||
| mvn install -pl hugegraph-client,hugegraph-spark-connector -am -DskipTests -ntp | ||
| ``` | ||
|
|
||
| **Go Client:** | ||
| ```bash | ||
| cd hugegraph-client-go && make all | ||
| ``` | ||
|
|
||
| ## Testing | ||
|
|
||
| ### Client Tests | ||
| ```bash | ||
| cd hugegraph-client | ||
| mvn test -Dtest=UnitTestSuite # Unit tests (no server required) | ||
| mvn test -Dtest=ApiTestSuite # API tests (requires HugeGraph server) | ||
| mvn test -Dtest=FuncTestSuite # Functional tests (requires HugeGraph server) | ||
| ``` | ||
|
|
||
| ### Loader Tests (profiles) | ||
| ```bash | ||
| cd hugegraph-loader | ||
| mvn test -P unit # Unit tests | ||
| mvn test -P file # File source tests | ||
| mvn test -P hdfs # HDFS tests (requires Hadoop) | ||
| mvn test -P jdbc # JDBC tests (requires MySQL) | ||
| mvn test -P kafka # Kafka tests | ||
| ``` | ||
|
|
||
| ### Hubble Tests | ||
| ```bash | ||
| mvn test -P unit-test -pl hugegraph-hubble/hubble-be -ntp | ||
| ``` | ||
|
|
||
| ### Tools Tests | ||
| ```bash | ||
| mvn test -Dtest=FuncTestSuite -pl hugegraph-tools -ntp | ||
| ``` | ||
|
|
||
| ## Code Style | ||
|
|
||
| Checkstyle enforced via `tools/checkstyle.xml`: | ||
| - Max line length: 100 characters | ||
| - 4-space indentation (no tabs) | ||
| - No star imports | ||
| - No `System.out.println` | ||
|
|
||
| Run checkstyle: | ||
| ```bash | ||
| mvn checkstyle:check | ||
| ``` | ||
|
|
||
| ## Architecture | ||
|
|
||
| ### Module Dependencies | ||
| ``` | ||
| hugegraph-loader, hugegraph-tools, hugegraph-hubble, hugegraph-spark-connector | ||
| ↓ | ||
| hugegraph-client | ||
| ↓ | ||
| hugegraph-common (external) | ||
| ``` | ||
|
|
||
| ### Key Patterns | ||
|
|
||
| **hugegraph-client** - Manager/Facade pattern: | ||
| - `HugeClient` is the entry point providing access to specialized managers | ||
| - `SchemaManager`, `GraphManager`, `GremlinManager`, `TraverserManager`, etc. | ||
| - Builder pattern for fluent schema creation | ||
|
|
||
| **hugegraph-loader** - Pipeline with Factory pattern: | ||
| - `InputSource` interface with implementations: `FileSource`, `HDFSSource`, `JDBCSource`, `KafkaSource`, `GraphSource` | ||
| - `InputReader.create()` factory method creates appropriate reader for source type | ||
|
|
||
| **hugegraph-hubble** - Spring Boot MVC: | ||
| - Backend: `controller/` → `service/` → `mapper/` layers | ||
| - Frontend: React + TypeScript + MobX + Ant Design | ||
| - H2 database for metadata storage | ||
|
|
||
| **hugegraph-tools** - Command pattern: | ||
| - Manager classes for operations: `BackupManager`, `RestoreManager`, `GraphsManager` | ||
|
|
||
| ### Key Directories | ||
|
|
||
| | Module | Main Code | Package | | ||
| |--------|-----------|---------| | ||
| | client | `hugegraph-client/src/main/java` | `org.apache.hugegraph` | | ||
| | loader | `hugegraph-loader/src/main/java` | `org.apache.hugegraph.loader` | | ||
| | hubble-be | `hugegraph-hubble/hubble-be/src/main/java` | `org.apache.hugegraph` | | ||
| | hubble-fe | `hugegraph-hubble/hubble-fe/src` | React/TypeScript | | ||
| | tools | `hugegraph-tools/src/main/java` | `org.apache.hugegraph` | | ||
| | spark | `hugegraph-spark-connector/src/main/scala` | `org.apache.hugegraph.spark` | | ||
|
|
||
| ## Running Applications | ||
|
|
||
| ### Hubble (Web UI on port 8088) | ||
| ```bash | ||
| cd hugegraph-hubble/apache-hugegraph-hubble-incubating-*/bin | ||
| ./start-hubble.sh # Background | ||
| ./start-hubble.sh -f # Foreground | ||
| ./stop-hubble.sh # Stop | ||
| ``` | ||
|
|
||
| ### Loader | ||
| ```bash | ||
| cd hugegraph-loader/apache-hugegraph-loader-incubating-* | ||
| ./bin/hugegraph-loader.sh [options] | ||
| ``` | ||
|
|
||
| ## Docker | ||
|
|
||
| ```bash | ||
| # Loader | ||
| cd hugegraph-loader && docker build -t hugegraph/hugegraph-loader:latest . | ||
|
|
||
| # Hubble | ||
| cd hugegraph-hubble && docker build -t hugegraph/hugegraph-hubble:latest . | ||
| ``` | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.