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.
- package/README.md +47 -10
- package/bin/create-bluecopa-react-app.js +257 -51
- package/package.json +6 -5
- package/templates/latest/Agent.md +254 -0
- package/templates/latest/Dockerfile +22 -0
- package/templates/latest/README.md +157 -221
- package/templates/latest/app/app.css +134 -0
- package/templates/latest/app/app.tsx +46 -0
- package/templates/latest/app/components/app-sidebar.tsx +174 -0
- package/templates/latest/app/components/chart-area-interactive.tsx +290 -0
- package/templates/latest/app/components/data-table.tsx +807 -0
- package/templates/latest/app/components/nav-documents.tsx +92 -0
- package/templates/latest/app/components/nav-main.tsx +56 -0
- package/templates/latest/app/components/nav-secondary.tsx +42 -0
- package/templates/latest/app/components/nav-user.tsx +112 -0
- package/templates/latest/app/components/section-cards.tsx +102 -0
- package/templates/latest/app/components/site-header.tsx +19 -0
- package/templates/latest/app/components/ui/avatar.tsx +53 -0
- package/templates/latest/app/components/ui/badge.tsx +46 -0
- package/templates/latest/app/components/ui/breadcrumb.tsx +109 -0
- package/templates/latest/app/components/ui/button.tsx +58 -0
- package/templates/latest/app/components/ui/card.tsx +92 -0
- package/templates/latest/app/components/ui/chart.tsx +352 -0
- package/templates/latest/app/components/ui/checkbox.tsx +30 -0
- package/templates/latest/app/components/ui/drawer.tsx +139 -0
- package/templates/latest/app/components/ui/dropdown-menu.tsx +258 -0
- package/templates/latest/app/components/ui/input.tsx +21 -0
- package/templates/latest/app/components/ui/label.tsx +24 -0
- package/templates/latest/app/components/ui/select.tsx +183 -0
- package/templates/latest/app/components/ui/separator.tsx +26 -0
- package/templates/latest/app/components/ui/sheet.tsx +139 -0
- package/templates/latest/app/components/ui/sidebar.tsx +731 -0
- package/templates/latest/app/components/ui/skeleton.tsx +13 -0
- package/templates/latest/app/components/ui/sonner.tsx +23 -0
- package/templates/latest/app/components/ui/table.tsx +117 -0
- package/templates/latest/app/components/ui/tabs.tsx +66 -0
- package/templates/latest/app/components/ui/toggle-group.tsx +73 -0
- package/templates/latest/app/components/ui/toggle.tsx +47 -0
- package/templates/latest/app/components/ui/tooltip.tsx +59 -0
- package/templates/latest/app/dashboard/data.json +614 -0
- package/templates/latest/app/hooks/use-bluecopa-user.ts +37 -0
- package/templates/latest/app/hooks/use-mobile.ts +19 -0
- package/templates/latest/{src → app}/lib/utils.ts +1 -1
- package/templates/latest/app/main.tsx +12 -0
- package/templates/latest/app/routes/home.tsx +40 -0
- package/templates/latest/app/routes.tsx +15 -0
- package/templates/latest/{src → app}/single-spa.tsx +38 -28
- package/templates/latest/components.json +22 -0
- package/templates/latest/dist/assets/__federation_expose_App-DRwKKpS2.js +91 -0
- package/templates/latest/dist/assets/__federation_fn_import-CzfA7kmP.js +438 -0
- package/templates/latest/dist/assets/__federation_shared_react-Bp6HVBS4.js +16 -0
- package/templates/latest/dist/assets/__federation_shared_react-dom-BCcRGiYp.js +17 -0
- package/templates/latest/dist/assets/client-DgSav55y.js +12658 -0
- package/templates/latest/dist/assets/home-DOL6GrYV.js +54951 -0
- package/templates/latest/dist/assets/index-BzNimew1.js +69 -0
- package/templates/latest/dist/assets/index-DMFtQdNS.js +412 -0
- package/templates/latest/dist/assets/index-DdYpcDMk.js +60 -0
- package/templates/latest/dist/assets/remoteEntry.js +88 -0
- package/templates/latest/dist/assets/style-36A39bNN.css +3683 -0
- package/templates/latest/dist/avatars/shadcn.svg +6 -0
- package/templates/latest/dist/favicon.ico +0 -0
- package/templates/latest/dist/index.html +19 -0
- package/templates/latest/index.html +1 -1
- package/templates/latest/package-lock.json +1227 -3353
- package/templates/latest/package.json +47 -43
- package/templates/latest/pnpm-lock.yaml +4767 -0
- package/templates/latest/preview/index.html +32 -2
- package/templates/latest/public/avatars/shadcn.svg +6 -0
- package/templates/latest/public/favicon.ico +0 -0
- package/templates/latest/tsconfig.json +18 -11
- package/templates/latest/vite.config.ts +41 -41
- package/templates/latest/.env.example +0 -14
- package/templates/latest/.eslintrc.cjs +0 -42
- package/templates/latest/AGENT.md +0 -284
- package/templates/latest/clean.sh +0 -39
- package/templates/latest/postcss.config.cjs +0 -6
- package/templates/latest/public/bluecopa-logo.svg +0 -30
- package/templates/latest/public/favicon-32x32.png +0 -0
- package/templates/latest/public/favicon-96x96.png +0 -0
- package/templates/latest/setup.sh +0 -55
- package/templates/latest/src/App.tsx +0 -15
- package/templates/latest/src/components/layout/dashboard-header.tsx +0 -139
- package/templates/latest/src/components/layout/dashboard-layout.tsx +0 -29
- package/templates/latest/src/components/layout/sidebar.tsx +0 -54
- package/templates/latest/src/components/page/dashboard.tsx +0 -1506
- package/templates/latest/src/components/page/navbar.tsx +0 -104
- package/templates/latest/src/components/tables/data-grid.tsx +0 -439
- package/templates/latest/src/components/ui/alert.tsx +0 -59
- package/templates/latest/src/components/ui/avatar.tsx +0 -50
- package/templates/latest/src/components/ui/badge.tsx +0 -36
- package/templates/latest/src/components/ui/bluecopa-logo.tsx +0 -54
- package/templates/latest/src/components/ui/button.tsx +0 -58
- package/templates/latest/src/components/ui/card.tsx +0 -79
- package/templates/latest/src/components/ui/dropdown-menu.tsx +0 -200
- package/templates/latest/src/components/ui/input.tsx +0 -24
- package/templates/latest/src/components/ui/label.tsx +0 -23
- package/templates/latest/src/components/ui/select.tsx +0 -29
- package/templates/latest/src/hooks/use-api.ts +0 -55
- package/templates/latest/src/index.css +0 -59
- package/templates/latest/src/main.tsx +0 -13
- package/templates/latest/src/pages/Dashboard.tsx +0 -13
- package/templates/latest/src/pages/Home.tsx +0 -622
- package/templates/latest/src/providers/query-provider.tsx +0 -48
- package/templates/latest/src/types/api.ts +0 -78
- package/templates/latest/src/vite-env.d.ts +0 -11
- package/templates/latest/tailwind.config.js +0 -88
- package/templates/latest/tsconfig.app.json +0 -26
- package/templates/latest/tsconfig.node.json +0 -10
|
@@ -1,263 +1,199 @@
|
|
|
1
|
-
# BlueCopa React App
|
|
1
|
+
# BlueCopa React App with shadcn/ui
|
|
2
2
|
|
|
3
|
-
A production-ready
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
24
|
+
## Getting Started
|
|
18
25
|
|
|
19
|
-
###
|
|
26
|
+
### Installation
|
|
27
|
+
|
|
28
|
+
Install the dependencies:
|
|
20
29
|
|
|
21
30
|
```bash
|
|
22
|
-
|
|
23
|
-
|
|
31
|
+
npm install
|
|
32
|
+
# or
|
|
33
|
+
pnpm install
|
|
34
|
+
```
|
|
24
35
|
|
|
25
|
-
|
|
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
|
-
|
|
29
|
-
npx create-bluecopa-react-app my-dashboard
|
|
30
|
-
```
|
|
38
|
+
## Quick Start
|
|
31
39
|
|
|
32
|
-
|
|
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
|
-
|
|
79
|
-
- **
|
|
80
|
-
- **
|
|
81
|
-
- **
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
135
|
-
|
|
136
|
-
|
|
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
|
-
|
|
140
|
-
|
|
141
|
-
|
|
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
|
-
|
|
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
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
115
|
+
## Building for Production
|
|
116
|
+
|
|
117
|
+
Create a production build:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
npm run build
|
|
183
121
|
```
|
|
184
122
|
|
|
185
|
-
##
|
|
123
|
+
## Deployment
|
|
186
124
|
|
|
187
|
-
|
|
125
|
+
### Docker Deployment
|
|
188
126
|
|
|
189
|
-
|
|
190
|
-
import { useUserData, useMetricDataDemo, useDatasetDataDemo } from '@/hooks/use-api'
|
|
127
|
+
To build and run using Docker:
|
|
191
128
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
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
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
-
|
|
209
|
-
-
|
|
210
|
-
-
|
|
211
|
-
-
|
|
212
|
-
|
|
213
|
-
###
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
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
|
-
##
|
|
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
|
-
|
|
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
|
-
|
|
176
|
+
## Styling
|
|
240
177
|
|
|
241
|
-
|
|
242
|
-
-
|
|
243
|
-
-
|
|
244
|
-
-
|
|
245
|
-
-
|
|
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
|
-
|
|
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
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
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
|
-
|
|
197
|
+
---
|
|
259
198
|
|
|
260
|
-
|
|
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
|
+
}
|