Chat2DB Build Commands: Complete Guide to Compiling from Source
To build Chat2DB from source, install Java 17, Maven 3.8+, and Node 18+, then run yarn install and yarn run build:web:community for the frontend, followed by mvn clean package for the backend, optionally using ./docker/docker-build.sh for containerization.
Chat2DB is a full-stack, cross-platform database client consisting of a TypeScript-React frontend (Umi framework) and a Java 17 Spring Boot backend. This guide provides the exact build commands for Chat2DB compilation from the OtterMind/Chat2DB repository, covering local development, production bundling, and Docker packaging.
Prerequisites
Before executing any build commands for Chat2DB, ensure your environment meets these requirements:
- Java 17 (Eclipse Temurin recommended)
- Maven 3.8 or higher
- Node.js 18 or higher
- Yarn package manager (lockfile provided in repository)
These dependencies are documented in the root README.md and AGENTS.md files.
Frontend Build Commands
The frontend resides in the chat2db-community-client/ directory and uses Yarn for dependency management.
Development Mode
To start the frontend in development mode with hot reloading:
cd chat2db-community-client
yarn install --frozen-lockfile
yarn run start:community:hot
This launches the UI at http://localhost:8889. The --frozen-lockfile flag ensures exact dependency resolution from the provided lockfile.
Production Web Bundle
To create an optimized production build for the server:
yarn run build:web:community --app_version=0.0.0
This generates static assets in the dist/ directory, ready for deployment alongside the backend. Configuration details are available in chat2db-community-client/README.md.
Backend Build Commands
The backend uses Maven with the parent POM located at chat2db-community-server/pom.xml.
Quick Build (Skip Tests)
For rapid compilation during development:
mvn -B clean package \
-Dmaven.test.skip=true \
-Dchat2db.finalName=chat2db-community \
-f chat2db-community-server/pom.xml \
-pl chat2db-community-start -am
The -pl chat2db-community-start -am flags build only the start module with its dependencies, while -Dmaven.test.skip=true bypasses test execution.
Full Test Build
To compile with comprehensive test verification:
mvn -B test \
-Dmaven.test.skip=false \
-DskipTests=false \
-f chat2db-community-server/pom.xml \
-pl chat2db-community-start -am
Use this command before committing changes or creating releases to ensure code quality.
Running the Compiled Server
After packaging, launch the backend with specific runtime configurations:
java -Dloader.path=chat2db-community-server/chat2db-community-start/target/lib \
-Dchat2db.gui=false \
-Dchat2db.runtime.mode=community \
-Dchat2db.mode=WEB \
-Dchat2db.network.status=OFFLINE \
-Dserver.address=127.0.0.1 \
-Dserver.port=10825 \
-Dspring.profiles.active=dev \
-jar chat2db-community-server/chat2db-community-start/target/chat2db-community.jar
This command configures the application for community mode with WEB UI and offline network status, binding to localhost on port 10825.
Docker Build Commands
For containerized deployments, use the provided helper script.
Building Local Images
Execute the build script from the repository root:
./docker/docker-build.sh 5.3.0 chat2db/chat2db:5.3.0
The script docker/docker-build.sh wraps the Maven packaging process and constructs a local Docker image with the specified version tag. This automates the backend compilation and container creation in a single step.
Summary
- Install prerequisites: Java 17, Maven 3.8+, Node 18+, and Yarn before building.
- Build frontend: Use
yarn installandyarn run build:web:communityto generate the web bundle. - Build backend: Run
mvn clean packagewith-Dmaven.test.skip=truefor quick builds or enable tests for verification. - Run locally: Execute the compiled JAR with specific
-Dsystem properties for mode configuration. - Docker option: Use
./docker/docker-build.shfor automated container image creation.
Frequently Asked Questions
What Java version is required to build Chat2DB?
Chat2DB requires Java 17 (specifically Eclipse Temurin distribution) for compilation and runtime. The Maven configuration in chat2db-community-server/pom.xml enforces this version requirement.
How do I build Chat2DB without running tests?
Add -Dmaven.test.skip=true to your Maven command. This skips both test compilation and execution, significantly reducing build time for rapid development iterations.
Where is the frontend build output located?
The frontend production build generates static assets in the chat2db-community-client/dist/ directory after running yarn run build:web:community. These files serve the web interface when deployed with the backend.
Can I build a Docker image without installing Maven locally?
Yes. The ./docker/docker-build.sh script handles the Maven packaging internally within the build process. However, you still need Docker installed to execute the script and create the container image.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →