# compile > Compile dashboard and loyalty projects in dev mode with hot reload. Dashboard uses npm, loyalty uses Maven with Spring Boot DevTools. - Author: Alexandre Roman - Repository: alexandreroman/loyalty-points-program-demo - Version: 20260127233605 - Stars: 0 - Forks: 0 - Last Updated: 2026-02-06 - Source: https://github.com/alexandreroman/loyalty-points-program-demo - Web: https://mule.run/skillshub/@@alexandreroman/loyalty-points-program-demo~compile:20260127233605 --- --- name: compile description: Compile dashboard and loyalty projects in dev mode with hot reload. Dashboard uses npm, loyalty uses Maven with Spring Boot DevTools. metadata: author: Alexandre Roman version: "1.0" --- # Compile Projects in Dev Mode Instructions for compiling and running the Dashboard and Loyalty Service in development mode with automatic hot reload. ## Dashboard (Nuxt.js) The dashboard is a Nuxt.js application with hot reload support for rapid development. ### Start Development Server ```bash cd dashboard npm run dev ``` This starts the Nuxt dev server with: - **Hot Module Replacement (HMR)** for instant updates - **Vue DevTools** support - **TypeScript** type checking - Development server typically runs on port 3000 (configurable) ### Important Notes - **Access via Gateway**: Even when running on the host, always access the dashboard through http://localhost:8080 (gateway proxies to the dev server) - **First run**: Run `npm install` if dependencies are missing - **Port conflicts**: If port 3000 is busy, Nuxt will try the next available port ### Development Commands ```bash # Install dependencies npm install # Start dev server with hot reload npm run dev # Type checking (optional) npm run build --typecheck # Generate static build (for production) npm run generate ``` ## Loyalty Service (Spring Boot + Maven) The loyalty service is a Spring Boot application with Maven and Spring Boot DevTools for automatic reload. ### Start Development Mode ```bash cd loyalty mvn spring-boot:run ``` This starts the Spring Boot application with: - **Spring Boot DevTools** for automatic restart on code changes - **LiveReload** integration - **Automatic restart** when classpath files change - Application runs on port 8081 (configured in application.properties) ### Important Notes - **Access via Gateway**: Always use http://localhost:8080/api/loyalty/* (gateway proxies to the service) - **Temporal Connection**: Ensure Temporal Server is running (`docker compose -f compose-dev.yaml up -d temporal`) - **First run**: Maven will download dependencies automatically - **Build artifacts**: DevTools watches `target/classes` for changes ### Development Commands ```bash # Clean and compile mvn clean compile # Run with dev mode (hot reload) mvn spring-boot:run # Run tests mvn test # Package without running tests mvn package -DskipTests # Run with specific profile mvn spring-boot:run -Dspring-boot.run.profiles=dev ``` ### Hot Reload Behavior Spring Boot DevTools triggers automatic restart when: - Java source files are modified and recompiled - Resources in `src/main/resources` are changed - Dependencies are updated **Restart is fast** because DevTools uses two classloaders: - Base classloader (unchanged dependencies) - Restart classloader (application code) ## Complete Development Workflow Typical workflow for working on both projects simultaneously: ```bash # Terminal 1: Start infrastructure services docker compose -f compose-dev.yaml up -d # Terminal 2: Start Dashboard dev server cd dashboard npm run dev # Terminal 3: Start Loyalty Service with Maven cd loyalty mvn spring-boot:run # Access everything via http://localhost:8080 ``` ## Compilation Without Running If you need to compile without starting the servers: **Dashboard:** ```bash cd dashboard npm run build ``` **Loyalty Service:** ```bash cd loyalty mvn compile ``` ## Troubleshooting **Dashboard not reloading:** - Check if the dev server is running - Verify no syntax errors in the console - Try restarting with `Ctrl+C` and `npm run dev` **Loyalty Service not reloading:** - Ensure `spring-boot-devtools` is in dependencies (already configured) - Check if IDE auto-build is enabled (for IntelliJ/Eclipse) - Manually trigger rebuild with `mvn compile` in another terminal - Verify Temporal connection in logs **Port conflicts:** - Dashboard dev server: Check port 3000 availability - Loyalty Service: Check port 8081 availability - Gateway: Ensure port 8080 is free ## IDE Integration **IntelliJ IDEA:** - Enable "Build project automatically" in Settings - Enable "Allow auto-make to start even if developed application is currently running" - DevTools will trigger restart automatically on save **VS Code:** - Dashboard: Uses Vite/Nuxt's built-in watcher - Loyalty: Use "Java Extension Pack" for automatic compilation