Coding conventions and architectural patterns for the Leverage Dashboard project
This skill provides context about the project's coding standards and architectural decisions. Claude will use this knowledge automatically when working on the codebase.
src/
├── components/ # React components organized by feature
│ ├── dashboard/ # Portfolio stats, overview widgets
│ ├── positions/ # Position cards, position list
│ ├── alerts/ # Alert banners, notifications
│ └── charts/ # Chart components
├── lib/ # Utility functions, helpers
├── hooks/ # Custom React hooks
├── types/ # TypeScript type definitions
├── services/ # API integrations, data services
└── App.tsx # Main application component
src/types/index.ts{ComponentName}Propscn() utility from lib/utils.ts for conditional classesclassName={cn("base-classes", condition && "conditional-classes")}import { } from 'react';
import { } from '../types';
import { } from '../lib/utils';
import { } from 'lucide-react';
interface ComponentProps {
// props definition
}
export function Component({ prop1, prop2 }: ComponentProps) {
// hooks
// derived state
// handlers
return (
// JSX
);
}
// Helper components (if any)
function HelperComponent() {}
PositionCard, AlertBanner)PositionCard.tsx)formatCurrency, calculateRiskLevel)Position, Alert, RiskLevel)API_BASE_URL)entryPrice * (1 - 0.9 / leverage)entryPrice * (1 + 0.9 / leverage)(currentPrice - entryPrice) * size * (side === 'LONG' ? 1 : -1)(unrealizedPnL / collateral) * 100|currentPrice - liquidationPrice| / currentPriceservices/mockData.ts).env is in .gitignore