2.7 KiB
2.7 KiB
Ledgerrz Project Instructions & Conventions
Welcome to the Ledgerrz codebase! This file defines the persistent guidelines, architectural rules, and context directories loaded in every Gemini session.
1. Context Persistence Mandate
- Business Logic & Goals (
IDEA.md): You MUST read and follow the application concept, features, and user workflow goals outlined inIDEA.mdat the start of any new session. - Design & Architecture Decisions (
DECISIONS.md): You MUST strictly adhere to the established style architecture (BEM methodology with scoped styles and@apply), package deduplication rules, and controller structures documented inDECISIONS.md. Update this file with any new major design decisions made during your session.
2. Key Technology Stack & Conventions
- PHP/Laravel: PHP 8.4 & Laravel 13. Adhere to typed parameters and return values. Ensure controllers extend properly and use required authorization traits (e.g.,
AuthorizesRequests). - Frontend Styling (BEM): Replaced direct Tailwind inline utility-class markup with BEM (Block, Element, Modifier). All custom component styles must live inside
<style scoped>blocks with a relative@reference "../../css/app.css"directive to pull variables without duplications. - Real-time Broadcasting: Powered by
@laravel/echo-vuewith fallback configurations and Vite deduplication rules configured invite.config.ts. - Testing & Isolation: Powered by Pest PHP (v4). Every backend controller, event, or model change must be validated by running tests. To prevent local
.envvariables from polluting the CLI test execution (causing CSRF/session 419 errors), always run tests in an isolated environment using:env -i PATH="$PATH" php artisan test - Standardized Authorization (
canprop): Never write manual role checks (such aspivot.role === 'owner') or hardcoded boolean flags (such asisOwner) inside Vue pages or components. Instead, always leverage Laravel policies on the backend and pass permissions reactively to the frontend as structuredcanobjects (e.g.,can: { update: boolean, close: boolean }). - Vue-Defined Breadcrumbs Layout: All page-specific breadcrumbs should be declared locally inside the page's
.vuefile rather than returned from controllers. For dynamic, prop-dependent paths, always use the Inertia v3 layout callback function insidedefineOptions:defineOptions({ layout: (props: any) => ({ breadcrumbs: [ { title: 'Dynamics', href: route('dynamics.index') }, { title: props.dynamic.name, href: route('dynamics.show', props.dynamic.id) } ] }) });