create-bluecopa-react-app 1.0.4 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/README.md +47 -10
  2. package/bin/create-bluecopa-react-app.js +257 -51
  3. package/package.json +6 -5
  4. package/templates/latest/Agent.md +254 -0
  5. package/templates/latest/Dockerfile +22 -0
  6. package/templates/latest/README.md +157 -221
  7. package/templates/latest/app/app.css +134 -0
  8. package/templates/latest/app/app.tsx +46 -0
  9. package/templates/latest/app/components/app-sidebar.tsx +174 -0
  10. package/templates/latest/app/components/chart-area-interactive.tsx +290 -0
  11. package/templates/latest/app/components/data-table.tsx +807 -0
  12. package/templates/latest/app/components/nav-documents.tsx +92 -0
  13. package/templates/latest/app/components/nav-main.tsx +56 -0
  14. package/templates/latest/app/components/nav-secondary.tsx +42 -0
  15. package/templates/latest/app/components/nav-user.tsx +112 -0
  16. package/templates/latest/app/components/section-cards.tsx +102 -0
  17. package/templates/latest/app/components/site-header.tsx +19 -0
  18. package/templates/latest/app/components/ui/avatar.tsx +53 -0
  19. package/templates/latest/app/components/ui/badge.tsx +46 -0
  20. package/templates/latest/app/components/ui/breadcrumb.tsx +109 -0
  21. package/templates/latest/app/components/ui/button.tsx +58 -0
  22. package/templates/latest/app/components/ui/card.tsx +92 -0
  23. package/templates/latest/app/components/ui/chart.tsx +352 -0
  24. package/templates/latest/app/components/ui/checkbox.tsx +30 -0
  25. package/templates/latest/app/components/ui/drawer.tsx +139 -0
  26. package/templates/latest/app/components/ui/dropdown-menu.tsx +258 -0
  27. package/templates/latest/app/components/ui/input.tsx +21 -0
  28. package/templates/latest/app/components/ui/label.tsx +24 -0
  29. package/templates/latest/app/components/ui/select.tsx +183 -0
  30. package/templates/latest/app/components/ui/separator.tsx +26 -0
  31. package/templates/latest/app/components/ui/sheet.tsx +139 -0
  32. package/templates/latest/app/components/ui/sidebar.tsx +731 -0
  33. package/templates/latest/app/components/ui/skeleton.tsx +13 -0
  34. package/templates/latest/app/components/ui/sonner.tsx +23 -0
  35. package/templates/latest/app/components/ui/table.tsx +117 -0
  36. package/templates/latest/app/components/ui/tabs.tsx +66 -0
  37. package/templates/latest/app/components/ui/toggle-group.tsx +73 -0
  38. package/templates/latest/app/components/ui/toggle.tsx +47 -0
  39. package/templates/latest/app/components/ui/tooltip.tsx +59 -0
  40. package/templates/latest/app/dashboard/data.json +614 -0
  41. package/templates/latest/app/hooks/use-bluecopa-user.ts +37 -0
  42. package/templates/latest/app/hooks/use-mobile.ts +19 -0
  43. package/templates/latest/{src → app}/lib/utils.ts +1 -1
  44. package/templates/latest/app/main.tsx +12 -0
  45. package/templates/latest/app/routes/home.tsx +40 -0
  46. package/templates/latest/app/routes.tsx +15 -0
  47. package/templates/latest/{src → app}/single-spa.tsx +38 -28
  48. package/templates/latest/components.json +22 -0
  49. package/templates/latest/dist/assets/__federation_expose_App-DRwKKpS2.js +91 -0
  50. package/templates/latest/dist/assets/__federation_fn_import-CzfA7kmP.js +438 -0
  51. package/templates/latest/dist/assets/__federation_shared_react-Bp6HVBS4.js +16 -0
  52. package/templates/latest/dist/assets/__federation_shared_react-dom-BCcRGiYp.js +17 -0
  53. package/templates/latest/dist/assets/client-DgSav55y.js +12658 -0
  54. package/templates/latest/dist/assets/home-DOL6GrYV.js +54951 -0
  55. package/templates/latest/dist/assets/index-BzNimew1.js +69 -0
  56. package/templates/latest/dist/assets/index-DMFtQdNS.js +412 -0
  57. package/templates/latest/dist/assets/index-DdYpcDMk.js +60 -0
  58. package/templates/latest/dist/assets/remoteEntry.js +88 -0
  59. package/templates/latest/dist/assets/style-36A39bNN.css +3683 -0
  60. package/templates/latest/dist/avatars/shadcn.svg +6 -0
  61. package/templates/latest/dist/favicon.ico +0 -0
  62. package/templates/latest/dist/index.html +19 -0
  63. package/templates/latest/index.html +1 -1
  64. package/templates/latest/package-lock.json +1227 -3353
  65. package/templates/latest/package.json +47 -43
  66. package/templates/latest/pnpm-lock.yaml +4767 -0
  67. package/templates/latest/preview/index.html +32 -2
  68. package/templates/latest/public/avatars/shadcn.svg +6 -0
  69. package/templates/latest/public/favicon.ico +0 -0
  70. package/templates/latest/tsconfig.json +18 -11
  71. package/templates/latest/vite.config.ts +41 -41
  72. package/templates/latest/.env.example +0 -14
  73. package/templates/latest/.eslintrc.cjs +0 -42
  74. package/templates/latest/AGENT.md +0 -284
  75. package/templates/latest/clean.sh +0 -39
  76. package/templates/latest/postcss.config.cjs +0 -6
  77. package/templates/latest/public/bluecopa-logo.svg +0 -30
  78. package/templates/latest/public/favicon-32x32.png +0 -0
  79. package/templates/latest/public/favicon-96x96.png +0 -0
  80. package/templates/latest/setup.sh +0 -55
  81. package/templates/latest/src/App.tsx +0 -15
  82. package/templates/latest/src/components/layout/dashboard-header.tsx +0 -139
  83. package/templates/latest/src/components/layout/dashboard-layout.tsx +0 -29
  84. package/templates/latest/src/components/layout/sidebar.tsx +0 -54
  85. package/templates/latest/src/components/page/dashboard.tsx +0 -1506
  86. package/templates/latest/src/components/page/navbar.tsx +0 -104
  87. package/templates/latest/src/components/tables/data-grid.tsx +0 -439
  88. package/templates/latest/src/components/ui/alert.tsx +0 -59
  89. package/templates/latest/src/components/ui/avatar.tsx +0 -50
  90. package/templates/latest/src/components/ui/badge.tsx +0 -36
  91. package/templates/latest/src/components/ui/bluecopa-logo.tsx +0 -54
  92. package/templates/latest/src/components/ui/button.tsx +0 -58
  93. package/templates/latest/src/components/ui/card.tsx +0 -79
  94. package/templates/latest/src/components/ui/dropdown-menu.tsx +0 -200
  95. package/templates/latest/src/components/ui/input.tsx +0 -24
  96. package/templates/latest/src/components/ui/label.tsx +0 -23
  97. package/templates/latest/src/components/ui/select.tsx +0 -29
  98. package/templates/latest/src/hooks/use-api.ts +0 -55
  99. package/templates/latest/src/index.css +0 -59
  100. package/templates/latest/src/main.tsx +0 -13
  101. package/templates/latest/src/pages/Dashboard.tsx +0 -13
  102. package/templates/latest/src/pages/Home.tsx +0 -622
  103. package/templates/latest/src/providers/query-provider.tsx +0 -48
  104. package/templates/latest/src/types/api.ts +0 -78
  105. package/templates/latest/src/vite-env.d.ts +0 -11
  106. package/templates/latest/tailwind.config.js +0 -88
  107. package/templates/latest/tsconfig.app.json +0 -26
  108. package/templates/latest/tsconfig.node.json +0 -10
