- Backend: FastAPI app with all models, services, schemas, routes - Admin Panel: Next.js dashboard with all modules (CRM, POS, repairs, warranties, billing, notifications, etc.) - Ecommerce: storefront (submodule) + product catalog - AI Agents: .agents/ skill library for Antigravity IDE - Docs: architecture, billing, notification gateway markdown - Submodules: Backend/OpenWA, Ecommerce/File 2/storefront
2.5 KiB
2.5 KiB
| description |
|---|
| Creates a new reusable component following ReloPortal component creation guidelines |
Create Reusable Component
This workflow creates a new reusable component in src/components/ following the ReloPortal component creation standards.
Steps
-
Verify component doesn't already exist
- Query Graphify:
uvx --from graphifyy graphify query "where is ComponentName used or similar components" - Search
src/components/for similar components - Check AntD components first - use AntD if it meets the need
- Only create if no existing reusable component or AntD alternative
- Query Graphify:
-
Determine component location
- Create folder:
src/components/ComponentName/ - Main file:
ComponentName.tsx - Index file:
index.ts(barrel export) - Optional:
ComponentName.scssif custom styles needed - Optional:
ComponentName.types.tsif complex types needed
- Create folder:
-
Create component file structure
ComponentName.tsx:
/** * Brief description of what this component renders and where it's used */ import React from "react"; interface ComponentNameProps { /** Prop description if not obvious */ someProp: string; } export const ComponentName: React.FC<ComponentNameProps> = ({ someProp, }: ComponentNameProps) => { return <div>{/* Component JSX */}</div>; };index.ts:
export { ComponentName } from "./ComponentName"; -
Add JSDoc comments
- Add JSDoc to the exported component describing what it renders
- Add JSDoc to non-obvious props in the interface
-
Style the component
- Check
src/styles/common.scssfor utility classes first - If utilities insufficient, create
ComponentName.scsswith BEM naming - Use colors from
src/styles/colors.scss- never hex codes - No inline
style={{}}with static values
- Check
-
Export through barrel
- Add to appropriate barrel export in
src/components/if needed - Import via
import { ComponentName } from "src/components/ComponentName"
- Add to appropriate barrel export in
Checklist
- Searched existing components and AntD first
- Used interface for props (named
{ComponentName}Props) - Added JSDoc to component and non-obvious props
- Destructured props in function signature
- Used utility classes from
common.scssbefore custom SCSS - All colors from
colors.scssvariables - No inline styles with static values
- Created
index.tsbarrel export - Functional component (no class components)