Add dev environment setup + fix Docker hot reload + C4 architecture README#25
Draft
dbfcode wants to merge 7 commits into
Draft
Add dev environment setup + fix Docker hot reload + C4 architecture README#25dbfcode wants to merge 7 commits into
dbfcode wants to merge 7 commits into
Conversation
- Add application-local.properties for running API outside Docker (localhost hostnames) - Add AGENTS.md with Cursor Cloud specific instructions - Fix mvnw execute permission Co-authored-by: Diêgo Ferreira <dbfcode@users.noreply.github.com>
Co-authored-by: Diêgo Ferreira <dbfcode@users.noreply.github.com>
API (Spring Boot): - Add dev-entrypoint.sh with inotifywait file watcher that auto-recompiles on .java/.properties/.xml changes, triggering DevTools restart (~0.5s) - Update Dockerfile to install inotify-tools and use the entrypoint script - Remove conflicting MAVEN_OPTS vs CMD jvmArguments (now uses SPRING_BOOT_JVM_ARGS env var) Web (React/Vite): - Add Dockerfile.dev running Vite dev server with full HMR (replaces nginx build) - Update vite.config.ts to read API_PROXY_TARGET env var (supports Docker networking) docker-compose.yml: - Remove misplaced SPRING_DEVTOOLS_* env vars from postgres service - Replace MAVEN_OPTS hack with SPRING_BOOT_JVM_ARGS for clean JDWP config - Switch web service to Dockerfile.dev with source volume mounts for HMR - Remove obsolete 'version' attribute Co-authored-by: Diêgo Ferreira <dbfcode@users.noreply.github.com>
Professional README targeting tech recruiters, developers, and stakeholders: - C1 System Context diagram (Mermaid) - C2 Containers diagram showing all services and communication - C3 Components diagram of API internals (controllers, messaging, data layer) - C4 Entity Relationship diagram (full data model) - Sequence diagram for async event flow - Complete REST API endpoint table - RabbitMQ topology reference - Tech stack table with all technologies - Project structure tree - Bilingual (PT-BR + EN) for broader reach - Professional badges and visual layout Co-authored-by: Diêgo Ferreira <dbfcode@users.noreply.github.com>
Automated test that validates the full hot-reload pipeline in Docker: 1. Verifies API responds with original message 2. Modifies Java source (TestController.java) 3. Waits for inotifywait → mvn compile → DevTools restart (~8s) 4. Asserts API responds with modified message 5. Reverts source file 6. Waits for second hot-reload cycle 7. Asserts API responds with original message again 8. Validates CRUD and RabbitMQ still work post-reload Usage: ./scripts/test-hot-reload.sh [--start | --full] Result: 9 assertions, all passing Co-authored-by: Diêgo Ferreira <dbfcode@users.noreply.github.com>
The __cacert_entrypoint.sh wrapper (injected by Cloud environments) runs exec from a different working directory than WORKDIR, causing './dev-entrypoint.sh: not found'. Using the absolute path /app/dev-entrypoint.sh resolves the issue. Co-authored-by: Diêgo Ferreira <dbfcode@users.noreply.github.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Complete developer experience overhaul: local dev environment setup, Docker hot reload fix, professional README with C4 architecture diagrams, and E2E hot-reload test.
1. E2E Hot-Reload Test (
scripts/test-hot-reload.sh)Automated test that validates the full hot-reload pipeline in Docker:
Result: 9 assertions, all passing.
Demo: E2E test + Spring Boot restart logs side by side
e2e_hot_reload_with_spring_boot_logs.mp4
The video shows the test running alongside the Spring Boot container logs, with:
[dev] Source change detected — recompiling...upon file editStarted Application in 0.6-0.9 secondsafter DevTools restartE2E test phases 4-7 showing hot reload in 8s
Spring Boot DevTools restart logs showing sub-second restart
2. README Redesign (C4 Model)
Professional README with C4 architecture diagrams (Mermaid):
C2 Containers diagram on GitHub
3. Docker Hot Reload Fix
api/dev-entrypoint.sh:inotifywait→mvn compile→ DevTools restart (~0.6s)web/Dockerfile.dev: Vite dev server with HMRMAVEN_OPTSconflict and misplaced env vars4. Local Dev Environment
application-local.propertiesfor running outside DockerAGENTS.mdwith Cloud-specific instructionsmvnwexecute permission fixTo show artifacts inline, enable in settings.