Studio-Zurich fix-app .cursorrules file for TypeScript

// General
Do not do these things without consulting me first:

- Add any new dependencies
- Change or add styles
- Change the file structure
- Change the database schema
- Remove parts of the code

Do only add components or steps that are already existing

More instructions are in project.md

// Import Order
Order imports based on the following:

- React
- Next.js
- Other libraries
- Components
- Types
- Utils

// Imports
Imports should be with base path or relative path but not ../ etc.

// Map Integration
use mapbox for map integration
use mapbox for autocomplete

// TypeScript and Data Validation
typescript strict mode required
use zod for data validation
error handling with zod and only on click so we need client and server validation

// State Management and Actions
use zustand for state management
use actions.ts for server actions

// Next.js App Router Structure and Patterns
use server components by default
implement client components only when necessary
utilize file-based routing system
use layout.tsx for shared layouts
implement loading.tsx for loading states
use error.tsx for error handling
utilize route handlers for API routes

// Folder Structure
follow turborepo structure
apps/app/ contains wizard application
apps/web/ for web application
packages/ui/ for shared components (@repo/ui/COMPONENT) NOT @repo/ui/ui/COMPONENT

// File Naming
files use lowercase with hyphens (example: location-step.tsx)
components use PascalCase (example: LocationStep)
steps components in components/steps/
shared UI components in packages/ui/

// Component Organization
group related step components under components/report/
keep configuration in lib/config.ts
maintain types in lib/types.ts
store state management in lib/store.ts

// Animations
use framer motion for animations

// Icons
use phosphor icons for icons

// Drawer
use vaul for drawers

// Translations
use next-intl for translations
when using the messages folder please have a consistent naming convention for the files
e.g. components are like "quickReportsComponent": {...} and pages are like "quickReportsPage": {...}
css
javascript
next.js
react
typescript
zustand

First Time Repository

TypeScript

Languages:

CSS: 1.5KB
JavaScript: 3.0KB
TypeScript: 152.3KB
Created: 12/2/2024
Updated: 1/9/2025

All Repositories (1)