Frontend Guidelines

This directory contains the development guidelines for the PermaplanT frontend.

For an overview of the frontend entry points and application startup, see Contributing to Frontend.

Reading Order

Read the guidelines in the following order. The specialized guidelines near the end only need to be read when working on the corresponding area.

  1. General Guidelines General conventions, navigation, accessibility, validation, naming, and frontend documentation.

  2. Architecture Feature-based organization, shared components, hooks, utilities, types, and the map component hierarchy.

  3. React Components, state management, hooks, effects, component purity, and memoization.

  4. Common Utilities Finding, creating, locating, documenting, and testing reusable utilities.

  5. API Calls TanStack Query, query keys, mutations, error handling, and scalable API organization.

  6. Zustand Store selectors, derived state, subscriptions, and performance considerations.

  7. Store Actions Organization and naming of actions in the map store.

  8. UI and Usability Text, colors, forms, icons, buttons, tooltips, wording, errors, z-index, and touchscreen behavior.

  9. General Responsiveness General responsive layouts, breakpoints, and usability requirements.

  10. Component Responsiveness Responsive behavior for the map toolbar, navbar, and timeline.

  11. CSS CSS units, Tailwind CSS, custom properties, CSS Modules, responsive styling, dark mode, and third-party styles.

  12. Keybindings Keyboard configuration, focused elements, global shortcuts, and Konva key handling.

  13. Locators Accessible and resilient locators for frontend and end-to-end tests.

  14. Error Handling Handling user-actionable, developer-caused, and cleanup-related image errors.

  15. Default Map View Map view rectangles, stored view state, resizing, and default-view behavior.

  16. Stored Map Information Persisted map-specific frontend state and migrations.

  17. Creating a New Layer End-to-end instructions for adding a new map layer.