Prerequisites
Before you begin, ensure you have the following installed on your system:Required software
- Java 21: JDK 21 or later is required for building and running the backend
- Node.js: Latest LTS version (for frontend development)
- pnpm 10: Package manager for frontend dependencies
- Git: Version control system
- Docker (optional): For running databases and testing
Verify installations
Check that you have the correct versions installed:The project uses Gradle Wrapper, so you don’t need to install Gradle separately. The wrapper will automatically download Gradle 9.3.0.
Clone the repository
Clone the Halo repository with all submodules:Backend setup
Set up the Spring Boot backend application.Verify Java version
The project requires Java 21. The build configuration enforces this:Make sure your
application/build.gradle
JAVA_HOME points to Java 21.Build the project
Use the Gradle wrapper to build the entire project:This command:
- Cleans previous build artifacts
- Builds all modules
- Skips tests and checks for faster initial setup
The first build may take several minutes as Gradle downloads dependencies.
Frontend setup
Set up the Vue.js console application.Install dependencies
Install all frontend dependencies:This command installs dependencies for the main application and all packages in the workspace.
Build shared packages
Before running the dev server, build the shared packages:This builds internal packages like
@halo-dev/api-client, @halo-dev/components, and others that the console depends on.Running both servers
For full-stack development, you need both backend and frontend running:The frontend development server proxies API requests to the backend server automatically through Vite’s proxy configuration.
Development tips
Hot reload
Both servers support hot reload:- Backend: Spring Boot DevTools enables automatic restart
- Frontend: Vite provides instant hot module replacement (HMR)
Running tests
Code formatting
Ensure your code is properly formatted before committing:Type checking
For TypeScript type checking in the frontend:Generate API client
After modifying backend APIs, regenerate the frontend API client:Building for production
When you’re ready to create production builds:The full production build automatically includes the frontend assets in the backend JAR file through the
copyUiDist Gradle task.Troubleshooting
Gradle build fails
If the Gradle build fails:- Ensure Java 21 is installed and
JAVA_HOMEis set correctly - Clear Gradle cache:
./gradlew clean --refresh-dependencies - Check for permission issues on
gradlewfile
Frontend dependencies fail
If dependency installation fails:- Clear pnpm cache:
pnpm store prune - Delete
node_modulesandpnpm-lock.yaml, then reinstall - Ensure you’re using pnpm 10.x
Port conflicts
If ports 8090, 5173, or 5174 are already in use:- Backend: Add
--args='--server.port=8091'tobootRun - Frontend: Vite will automatically use the next available port
Database connection issues
For database-related errors:- Check database configuration in
application/src/main/resources/application.yaml - Ensure the database service is running
- Verify connection credentials
Next steps
Extension system
Learn about Halo’s extension framework
Plugin development
Build your first Halo plugin
Theme development
Create a custom theme for Halo
API reference
Explore the API documentation