Files
myeasycms-v2/AGENTS.md
Giancarlo Buomprisco 533dfba5b9 Optimized agents rules subfolders, dependencies updates (#355)
* Update AGENTS.md and CLAUDE.md for improved clarity and structure
* Added MCP Server
* Added missing triggers to tables that should have used them
* Updated all dependencies
* Fixed rare bug in React present in the Admin layout which prevents navigating to pages (sometimes...)
2025-09-17 11:36:02 +08:00

2.0 KiB

This file provides guidance to Claude Code when working with code in this repository.

Core Technologies

  • Next.js 15 with App Router
  • Supabase for database, auth, and storage
  • React 19
  • TypeScript
  • Tailwind CSS 4 and Shadcn UI
  • Turborepo

Monorepo Structure

  • apps/web - Main Next.js SaaS application
  • apps/e2e - Playwright end-to-end tests
  • packages/features/* - Feature packages
  • packages/ - Shared packages and utilities
  • tooling/ - Build tools and development scripts

Multi-Tenant Architecture

Personal Accounts: Individual user accounts (auth.users.id = accounts.id) Team Accounts: Shared workspaces with members, roles, and permissions

Data associates with accounts via foreign keys for proper access control.

Essential Commands

Development Workflow

pnpm dev                    # Start all apps
pnpm --filter web dev       # Main app (port 3000)

Database Operations

pnpm supabase:web:start     # Start Supabase locally
pnpm supabase:web:reset     # Reset with latest schema
pnpm supabase:web:typegen   # Generate TypeScript types
pnpm --filter web supabase:db:diff  # Create migration

Code Quality

pnpm format:fix 
pnpm lint:fix
pnpm typecheck
  • Run the typecheck command regularly to ensure your code is type-safe.
  • Run the linter and the formatter when your task is complete.

Typescript

  • Write clean, clear, well-designed, explicit TypeScript
  • Avoid obvious comments
  • Avoid unnecessary complexity or overly abstract code
  • Always use implicit type inference, unless impossible
  • You must avoid using any
  • Handle errors gracefully using try/catch and appropriate error types

React

  • Use functional components
  • Always use 'use client' directive for client components
  • Add data-test for E2E tests where appropriate
  • useEffect is a code smell and must be justified - avoid if possible
  • Do not write many separate useState, prefer single state object (unless required)
  • Prefer server-side data fetching using RSC