- Start PostgreSQL with
docker compose up -dinbackend/blog. - Run the backend with the Java 21 Maven wrapper.
- Run the frontend with Node 20+ and npm.
- Keep API DTOs and the TypeScript interfaces in
frontend/src/services/apiService.tsaligned. - Update the relevant file in
docs/whenever routes, security rules, entities, configuration, or infrastructure change.
Before submitting a change:
# Backend
cd backend/blog
./mvnw test
# Frontend
cd ../../frontend
npm run lint
npm run build
# Infrastructure
cd ../infra
terraform fmt -check
terraform validateWindows PowerShell users should run .\mvnw.cmd test for the backend and may need npm.cmd if PowerShell script execution is restricted.
- Service changes should include unit tests for success and failure paths.
- Controller/security changes should include MockMvc integration tests for public, authenticated, unauthorized, and forbidden behavior.
- Repository query changes should include data-layer tests.
- Frontend behavior should be covered with a component test framework before the UI grows further; Vitest and React Testing Library are a natural fit for Vite.
- Bug fixes should include a regression test where practical.
- Treat DTOs as the public contract; do not serialize JPA entities directly.
- Document status codes, authentication requirements, query parameters, and example payloads in
docs/API.md. - Update
docs/ERD.mdand its image when entity relationships change. - Prefer explicit database migrations for production schema changes.
- Never commit production credentials, JWT secrets, Terraform variable files, or cloud connection strings.
- Do not use the checked-in development password or seeded account in production.
- Enforce resource ownership/roles in the backend; hiding a UI button is not authorization.
- Sanitize rich-text HTML on output and keep the editor/display tag allowlists aligned.
- Restrict database firewall rules and CORS origins to required networks/origins.
Keep changes focused and describe:
- what changed and why;
- affected routes/configuration/data models;
- verification commands and results;
- screenshots for visible UI changes;
- migration or rollout considerations.