- 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 KiB
2 KiB
| name | description |
|---|---|
| Create Component | Creates a new reusable component following ReloPortal component creation guidelines |
Skill: Create Component
1. Purpose
Standardizes frontend components layout, ensuring clean prop validation, BEM class styling, modular separation, and documentation.
2. When to Use
When implementing custom sliders, banners, modals, cards, or custom grids in the Storefront or Admin frontend apps.
3. Preconditions
- Components folder
src/components/must be accessible. - Ensure no primitive Shadcn UI or design layout satisfies the need before creating custom files.
4. Step-by-Step Checklist
- Check existing UI libraries to prevent duplication.
- Create directory
src/components/ComponentName/. - Create primary component file
ComponentName.tsxand barrel exporterindex.ts. - Define props interface using naming
{ComponentName}Propsand document non-obvious fields with JSDoc. - Destructure properties in the function signature.
- Style components using design token variables; avoid inline styling or raw hex codes.
- Export via barrel indexes.
5. Validation Checklist
- Component passes TypeScript compiler checks.
- Component is responsive and tested on desktop/mobile viewports.
- No hardcoded static pixel heights or color hex codes inside CSS/style attributes.
6. Examples
/**
* ProductBadge — Renders small promotional tags (e.g. HOT, SALE)
* Used in: ProductCard, ProductGrid
*/
import React from 'react';
interface ProductBadgeProps {
/** Label text displayed on the badge */
label: string;
}
export const ProductBadge: React.FC<ProductBadgeProps> = ({ label }: ProductBadgeProps) => {
return <span className="bg-primary text-white px-2 py-1 rounded text-xs font-bold">{label}</span>;
};
7. Failure Cases
- Creating large, non-modular files that mix state logic, network fetching, and visual display elements.
- Using inline
style={{ color: '#ff0000' }}which bypasses the standard CSS theme engines.