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
@@ -1,263 +1,199 @@
1
- # BlueCopa React App Template
1
+ # BlueCopa React App with shadcn/ui
2
2
 
3
- A production-ready React template with React Router for building modern BlueCopa dashboard applications with integrated React hooks, beautiful UI components, and comprehensive data visualization capabilities.
3
+ A modern, production-ready template for building full-stack React applications using React Router v7 and shadcn/ui components.
4
4
 
5
- ## 🎨 Design System
6
5
 
7
- This template now uses the latest Bluecopa design system with:
8
- - **Navy Blue Header**: Uses the official Bluecopa navy color (`#041e42`) for headers and navigation
9
- - **Modern Card Layout**: Clean, borderless cards with subtle shadows and consistent padding
10
- - **Consistent Spacing**: Improved spacing and layout following the latest app design system
11
- - **User Profile Integration**: Modern user dropdown with avatar, profile information, and logout
12
- - **Search & Notifications**: Built-in search bar and notification system with Radix UI
13
- - **Responsive Design**: Mobile-first approach with proper responsive breakpoints and device testing
6
+ ## Features
14
7
 
15
- ## 🚀 Quick Start
8
+ - 🚀 **React Router v7** - Latest React Router with server-side rendering
9
+ - ⚡️ **Hot Module Replacement (HMR)** - Lightning-fast development experience
10
+ - 📦 **Asset bundling and optimization** - Vite-powered build system
11
+ - 🔄 **Data loading and mutations** - Built-in data fetching patterns
12
+ - 🔒 **TypeScript by default** - Full type safety and developer experience
13
+ - 🎨 **shadcn/ui Components** - Beautiful, accessible UI components built on Radix UI
14
+ - 🎉 **TailwindCSS v4** - Latest Tailwind with CSS variables and modern features
15
+ - 📊 **Data Visualization** - Recharts integration for charts and analytics
16
+ - 🗂️ **Data Tables** - TanStack Table with sorting, filtering, and pagination
17
+ - 🎯 **Drag & Drop** - DND Kit integration for interactive interfaces
18
+ - 📱 **Responsive Design** - Mobile-first approach with sidebar navigation
19
+ - 🌙 **Dark Mode** - Built-in theme switching with next-themes
20
+ - 🔗 **BlueCopa API integration** - Pre-configured with `@bluecopa/react` hooks
21
+ - 📖 [React Router docs](https://reactrouter.com/)
22
+ - 🎨 [shadcn/ui docs](https://ui.shadcn.com/)
16
23
 
17
- > **Note**: This template is typically generated using the `create-bluecopa-react-app` CLI tool. If you're using this template directly, follow the manual setup instructions below.
24
+ ## Getting Started
18
25
 
19
- ### Using the CLI Tool (Recommended)
26
+ ### Installation
27
+
28
+ Install the dependencies:
20
29
 
21
30
  ```bash
22
- # Install globally
23
- npm install -g create-bluecopa-react-app
31
+ npm install
32
+ # or
33
+ pnpm install
34
+ ```
24
35
 
25
- # Create new app
26
- create-bluecopa-react-app my-dashboard
36
+ **Note:** The application includes TanStack Query integration through the `@bluecopa/react` package for data fetching and caching, along with shadcn/ui components for a modern UI experience.
27
37
 
28
- # Or use npx
29
- npx create-bluecopa-react-app my-dashboard
30
- ```
38
+ ## Quick Start
31
39
 
32
- ### Manual Setup
33
-
34
- ### Prerequisites
35
- - Node.js 18+
36
- - npm or pnpm
37
- - Access to Bluecopa workspace
38
-
39
-
40
- 2. **Install dependencies**:
41
- ```bash
42
- # Recommended: Use pnpm (consistent with monorepo)
43
- pnpm install
44
-
45
- # Alternative: Use npm
46
- npm install
47
- ```
48
-
49
- 3. **Set up environment variables**:
50
- ```bash
51
- # Automated setup (recommended)
52
- ./setup.sh
53
-
54
- # Manual setup
55
- cp .env.example .env.local
56
- # Edit .env.local with your Bluecopa credentials from dashboard -> Settings -> API Tokens
57
- ```
58
-
59
- 4. **Start development server**:
60
- ```bash
61
- npm run dev
62
- ```
63
-
64
- 5. **Open your browser**: Navigate to [http://localhost:3000](http://localhost:3000)
65
-
66
- ## ✨ Features
67
-
68
- ### 🎯 Core Capabilities
69
- - **React 18** with TypeScript
70
- - **React Router v6** for client-side routing
71
- - **Vite** for fast development and building
72
- - **@bluecopa/react** - Complete hook library for Bluecopa APIs
73
- - **TailwindCSS** - Utility-first CSS framework
74
- - **Radix UI** - Accessible component primitives
75
- - **Lucide React** - Beautiful icon library
76
- - **Recharts** - Composable charting library
40
+ This template is designed to work both as a standalone application and as a microfrontend within the BlueCopa ecosystem. It includes:
77
41
 
78
- ### 🏗️ Architecture
79
- - **Component-based** architecture with reusable UI components
80
- - **Custom hooks** for API integration and data management
81
- - **TypeScript** for type safety and better developer experience
82
- - **Responsive design** that works on all devices
83
- - **Modern React patterns** with functional components and hooks
84
-
85
- ### 📊 Bluecopa Integration
86
- - **Pre-configured hooks** for user data, metrics, and datasets
87
- - **Real-time data** fetching with TanStack Query
88
- - **Error handling** and loading states
89
- - **Authentication** integration
90
- - **Type-safe** API responses
91
-
92
- ### 🎨 UI Components
93
- - **Card layouts** for dashboard sections
94
- - **Data tables** for displaying datasets
95
- - **Charts and graphs** for data visualization
96
- - **Form components** with validation
97
- - **Navigation** components with routing
98
- - **Responsive grid** layouts
99
-
100
- ## 📁 Project Structure
42
+ - **Single-spa integration** for microfrontend architecture
43
+ - **Module federation** support for dynamic imports
44
+ - **BlueCopa API integration** with pre-configured hooks
45
+ - **Production-ready** Docker configuration
101
46
 
47
+ ### Development
48
+
49
+ Start the development server with HMR:
50
+
51
+ ```bash
52
+ npm run dev
102
53
  ```
103
- src/
104
- ├── components/ # Reusable components
105
- │ ├── layout/ # Layout components (dashboard-header.tsx, dashboard-layout.tsx, sidebar.tsx)
106
- │ ├── page/ # Page-specific components (dashboard.tsx, navbar.tsx)
107
- │ ├── tables/ # Table components (data-grid.tsx)
108
- │ └── ui/ # Base UI components (alert.tsx, avatar.tsx, badge.tsx, bluecopa-logo.tsx, button.tsx, card.tsx, dropdown-menu.tsx, input.tsx, label.tsx, select.tsx)
109
- ├── hooks/ # Custom React hooks
110
- │ └── use-api.ts # Bluecopa API hooks
111
- ├── lib/ # Utility functions
112
- │ └── utils.ts # Helper functions
113
- ├── pages/ # Route components
114
- │ ├── Home.tsx # Home page
115
- │ └── Dashboard.tsx # Dashboard page
116
- ├── providers/ # React context providers
117
- │ └── query-provider.tsx # TanStack Query provider
118
- ├── types/ # TypeScript type definitions
119
- │ └── api.ts # API type definitions
120
- ├── App.tsx # Main app component with routing
121
- ├── index.css # Global styles
122
- ├── main.tsx # Application entry point
123
- ├── single-spa.tsx # Single-spa configuration
124
- └── vite-env.d.ts # Vite environment types
125
- ```
126
54
 
127
- ## 🔧 Configuration
55
+ Your application will be available at `http://localhost:8080`.
56
+
57
+ ## UI Components
58
+
59
+ This template includes a comprehensive set of shadcn/ui components:
60
+
61
+ ### Layout Components
62
+ - **Sidebar** - Collapsible navigation sidebar with mobile support
63
+ - **Sheet** - Slide-out panels for mobile navigation
64
+ - **Drawer** - Bottom drawer for mobile interactions
65
+
66
+ ### Form Components
67
+ - **Button** - Multiple variants and sizes
68
+ - **Input** - Text input with validation states
69
+ - **Select** - Dropdown selection with search
70
+ - **Checkbox** - Checkbox with indeterminate state
71
+ - **Label** - Accessible form labels
72
+
73
+ ### Data Display
74
+ - **Table** - Sortable, filterable data tables with TanStack Table
75
+ - **Card** - Content containers with header, content, and footer
76
+ - **Badge** - Status indicators and labels
77
+ - **Avatar** - User profile images with fallbacks
78
+ - **Skeleton** - Loading placeholders
79
+
80
+ ### Navigation
81
+ - **Tabs** - Tabbed content organization
82
+ - **Breadcrumb** - Navigation breadcrumbs
83
+ - **Dropdown Menu** - Context menus and actions
84
+ - **Tooltip** - Hover information
85
+
86
+ ### Feedback
87
+ - **Sonner** - Toast notifications
88
+ - **Separator** - Visual content dividers
89
+
90
+ ### Charts
91
+ - **Interactive Charts** - Recharts integration with hover states
92
+ - **Area Charts** - Time series data visualization
93
+
94
+ ### Bluecopa API Configuration
95
+
96
+ This application integrates with the Bluecopa API using the `@bluecopa/react` package. To use the `useUser` hook for displaying logged-in user information, set up the following environment variables:
128
97
 
129
- ### Environment Variables
130
- Create a `.env.local` file in the root directory:
98
+ Create a `.env` file in the root directory:
131
99
 
132
100
  ```bash
133
101
  # Bluecopa API Configuration
134
- VITE_BLUECOPA_API_TOKEN=your-bluecopa-api-token
135
- VITE_BLUECOPA_API_URL=https://develop.bluecopa.com/api/v1
136
- VITE_BLUECOPA_WORKSPACE_ID=your-workspace-id
102
+ VITE_BLUECOPA_API_URL=https://develop.bluecopa.com
103
+ VITE_BLUECOPA_WORKSPACE_ID=your_workspace_id_here
104
+ VITE_BLUECOPA_API_TOKEN=your_base64_encoded_token_here
137
105
  ```
138
106
 
139
- ### Getting Your Credentials
140
- 1. Log in to your Bluecopa workspace
141
- 2. Navigate to Settings > API Keys
142
- 3. Generate or copy your API token
143
- 4. Note your workspace ID from the URL or settings
144
-
145
- ## 🛠️ Development
146
-
147
- ### Available Scripts
148
- - `npm run dev` - Start development server
149
- - `npm run build` - Build for production
150
- - `npm run preview` - Preview production build
151
- - `npm run lint` - Run ESLint
152
- - `npm run type-check` - Run TypeScript compiler
153
-
154
- ### Adding New Routes
155
- Add new routes in `src/App.tsx`:
156
-
157
- ```tsx
158
- import { Routes, Route } from 'react-router-dom'
159
- import NewPage from '@/pages/NewPage'
160
-
161
- export default function App() {
162
- return (
163
- <QueryProvider>
164
- <Routes>
165
- <Route path="/" element={<Home />} />
166
- <Route path="/dashboard" element={<Dashboard />} />
167
- <Route path="/new-page" element={<NewPage />} />
168
- </Routes>
169
- </QueryProvider>
170
- )
171
- }
107
+ **Note:** `VITE_BLUECOPA_API_TOKEN` should be a base64-encoded JSON string containing an `accessToken` field, for example:
108
+ ```json
109
+ {"accessToken": "your_access_token_here"}
172
110
  ```
111
+ encoded as base64.
173
112
 
174
- ### Adding Navigation Links
175
- Update the navigation in `src/components/page/navbar.tsx`:
113
+ If the API errors out or is not configured, the application will show "Set Environment" as the user name with email "setenv@email.com" as a fallback.
176
114
 
177
- ```tsx
178
- const navigation = [
179
- { name: 'Home', href: '/', icon: Home },
180
- { name: 'Dashboard Overview', href: '/dashboard', icon: LayoutDashboard },
181
- { name: 'New Page', href: '/new-page', icon: Settings },
182
- ]
115
+ ## Building for Production
116
+
117
+ Create a production build:
118
+
119
+ ```bash
120
+ npm run build
183
121
  ```
184
122
 
185
- ## 📚 API Integration
123
+ ## Deployment
186
124
 
187
- This template includes pre-configured hooks for common Bluecopa API operations:
125
+ ### Docker Deployment
188
126
 
189
- ```tsx
190
- import { useUserData, useMetricDataDemo, useDatasetDataDemo } from '@/hooks/use-api'
127
+ To build and run using Docker:
191
128
 
192
- function MyComponent() {
193
- const { data: userData, isLoading, error } = useUserData()
194
- const { data: metrics } = useMetricDataDemo()
195
- const { data: datasets } = useDatasetDataDemo()
196
-
197
- if (isLoading) return <div>Loading...</div>
198
- if (error) return <div>Error: {error.message}</div>
199
-
200
- return <div>Welcome, {userData?.user?.firstName}!</div>
201
- }
129
+ ```bash
130
+ docker build -t my-app .
131
+
132
+ # Run the container
133
+ docker run -p 3000:3000 my-app
202
134
  ```
203
135
 
204
- ## 🎨 Styling
205
-
206
- The template uses TailwindCSS for styling with a custom design system:
207
-
208
- - **Color palette**: Bluecopa brand colors
209
- - **Typography**: Inter font family
210
- - **Spacing**: Consistent spacing scale
211
- - **Components**: Pre-built component styles
212
-
213
- ### Customizing Colors
214
- Edit `tailwind.config.js` to modify the color scheme:
215
-
216
- ```js
217
- module.exports = {
218
- theme: {
219
- extend: {
220
- colors: {
221
- bluecopa: {
222
- 50: '#eff6ff',
223
- // ... other shades
224
- 900: '#1e3a8a',
225
- },
226
- },
227
- },
228
- },
229
- }
136
+ The containerized application can be deployed to any platform that supports Docker, including:
137
+
138
+ - AWS ECS
139
+ - Google Cloud Run
140
+ - Azure Container Apps
141
+ - Digital Ocean App Platform
142
+ - Fly.io
143
+ - Railway
144
+
145
+ ### DIY Deployment
146
+
147
+ If you're familiar with deploying Node applications, the built-in app server is production-ready.
148
+
149
+ Make sure to deploy the output of `npm run build`
150
+
151
+ ```
152
+ ├── package.json
153
+ ├── package-lock.json (or pnpm-lock.yaml, or bun.lockb)
154
+ ├── build/
155
+ │ ├── client/ # Static assets
156
+ │ └── server/ # Server-side code
230
157
  ```
231
158
 
232
- ## 🚀 Deployment & Production
159
+ ## Adding More Components
160
+
161
+ This template uses shadcn/ui CLI for adding new components. To add additional components:
233
162
 
234
- ### Build for Production
235
163
  ```bash
236
- npm run build
164
+ # Install shadcn/ui CLI globally
165
+ npm install -g shadcn-ui@latest
166
+
167
+ # Add components
168
+ npx shadcn-ui@latest add [component-name]
169
+
170
+ # Examples
171
+ npx shadcn-ui@latest add dialog
172
+ npx shadcn-ui@latest add alert
173
+ npx shadcn-ui@latest add toast
237
174
  ```
238
175
 
239
- The production-ready files will be output to the `dist/` directory with optimized bundling and minification.
176
+ ## Styling
240
177
 
241
- ### Production Best Practices
242
- - Validate environment variables before building
243
- - Test workflow triggers in staging environment
244
- - Monitor bundle size with `npm run build --report`
245
- - Use version control for deployment artifacts
178
+ This template comes with [Tailwind CSS v4](https://tailwindcss.com/) configured with:
179
+ - CSS variables for theming
180
+ - Dark mode support with next-themes
181
+ - shadcn/ui design system
182
+ - Custom BlueCopa color palette
183
+ - Responsive design utilities
246
184
 
247
- ### Deploy to Vercel
248
- 1. Push your code to GitHub
249
- 2. Connect your repository to Vercel
250
- 3. Set environment variables in Vercel dashboard
251
- 4. Deploy
185
+ ## Key Technologies
252
186
 
253
- ### Deploy to Netlify
254
- 1. Build the project locally
255
- 2. Upload the `dist/` folder to Netlify
256
- 3. Set environment variables in Netlify dashboard
187
+ - **React 18** - Latest React with concurrent features
188
+ - **React Router v7** - Modern routing with SSR support
189
+ - **shadcn/ui** - Accessible component library built on Radix UI
190
+ - **Tailwind CSS v4** - Utility-first CSS framework
191
+ - **TanStack Table** - Headless table library for React
192
+ - **Recharts** - Composable charting library
193
+ - **DND Kit** - Drag and drop toolkit
194
+ - **Lucide React** - Beautiful icon library
195
+ - **TypeScript** - Type safety and developer experience
257
196
 
258
- ## 🔒 Environment Security
197
+ ---
259
198
 
260
- - Never commit `.env.local` files
261
- - Use environment variables for all sensitive data
262
- - Rotate API tokens regularly
263
- - Use different tokens for development and production
199
+ Built with ❤️ using React Router v7 and shadcn/ui.
@@ -0,0 +1,134 @@
1
+ @import "tailwindcss";
2
+ @import "tw-animate-css";
3
+
4
+ @custom-variant dark (&:is(.dark *));
5
+
6
+ @theme {
7
+ --font-sans: "Inter", ui-sans-serif, system-ui, sans-serif,
8
+ "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
9
+ }
10
+
11
+ html,
12
+ body {
13
+ @apply bg-white dark:bg-gray-950;
14
+
15
+ @media (prefers-color-scheme: dark) {
16
+ color-scheme: dark;
17
+ }
18
+ }
19
+
20
+ @theme inline {
21
+ --radius-sm: calc(var(--radius) - 4px);
22
+ --radius-md: calc(var(--radius) - 2px);
23
+ --radius-lg: var(--radius);
24
+ --radius-xl: calc(var(--radius) + 4px);
25
+ --color-background: var(--background);
26
+ --color-foreground: var(--foreground);
27
+ --color-card: var(--card);
28
+ --color-card-foreground: var(--card-foreground);
29
+ --color-popover: var(--popover);
30
+ --color-popover-foreground: var(--popover-foreground);
31
+ --color-primary: var(--primary);
32
+ --color-primary-foreground: var(--primary-foreground);
33
+ --color-secondary: var(--secondary);
34
+ --color-secondary-foreground: var(--secondary-foreground);
35
+ --color-muted: var(--muted);
36
+ --color-muted-foreground: var(--muted-foreground);
37
+ --color-accent: var(--accent);
38
+ --color-accent-foreground: var(--accent-foreground);
39
+ --color-destructive: var(--destructive);
40
+ --color-border: var(--border);
41
+ --color-input: var(--input);
42
+ --color-ring: var(--ring);
43
+ --color-chart-1: var(--chart-1);
44
+ --color-chart-2: var(--chart-2);
45
+ --color-chart-3: var(--chart-3);
46
+ --color-chart-4: var(--chart-4);
47
+ --color-chart-5: var(--chart-5);
48
+ --color-sidebar: var(--sidebar);
49
+ --color-sidebar-foreground: var(--sidebar-foreground);
50
+ --color-sidebar-primary: var(--sidebar-primary);
51
+ --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
52
+ --color-sidebar-accent: var(--sidebar-accent);
53
+ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
54
+ --color-sidebar-border: var(--sidebar-border);
55
+ --color-sidebar-ring: var(--sidebar-ring);
56
+ }
57
+
58
+ :root {
59
+ --radius: 0.65rem;
60
+ --background: oklch(1 0 0);
61
+ --foreground: oklch(0.141 0.005 285.823);
62
+ --card: oklch(1 0 0);
63
+ --card-foreground: oklch(0.141 0.005 285.823);
64
+ --popover: oklch(1 0 0);
65
+ --popover-foreground: oklch(0.141 0.005 285.823);
66
+ --primary: oklch(0.623 0.214 259.815);
67
+ --primary-foreground: oklch(0.97 0.014 254.604);
68
+ --secondary: oklch(0.967 0.001 286.375);
69
+ --secondary-foreground: oklch(0.21 0.006 285.885);
70
+ --muted: oklch(0.967 0.001 286.375);
71
+ --muted-foreground: oklch(0.552 0.016 285.938);
72
+ --accent: oklch(0.967 0.001 286.375);
73
+ --accent-foreground: oklch(0.21 0.006 285.885);
74
+ --destructive: oklch(0.577 0.245 27.325);
75
+ --border: oklch(0.92 0.004 286.32);
76
+ --input: oklch(0.92 0.004 286.32);
77
+ --ring: oklch(0.623 0.214 259.815);
78
+ --chart-1: oklch(0.646 0.222 41.116);
79
+ --chart-2: oklch(0.6 0.118 184.704);
80
+ --chart-3: oklch(0.398 0.07 227.392);
81
+ --chart-4: oklch(0.828 0.189 84.429);
82
+ --chart-5: oklch(0.769 0.188 70.08);
83
+ --sidebar: oklch(0.985 0 0);
84
+ --sidebar-foreground: oklch(0.141 0.005 285.823);
85
+ --sidebar-primary: oklch(0.623 0.214 259.815);
86
+ --sidebar-primary-foreground: oklch(0.97 0.014 254.604);
87
+ --sidebar-accent: oklch(0.967 0.001 286.375);
88
+ --sidebar-accent-foreground: oklch(0.21 0.006 285.885);
89
+ --sidebar-border: oklch(0.92 0.004 286.32);
90
+ --sidebar-ring: oklch(0.623 0.214 259.815);
91
+ }
92
+
93
+ .dark {
94
+ --background: oklch(0.141 0.005 285.823);
95
+ --foreground: oklch(0.985 0 0);
96
+ --card: oklch(0.21 0.006 285.885);
97
+ --card-foreground: oklch(0.985 0 0);
98
+ --popover: oklch(0.21 0.006 285.885);
99
+ --popover-foreground: oklch(0.985 0 0);
100
+ --primary: oklch(0.546 0.245 262.881);
101
+ --primary-foreground: oklch(0.379 0.146 265.522);
102
+ --secondary: oklch(0.274 0.006 286.033);
103
+ --secondary-foreground: oklch(0.985 0 0);
104
+ --muted: oklch(0.274 0.006 286.033);
105
+ --muted-foreground: oklch(0.705 0.015 286.067);
106
+ --accent: oklch(0.274 0.006 286.033);
107
+ --accent-foreground: oklch(0.985 0 0);
108
+ --destructive: oklch(0.704 0.191 22.216);
109
+ --border: oklch(1 0 0 / 10%);
110
+ --input: oklch(1 0 0 / 15%);
111
+ --ring: oklch(0.488 0.243 264.376);
112
+ --chart-1: oklch(0.488 0.243 264.376);
113
+ --chart-2: oklch(0.696 0.17 162.48);
114
+ --chart-3: oklch(0.769 0.188 70.08);
115
+ --chart-4: oklch(0.627 0.265 303.9);
116
+ --chart-5: oklch(0.645 0.246 16.439);
117
+ --sidebar: oklch(0.21 0.006 285.885);
118
+ --sidebar-foreground: oklch(0.985 0 0);
119
+ --sidebar-primary: oklch(0.546 0.245 262.881);
120
+ --sidebar-primary-foreground: oklch(0.379 0.146 265.522);
121
+ --sidebar-accent: oklch(0.274 0.006 286.033);
122
+ --sidebar-accent-foreground: oklch(0.985 0 0);
123
+ --sidebar-border: oklch(1 0 0 / 10%);
124
+ --sidebar-ring: oklch(0.488 0.243 264.376);
125
+ }
126
+
127
+ @layer base {
128
+ * {
129
+ @apply border-border outline-ring/50;
130
+ }
131
+ body {
132
+ @apply bg-background text-foreground;
133
+ }
134
+ }
@@ -0,0 +1,46 @@
1
+ import { Suspense, useEffect, useState } from 'react'
2
+ import { reactQuery, ReactQueryDevtools, copaSetConfig } from "@bluecopa/react";
3
+ import RouteConfig from './routes';
4
+
5
+ import './app.css'
6
+
7
+ const { QueryClient, QueryClientProvider } = reactQuery;
8
+
9
+ export default function App() {
10
+ const [queryClient] = useState(() => new QueryClient({
11
+ defaultOptions: {
12
+ queries: {
13
+ staleTime: 60 * 1000, // 1 minute
14
+ refetchOnWindowFocus: false,
15
+ },
16
+ },
17
+ }));
18
+
19
+ useEffect(() => {
20
+ // Configure Bluecopa API
21
+ let copaUser = {} as any;
22
+ try {
23
+ const copaToken = import.meta.env.VITE_BLUECOPA_API_TOKEN
24
+ ? atob(import.meta.env.VITE_BLUECOPA_API_TOKEN)
25
+ : '{}';
26
+ copaUser = JSON.parse(copaToken);
27
+ } catch (error) {
28
+ console.warn('Failed to parse VITE_BLUECOPA_API_TOKEN:', error);
29
+ }
30
+
31
+ copaSetConfig({
32
+ apiBaseUrl: import.meta.env.VITE_BLUECOPA_API_URL || 'https://develop.bluecopa.com',
33
+ workspaceId: import.meta.env.VITE_BLUECOPA_WORKSPACE_ID || '',
34
+ accessToken: copaUser?.accessToken || '',
35
+ });
36
+ }, []);
37
+
38
+ return (
39
+ <QueryClientProvider client={queryClient}>
40
+ <Suspense fallback={<div className="p-4 text-sm text-muted-foreground">Loading…</div>}>
41
+ <RouteConfig />
42
+ <ReactQueryDevtools initialIsOpen={false} />
43
+ </Suspense>
44
+ </QueryClientProvider>
45
+ )
46
+ }