@@ -0,0 +1,254 @@
1
+ # AI Agent Guide for BlueCopa React shadcn/ui Template
2
+
3
+ This guide helps AI assistants and developers understand the project structure, patterns, and best practices for working with this BlueCopa React application template.
4
+
5
+ ## 🏗️ Project Architecture Overview
6
+
7
+ ### Core Stack
8
+ - **React 18** with TypeScript
9
+ - **React Router v7** with SSR support
10
+ - **shadcn/ui** components built on Radix UI
11
+ - **Tailwind CSS v4** with CSS variables
12
+ - **Vite 6** for build tooling
13
+ - **TanStack Query** (via @bluecopa/react)
14
+
15
+ ### Key Directories
16
+ ```
17
+ app/
18
+ ├── components/ # Reusable UI components
19
+ │ ├── ui/ # shadcn/ui components
20
+ │ ├── app-sidebar.tsx # Main navigation
21
+ │ ├── data-table.tsx # TanStack Table wrapper
22
+ │ └── chart-*.tsx # Recharts components
23
+ ├── hooks/ # Custom React hooks
24
+ ├── lib/ # Utilities and configurations
25
+ ├── routes/ # React Router pages
26
+ └── dashboard/ # Sample data and components
27
+ ```
28
+
29
+ ## 🎨 Component Patterns
30
+
31
+ ### shadcn/ui Components
32
+ All UI components follow shadcn/ui patterns:
33
+ - Located in `app/components/ui/`
34
+ - Built on Radix UI primitives
35
+ - Styled with Tailwind CSS
36
+ - Use `cn()` utility for class merging
37
+ - Support dark mode via CSS variables
38
+
39
+ ### Custom Components
40
+ - Use TypeScript interfaces for props
41
+ - Follow React best practices (hooks, memo, etc.)
42
+ - Implement proper accessibility
43
+ - Use semantic HTML elements
44
+
45
+ ### Example Component Structure
46
+ ```tsx
47
+ import { cn } from "~/lib/utils"
48
+
49
+ interface ComponentProps {
50
+ className?: string
51
+ children: React.ReactNode
52
+ }
53
+
54
+ export function Component({ className, children }: ComponentProps) {
55
+ return (
56
+ <div className={cn("base-styles", className)}>
57
+ {children}
58
+ </div>
59
+ )
60
+ }
61
+ ```
62
+
63
+ ## 🔧 Development Patterns
64
+
65
+ ### State Management
66
+ - Use React hooks (useState, useReducer, useContext)
67
+ - TanStack Query for server state
68
+ - Local state for UI interactions
69
+ - Avoid prop drilling with context
70
+
71
+ ### Data Fetching
72
+ - Use `@bluecopa/react` hooks for API calls
73
+ - Implement loading and error states
74
+ - Use TanStack Query for caching
75
+ - Handle optimistic updates
76
+
77
+ ### Styling Guidelines
78
+ - Use Tailwind CSS classes
79
+ - Leverage CSS variables for theming
80
+ - Follow mobile-first responsive design
81
+ - Use `cn()` utility for conditional classes
82
+
83
+ ## 📊 Data Visualization
84
+
85
+ ### Charts (Recharts)
86
+ - Interactive charts with hover states
87
+ - Responsive design
88
+ - Customizable colors via CSS variables
89
+ - Accessible with proper ARIA labels
90
+
91
+ ### Tables (TanStack Table)
92
+ - Sortable columns
93
+ - Filtering capabilities
94
+ - Pagination support
95
+ - Row selection
96
+ - Custom cell renderers
97
+
98
+ ## 🎯 Common Tasks & Solutions
99
+
100
+ ### Adding New Pages
101
+ 1. Create route file in `app/routes/`
102
+ 2. Export default component
103
+ 3. Add navigation link in sidebar
104
+ 4. Implement proper TypeScript types
105
+
106
+ ### Adding New Components
107
+ 1. Create component file in appropriate directory
108
+ 2. Define TypeScript interface for props
109
+ 3. Use shadcn/ui components as base
110
+ 4. Implement responsive design
111
+ 5. Add proper accessibility attributes
112
+
113
+ ### Working with Forms
114
+ 1. Use shadcn/ui form components
115
+ 2. Implement validation with Zod
116
+ 3. Handle form state with React hooks
117
+ 4. Show loading and error states
118
+ 5. Use proper form semantics
119
+
120
+ ### API Integration
121
+ 1. Use `@bluecopa/react` hooks
122
+ 2. Handle loading states
123
+ 3. Implement error boundaries
124
+ 4. Use TanStack Query for caching
125
+ 5. Add optimistic updates where appropriate
126
+
127
+ ## 🚀 Performance Optimization
128
+
129
+ ### Code Splitting
130
+ - Use React.lazy() for route-based splitting
131
+ - Implement proper loading states
132
+ - Avoid unnecessary re-renders
133
+
134
+ ### Bundle Optimization
135
+ - Use Vite's built-in optimizations
136
+ - Implement proper tree shaking
137
+ - Optimize images and assets
138
+
139
+ ### Runtime Performance
140
+ - Use React.memo() for expensive components
141
+ - Implement proper key props
142
+ - Avoid inline object/function creation
143
+
144
+ ## 🧪 Testing Strategies
145
+
146
+ ### Component Testing
147
+ - Test component behavior, not implementation
148
+ - Use React Testing Library
149
+ - Mock external dependencies
150
+ - Test accessibility features
151
+
152
+ ### Integration Testing
153
+ - Test user workflows
154
+ - Mock API responses
155
+ - Test error scenarios
156
+ - Verify responsive behavior
157
+
158
+ ## 🔒 Security Considerations
159
+
160
+ ### Data Handling
161
+ - Sanitize user inputs
162
+ - Validate data on client and server
163
+ - Use proper TypeScript types
164
+ - Implement proper error handling
165
+
166
+ ## 📱 Responsive Design
167
+
168
+ ### Breakpoints
169
+ - Mobile-first approach
170
+ - Use Tailwind's responsive prefixes
171
+ - Test on multiple devices
172
+ - Implement touch-friendly interactions
173
+
174
+ ### Layout Patterns
175
+ - Use CSS Grid and Flexbox
176
+ - Implement proper spacing
177
+ - Handle overflow scenarios
178
+ - Ensure proper scrolling
179
+
180
+ ## 🌙 Dark Mode Implementation
181
+
182
+ ### Theme System
183
+ - Use next-themes for theme switching
184
+ - Implement CSS variables for colors
185
+ - Test both light and dark modes
186
+ - Ensure proper contrast ratios
187
+
188
+ ### Component Theming
189
+ - Use semantic color tokens
190
+ - Implement proper hover states
191
+ - Test theme transitions
192
+ - Ensure accessibility compliance
193
+
194
+ ## 🐛 Debugging Tips
195
+
196
+ ### Common Issues
197
+ - Check TypeScript errors first
198
+ - Verify component imports
199
+ - Check Tailwind class names
200
+ - Validate API responses
201
+
202
+ ### Development Tools
203
+ - Use React DevTools
204
+ - Leverage Vite's HMR
205
+ - Check browser console
206
+ - Use TypeScript strict mode
207
+
208
+ ## 📚 Useful Resources
209
+
210
+ ### Documentation
211
+ - [React Router v7 Docs](https://reactrouter.com/)
212
+ - [shadcn/ui Components](https://ui.shadcn.com/)
213
+ - [Tailwind CSS v4](https://tailwindcss.com/)
214
+ - [TanStack Table](https://tanstack.com/table)
215
+ - [Recharts](https://recharts.org/)
216
+
217
+ ### BlueCopa Specific
218
+ - [@bluecopa/react Package](packages/react:1)
219
+ - BlueCopa Design System
220
+ - API Integration Patterns
221
+
222
+ ## 🎯 Best Practices Summary
223
+
224
+ 1. **Always use TypeScript** - Define proper interfaces and types
225
+ 2. **Follow shadcn/ui patterns** - Use established component structure
226
+ 3. **Implement accessibility** - Use semantic HTML and ARIA attributes
227
+ 4. **Optimize for performance** - Use proper React patterns and code splitting
228
+ 5. **Test thoroughly** - Write tests for components and user workflows
229
+ 6. **Handle errors gracefully** - Implement proper error boundaries and fallbacks
230
+ 7. **Follow responsive design** - Mobile-first approach with proper breakpoints
231
+ 8. **Use proper state management** - Choose appropriate patterns for different data types
232
+ 9. **Implement proper loading states** - Show feedback during async operations
233
+ 10. **Follow security best practices** - Validate inputs and secure API calls
234
+
235
+ ## 🔄 Common Workflows
236
+
237
+ ### Adding a New Feature
238
+ 1. Create feature branch
239
+ 2. Implement components with TypeScript
240
+ 3. Add proper styling with Tailwind
241
+ 4. Implement responsive design
242
+ 5. Add tests
243
+ 6. Update documentation
244
+ 7. Test in both light and dark modes
245
+
246
+ ### Debugging Issues
247
+ 1. Check browser console for errors
248
+ 2. Verify TypeScript compilation
249
+ 3. Test component isolation
250
+ 4. Check API responses
251
+ 5. Verify responsive behavior
252
+ 6. Test accessibility features
253
+
254
+ This guide should help AI assistants and developers work effectively with this BlueCopa React template, ensuring consistent patterns and best practices are followed throughout development.
@@ -0,0 +1,22 @@
1
+ FROM node:20-alpine AS development-dependencies-env
2
+ COPY . /app
3
+ WORKDIR /app
4
+ RUN npm ci
5
+
6
+ FROM node:20-alpine AS production-dependencies-env
7
+ COPY ./package.json package-lock.json /app/
8
+ WORKDIR /app
9
+ RUN npm ci --omit=dev
10
+
11
+ FROM node:20-alpine AS build-env
12
+ COPY . /app/
13
+ COPY --from=development-dependencies-env /app/node_modules /app/node_modules
14
+ WORKDIR /app
15
+ RUN npm run build
16
+
17
+ FROM node:20-alpine
18
+ COPY ./package.json package-lock.json /app/
19
+ COPY --from=production-dependencies-env /app/node_modules /app/node_modules
20
+ COPY --from=build-env /app/build /app/build
21
+ WORKDIR /app
22
+ CMD ["npm", "run", "start"]