Skip to content

Add dev environment setup + fix Docker hot reload + C4 architecture README#25

Draft
dbfcode wants to merge 7 commits into
mainfrom
cursor/setup-dev-environment-2360
Draft

Add dev environment setup + fix Docker hot reload + C4 architecture README#25
dbfcode wants to merge 7 commits into
mainfrom
cursor/setup-dev-environment-2360

Conversation

@dbfcode
Copy link
Copy Markdown
Owner

@dbfcode dbfcode commented May 14, 2026

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:

Phase 1 · API health check
Phase 2 · Verify original response (4 assertions)
Phase 3 · Modify Java source file
Phase 4 · Wait for hot reload → assert modified response (~6-8s)
Phase 5 · Revert source file
Phase 6 · Wait for second hot reload → assert original response (~6-8s)
Phase 7 · Post-reload validation (CRUD + RabbitMQ still work)

Result: 9 assertions, all passing.

./scripts/test-hot-reload.sh          # uses running containers
./scripts/test-hot-reload.sh --start  # docker compose up first
./scripts/test-hot-reload.sh --full   # up, test, then down

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 edit
  • Started Application in 0.6-0.9 seconds after DevTools restart
  • All 9 assertions passing

E2E 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):

  • C1 System Context, C2 Containers, C3 Components, C4 Entity Relationship
  • Event Flow sequence diagram
  • Bilingual (PT-BR + EN), badges, endpoint table, tech stack

C2 Containers diagram on GitHub


3. Docker Hot Reload Fix

  • api/dev-entrypoint.sh: inotifywaitmvn compile → DevTools restart (~0.6s)
  • web/Dockerfile.dev: Vite dev server with HMR
  • Fixed MAVEN_OPTS conflict and misplaced env vars

4. Local Dev Environment

  • application-local.properties for running outside Docker
  • AGENTS.md with Cloud-specific instructions
  • mvnw execute permission fix

To show artifacts inline, enable in settings.

Open in Web Open in Cursor 

cursoragent and others added 3 commits May 14, 2026 00:18
- 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>
@cursor cursor Bot changed the title Add local development environment setup Add local dev environment setup + fix Docker hot reload May 14, 2026
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>
@cursor cursor Bot changed the title Add local dev environment setup + fix Docker hot reload Add dev environment setup + fix Docker hot reload + C4 architecture README May 14, 2026
cursoragent and others added 3 commits May 15, 2026 01:44
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants