You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[ ] You ran the full stack locally and manually verified the change works
272
272
-[ ] PR description includes a screen recording or screenshots proving it works
@@ -276,6 +276,8 @@ Before opening your PR:
276
276
-[ ]**PR is reasonably sized.** PRs with 1000+ changed lines will be closed without review. Break large changes into small, focused PRs.
277
277
-[ ]**For user-facing features:** submit a companion docs PR at [booklore-docs](https://github.com/booklore-app/booklore-docs)
278
278
279
+
> When you open your PR on GitHub, a **PR template** will appear. Fill it out completely, including test output and screenshots.
280
+
279
281
### AI-Assisted Contributions
280
282
281
283
Contributions using AI tools (Copilot, Claude, ChatGPT, etc.) are welcome, but the quality bar is the same as human-written code. **If you ship it, you own it.**
@@ -293,14 +295,32 @@ We've seen a sharp increase in AI-generated PRs where the contributor clearly ne
293
295
294
296
---
295
297
296
-
## Code Style
298
+
## Backend Conventions
299
+
300
+
- Use Spring Data JPA repository methods or JPQL. No native queries unless explicitly approved by a maintainer.
301
+
- Constructor injection via Lombok `@AllArgsConstructor`. No `@Autowired`.
302
+
- Logging via Lombok `@Slf4j`. No manual `LoggerFactory.getLogger(...)`.
303
+
- Throw errors via `ApiError` enum (`ApiError.SOME_ERROR.createException()`). No raw `RuntimeException`.
304
+
- Entities use `*Entity` suffix; DTOs drop it (e.g., `BookEntity` vs `Book`).
305
+
- Use MapStruct for entity-to-DTO mapping. No hand-written mapping code.
306
+
- Security: `@PreAuthorize("@securityUtil.isAdmin()")` or `@CheckBookAccess`. No `@Secured` or `@RolesAllowed`.
307
+
- Testing: JUnit 5 + Mockito + AssertJ. `@ExtendWith(MockitoExtension.class)` for unit tests, `@SpringBootTest` only for integration tests.
308
+
- Use modern Java features (records, sealed classes, pattern matching, text blocks, etc.).
309
+
- No fully qualified class names inline. Always use imports.
310
+
- Flyway migrations go in `booklore-api/src/main/resources/db/migration/` with naming `V<number>__<Description>.sql`.
311
+
- Never modify a released migration. Always create a new migration file for changes.
312
+
- Use idempotent guards in migrations (`CREATE TABLE IF NOT EXISTS`, `ADD COLUMN IF NOT EXISTS`, `DROP ... IF EXISTS` before re-creating).
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -212,7 +212,7 @@ volumes:
212
212
| 💬 **Come hang out** | [Discord Server](https://discord.gg/Ee5hd458Uz) |
213
213
214
214
> [!WARNING]
215
-
> **Before opening a PR:** Open an issue first and get maintainer approval. PRs without a linked issue, without screenshots/video proof, or without pasted test output will be closed. AI-assisted contributions are welcome, but you must run, test, and understand every line you submit. See the [Contributing Guide](CONTRIBUTING.md) for full details.
215
+
> **Before opening a PR:** Open an issue first and get maintainer approval. PRs without a linked issue, without screenshots/video proof, or without pasted test output will be closed. All code must follow project [backend](CONTRIBUTING.md#backend-conventions) and [frontend](CONTRIBUTING.md#frontend-conventions) conventions. AI-assisted contributions are welcome, but you must run, test, and understand every line you submit. See the [Contributing Guide](CONTRIBUTING.md) for full details.
0 commit comments