Rules Hub
Coding Rules Library
← Back to all rules
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
fullstack ruleP2project specificStack: Next.js
organizationstructureapi
Place API-related helpers in the api folder
Utilities whose job is server/API data fetching belong with the other API code, not in a generic utils root, so related code stays discoverable.
PR: vinify-frontend · org-mining-hist-2026-06Created: Jun 19, 2026
Bad example
Old codets
| 1 | // utils/wineListHelpers.ts |
| 2 | export const wineListGetServerSideProps = async () => { /* fetches API */ }; |
Explanation (EN)
Objašnjenje (HR)
Good example
New codets
| 1 | // utils/api/wineListHelpers.ts |
| 2 | export const wineListGetServerSideProps = async () => { /* fetches API */ }; |
Explanation (EN)
Objašnjenje (HR)