create-bluecopa-react-app 1.0.0 → 1.0.1
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 +69 -28
- package/bin/create-bluecopa-react-app.js +1 -1
- package/package.json +1 -1
- package/templates/latest/.env.example +14 -0
- package/templates/latest/.eslintrc.cjs +42 -0
- package/templates/latest/README.md +264 -0
- package/templates/latest/clean.sh +39 -0
- package/templates/latest/index.html +14 -0
- package/templates/{basic → latest}/package-lock.json +1099 -1084
- package/templates/latest/package.json +61 -0
- package/templates/{basic/postcss.config.js → latest/postcss.config.cjs} +1 -1
- package/templates/latest/public/bluecopa-logo.svg +30 -0
- package/templates/latest/public/favicon-32x32.png +0 -0
- package/templates/latest/public/favicon-96x96.png +0 -0
- package/templates/latest/public/favicon.ico +0 -0
- package/templates/latest/setup.sh +55 -0
- package/templates/latest/src/App.tsx +15 -0
- package/templates/latest/src/components/layout/dashboard-header.tsx +139 -0
- package/templates/latest/src/components/layout/dashboard-layout.tsx +29 -0
- package/templates/latest/src/components/layout/sidebar.tsx +54 -0
- package/templates/latest/src/components/page/dashboard.tsx +1506 -0
- package/templates/latest/src/components/page/navbar.tsx +104 -0
- package/templates/latest/src/components/tables/data-grid.tsx +439 -0
- package/templates/latest/src/components/ui/alert.tsx +59 -0
- package/templates/latest/src/components/ui/avatar.tsx +50 -0
- package/templates/latest/src/components/ui/badge.tsx +36 -0
- package/templates/latest/src/components/ui/bluecopa-logo.tsx +54 -0
- package/templates/{basic → latest}/src/components/ui/button.tsx +5 -11
- package/templates/latest/src/components/ui/dropdown-menu.tsx +200 -0
- package/templates/latest/src/components/ui/input.tsx +24 -0
- package/templates/latest/src/components/ui/label.tsx +23 -0
- package/templates/latest/src/components/ui/select.tsx +29 -0
- package/templates/latest/src/hooks/use-api.ts +55 -0
- package/templates/{basic → latest}/src/index.css +1 -1
- package/templates/{basic → latest}/src/main.tsx +6 -2
- package/templates/latest/src/pages/Dashboard.tsx +13 -0
- package/templates/latest/src/pages/Home.tsx +622 -0
- package/templates/latest/src/providers/query-provider.tsx +48 -0
- package/templates/latest/src/single-spa.tsx +105 -0
- package/templates/{basic/src/types/index.ts → latest/src/types/api.ts} +19 -35
- package/templates/latest/src/vite-env.d.ts +11 -0
- package/templates/{basic → latest}/tailwind.config.js +15 -4
- package/templates/{basic/tsconfig.json → latest/tsconfig.app.json} +5 -10
- package/templates/latest/tsconfig.json +19 -0
- package/templates/latest/vite.config.ts +64 -0
- package/templates/basic/.editorconfig +0 -12
- package/templates/basic/.env.example +0 -10
- package/templates/basic/README.md +0 -213
- package/templates/basic/index.html +0 -13
- package/templates/basic/package.json +0 -68
- package/templates/basic/setup.sh +0 -46
- package/templates/basic/src/App.tsx +0 -95
- package/templates/basic/src/components/dashboard/AdvancedAnalytics.tsx +0 -351
- package/templates/basic/src/components/dashboard/MetricsOverview.tsx +0 -150
- package/templates/basic/src/components/dashboard/TransactionCharts.tsx +0 -215
- package/templates/basic/src/components/dashboard/TransactionTable.tsx +0 -172
- package/templates/basic/src/components/ui/tabs.tsx +0 -53
- package/templates/basic/src/pages/Dashboard.tsx +0 -135
- package/templates/basic/vite.config.ts +0 -13
- /package/templates/{basic → latest}/src/components/ui/card.tsx +0 -0
- /package/templates/{basic → latest}/src/lib/utils.ts +0 -0
- /package/templates/{basic → latest}/tsconfig.node.json +0 -0
package/README.md
CHANGED
|
@@ -4,13 +4,13 @@ A CLI tool to bootstrap modern React applications for BlueCopa with built-in UI
|
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
|
-
- 🚀 **Modern React Stack**: React 18, TypeScript,
|
|
8
|
-
- 📊 **Data Visualization**:
|
|
9
|
-
- 🎨 **UI Components**:
|
|
7
|
+
- 🚀 **Modern React Stack**: React 18, TypeScript, Next.js 14
|
|
8
|
+
- 📊 **Data Visualization**: Recharts integration for charts and analytics
|
|
9
|
+
- 🎨 **UI Components**: Radix UI primitives with custom styling
|
|
10
10
|
- 📡 **BlueCopa React Components**: Pre-configured @bluecopa/react package
|
|
11
11
|
- 🎯 **Type Safety**: Full TypeScript support
|
|
12
12
|
- 📱 **Responsive Design**: Tailwind CSS with mobile-first approach
|
|
13
|
-
- 🛠️ **Development Tools**: ESLint, TypeScript checking, and
|
|
13
|
+
- 🛠️ **Development Tools**: ESLint, TypeScript checking, and Next.js build optimization
|
|
14
14
|
|
|
15
15
|
## Quick Start
|
|
16
16
|
|
|
@@ -36,15 +36,16 @@ npm run dev
|
|
|
36
36
|
|
|
37
37
|
## Template Included
|
|
38
38
|
|
|
39
|
-
### BlueCopa
|
|
39
|
+
### BlueCopa Next.js Template
|
|
40
40
|
|
|
41
41
|
A foundational template that provides:
|
|
42
42
|
|
|
43
|
-
- **Modern
|
|
43
|
+
- **Modern Next.js Setup**: Next.js 14 with React 18, TypeScript and App Router
|
|
44
44
|
- **BlueCopa Components**: Pre-configured @bluecopa/react component library
|
|
45
|
-
- **UI Foundation**:
|
|
45
|
+
- **UI Foundation**: Radix UI primitives with custom styling system
|
|
46
|
+
- **Data Visualization**: Recharts for charts and analytics
|
|
46
47
|
- **Styling System**: Tailwind CSS with BlueCopa design tokens
|
|
47
|
-
- **Development Setup**: ESLint, TypeScript configuration, and
|
|
48
|
+
- **Development Setup**: ESLint, TypeScript configuration, and Next.js optimization
|
|
48
49
|
- **Environment Configuration**: Ready-to-use environment variable setup
|
|
49
50
|
|
|
50
51
|
#### Key Dependencies Included
|
|
@@ -52,17 +53,21 @@ A foundational template that provides:
|
|
|
52
53
|
```typescript
|
|
53
54
|
// Core BlueCopa and React ecosystem
|
|
54
55
|
"@bluecopa/react": "^0.1.3"
|
|
55
|
-
"react": "^18.
|
|
56
|
-
"
|
|
56
|
+
"react": "^18.3.0"
|
|
57
|
+
"next": "^14.2.0"
|
|
58
|
+
"typescript": "^5.6.0"
|
|
57
59
|
|
|
58
60
|
// UI and Styling
|
|
59
61
|
"@radix-ui/*": "Latest versions"
|
|
60
|
-
"tailwindcss": "^3.
|
|
61
|
-
"lucide-react": "^0.
|
|
62
|
+
"tailwindcss": "^3.4.0"
|
|
63
|
+
"lucide-react": "^0.445.0"
|
|
64
|
+
|
|
65
|
+
// Data Visualization
|
|
66
|
+
"recharts": "^2.12.0"
|
|
62
67
|
|
|
63
68
|
// Development and Build
|
|
64
|
-
"
|
|
65
|
-
"
|
|
69
|
+
"eslint": "^8.57.0"
|
|
70
|
+
"eslint-config-next": "^14.2.0"
|
|
66
71
|
```
|
|
67
72
|
|
|
68
73
|
## Project Structure
|
|
@@ -72,19 +77,26 @@ The generated project follows a clean, scalable structure:
|
|
|
72
77
|
```text
|
|
73
78
|
my-bluecopa-app/
|
|
74
79
|
├── src/
|
|
80
|
+
│ ├── app/ # Next.js App Router pages
|
|
81
|
+
│ │ ├── layout.tsx # Root layout component
|
|
82
|
+
│ │ ├── page.tsx # Home page component
|
|
83
|
+
│ │ └── globals.css # Global styles and Tailwind imports
|
|
75
84
|
│ ├── components/
|
|
76
|
-
│ │
|
|
85
|
+
│ │ ├── ui/ # Reusable UI components
|
|
86
|
+
│ │ ├── charts/ # Chart components using Recharts
|
|
87
|
+
│ │ └── layouts/ # Layout components
|
|
77
88
|
│ ├── lib/ # Utilities and helpers
|
|
78
|
-
│ ├──
|
|
79
|
-
│
|
|
80
|
-
│
|
|
81
|
-
│ └── vite-env.d.ts # Vite type declarations
|
|
89
|
+
│ │ ├── utils.ts # Common utility functions
|
|
90
|
+
│ │ └── cn.ts # Tailwind class name utilities
|
|
91
|
+
│ └── types/ # TypeScript type definitions
|
|
82
92
|
├── public/ # Static assets
|
|
93
|
+
├── .env # Environment variables
|
|
83
94
|
├── .env.example # Environment variables template
|
|
84
95
|
├── package.json # Dependencies and scripts
|
|
96
|
+
├── next.config.js # Next.js configuration
|
|
85
97
|
├── tailwind.config.js # Tailwind CSS configuration
|
|
86
98
|
├── tsconfig.json # TypeScript configuration
|
|
87
|
-
├──
|
|
99
|
+
├── postcss.config.js # PostCSS configuration
|
|
88
100
|
└── README.md # Project documentation
|
|
89
101
|
```
|
|
90
102
|
|
|
@@ -108,7 +120,7 @@ function MyComponent() {
|
|
|
108
120
|
|
|
109
121
|
### Adding UI Components
|
|
110
122
|
|
|
111
|
-
Use the included
|
|
123
|
+
Use the included Radix UI components with Tailwind styling:
|
|
112
124
|
|
|
113
125
|
```typescript
|
|
114
126
|
import { Button } from '@/components/ui/button';
|
|
@@ -128,11 +140,40 @@ function Dashboard() {
|
|
|
128
140
|
}
|
|
129
141
|
```
|
|
130
142
|
|
|
143
|
+
### Adding Charts and Data Visualization
|
|
144
|
+
|
|
145
|
+
Use Recharts for data visualization:
|
|
146
|
+
|
|
147
|
+
```typescript
|
|
148
|
+
import { LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer } from 'recharts';
|
|
149
|
+
|
|
150
|
+
const data = [
|
|
151
|
+
{ name: 'Jan', value: 400 },
|
|
152
|
+
{ name: 'Feb', value: 300 },
|
|
153
|
+
{ name: 'Mar', value: 600 },
|
|
154
|
+
];
|
|
155
|
+
|
|
156
|
+
function ChartComponent() {
|
|
157
|
+
return (
|
|
158
|
+
<ResponsiveContainer width="100%" height={300}>
|
|
159
|
+
<LineChart data={data}>
|
|
160
|
+
<CartesianGrid strokeDasharray="3 3" />
|
|
161
|
+
<XAxis dataKey="name" />
|
|
162
|
+
<YAxis />
|
|
163
|
+
<Tooltip />
|
|
164
|
+
<Line type="monotone" dataKey="value" stroke="#8884d8" />
|
|
165
|
+
</LineChart>
|
|
166
|
+
</ResponsiveContainer>
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
```
|
|
170
|
+
|
|
131
171
|
### Styling and Theming
|
|
132
172
|
|
|
133
173
|
- Modify `tailwind.config.js` for custom design tokens
|
|
134
|
-
- Update CSS variables in `src/
|
|
135
|
-
- All
|
|
174
|
+
- Update CSS variables in `src/app/globals.css` for theme customization
|
|
175
|
+
- All components support consistent styling through Tailwind utilities
|
|
176
|
+
- Use the `cn()` utility function for conditional class names
|
|
136
177
|
|
|
137
178
|
## Environment Configuration
|
|
138
179
|
|
|
@@ -144,19 +185,19 @@ cp .env.example .env
|
|
|
144
185
|
|
|
145
186
|
## Available Scripts
|
|
146
187
|
|
|
147
|
-
- `npm run dev` - Start development server with hot reload
|
|
148
|
-
- `npm run build` - Build for production (
|
|
149
|
-
- `npm run
|
|
188
|
+
- `npm run dev` - Start Next.js development server with hot reload
|
|
189
|
+
- `npm run build` - Build for production (Next.js optimization)
|
|
190
|
+
- `npm run start` - Start production server
|
|
150
191
|
- `npm run lint` - Run ESLint for code quality
|
|
151
192
|
- `npm run type-check` - Run TypeScript type checking without emitting files
|
|
152
193
|
|
|
153
194
|
## Technologies Used
|
|
154
195
|
|
|
155
196
|
- **React 18** - Modern React with concurrent features
|
|
197
|
+
- **Next.js 14** - Full-stack React framework with App Router
|
|
156
198
|
- **TypeScript** - Full type safety and developer experience
|
|
157
|
-
- **Vite** - Fast build tool and development server
|
|
158
199
|
- **@bluecopa/react** - BlueCopa-specific React components
|
|
159
|
-
- **shadcn/ui** - High-quality, accessible component library
|
|
160
200
|
- **Radix UI** - Unstyled, accessible UI primitives
|
|
201
|
+
- **Recharts** - Composable charting library for React
|
|
161
202
|
- **Tailwind CSS** - Utility-first CSS framework
|
|
162
203
|
- **Lucide React** - Beautiful, customizable icons
|
|
@@ -123,7 +123,7 @@ async function createApp(projectName, options) {
|
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
async function createProjectStructure(targetDir, appName, options) {
|
|
126
|
-
const templateDir = path.join(__dirname, '../templates/
|
|
126
|
+
const templateDir = path.join(__dirname, '../templates/latest');
|
|
127
127
|
|
|
128
128
|
// Create base directory
|
|
129
129
|
await fs.ensureDir(targetDir);
|
package/package.json
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Bluecopa API Configuration
|
|
2
|
+
# Copy this file to .env.local and update with your actual values
|
|
3
|
+
|
|
4
|
+
# Bluecopa API Authentication
|
|
5
|
+
# Get this from your Bluecopa dashboard -> Settings -> API Tokens
|
|
6
|
+
VITE_BLUECOPA_API_TOKEN=your-bluecopa-api-token-here
|
|
7
|
+
|
|
8
|
+
# Bluecopa API Base URL
|
|
9
|
+
# Use the develop environment for testing
|
|
10
|
+
VITE_BLUECOPA_API_URL=https://develop.bluecopa.com/api/v1
|
|
11
|
+
|
|
12
|
+
# Bluecopa Workspace ID
|
|
13
|
+
# Get this from your Bluecopa dashboard workspace settings
|
|
14
|
+
VITE_BLUECOPA_WORKSPACE_ID=your-workspace-id-here
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
root: true,
|
|
3
|
+
env: {
|
|
4
|
+
browser: true,
|
|
5
|
+
es2020: true,
|
|
6
|
+
node: true
|
|
7
|
+
},
|
|
8
|
+
extends: [
|
|
9
|
+
'eslint:recommended',
|
|
10
|
+
],
|
|
11
|
+
ignorePatterns: ['dist', '.eslintrc.cjs'],
|
|
12
|
+
parserOptions: {
|
|
13
|
+
ecmaVersion: 'latest',
|
|
14
|
+
sourceType: 'module',
|
|
15
|
+
ecmaFeatures: {
|
|
16
|
+
jsx: true,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
plugins: ['react-refresh'],
|
|
20
|
+
rules: {
|
|
21
|
+
'react-refresh/only-export-components': [
|
|
22
|
+
'warn',
|
|
23
|
+
{ allowConstantExport: true },
|
|
24
|
+
],
|
|
25
|
+
'no-unused-vars': 'off', // Turned off for TypeScript
|
|
26
|
+
'no-undef': 'off', // TypeScript handles this
|
|
27
|
+
},
|
|
28
|
+
overrides: [
|
|
29
|
+
{
|
|
30
|
+
files: ['*.ts', '*.tsx'],
|
|
31
|
+
parser: '@typescript-eslint/parser',
|
|
32
|
+
plugins: ['@typescript-eslint'],
|
|
33
|
+
rules: {
|
|
34
|
+
'no-unused-vars': 'off',
|
|
35
|
+
// Basic TypeScript rules without extending the recommended config
|
|
36
|
+
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
|
|
37
|
+
'@typescript-eslint/no-explicit-any': 'warn',
|
|
38
|
+
'@typescript-eslint/no-inferrable-types': 'warn',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
}
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
# Bluecopa React Router Boilerplate Template
|
|
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.
|
|
4
|
+
|
|
5
|
+
## 🎨 Design System
|
|
6
|
+
|
|
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
|
|
10
|
+
- **Consistent Spacing**: Improved spacing and layout following the latest app design
|
|
11
|
+
- **User Profile Integration**: Modern user dropdown with avatar and profile information
|
|
12
|
+
- **Search & Notifications**: Built-in search bar and notification system
|
|
13
|
+
- **Responsive Design**: Mobile-first approach with proper responsive breakpoints
|
|
14
|
+
|
|
15
|
+
## 🚀 Quick Start
|
|
16
|
+
|
|
17
|
+
### Prerequisites
|
|
18
|
+
- Node.js 18+
|
|
19
|
+
- npm or pnpm
|
|
20
|
+
- Access to Bluecopa workspace
|
|
21
|
+
|
|
22
|
+
### Installation
|
|
23
|
+
|
|
24
|
+
1. **Clone or copy the template**:
|
|
25
|
+
```bash
|
|
26
|
+
# If using as part of the blui monorepo
|
|
27
|
+
cd packages/boilerplate/react/templates/react-router
|
|
28
|
+
|
|
29
|
+
# Or copy the template to your project location
|
|
30
|
+
cp -r packages/boilerplate/react/templates/react-router my-bluecopa-app
|
|
31
|
+
cd my-bluecopa-app
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
2. **Install dependencies**:
|
|
35
|
+
```bash
|
|
36
|
+
# Recommended: Use pnpm (consistent with monorepo)
|
|
37
|
+
pnpm install
|
|
38
|
+
|
|
39
|
+
# Alternative: Use npm
|
|
40
|
+
npm install
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
3. **Set up environment variables**:
|
|
44
|
+
```bash
|
|
45
|
+
# Automated setup (recommended)
|
|
46
|
+
./setup.sh
|
|
47
|
+
|
|
48
|
+
# Manual setup
|
|
49
|
+
cp .env.example .env.local
|
|
50
|
+
# Edit .env.local with your Bluecopa credentials from dashboard -> Settings -> API Tokens
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
4. **Start development server**:
|
|
54
|
+
```bash
|
|
55
|
+
npm run dev
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
5. **Open your browser**: Navigate to [http://localhost:3000](http://localhost:3000)
|
|
59
|
+
|
|
60
|
+
## ✨ Features
|
|
61
|
+
|
|
62
|
+
### 🎯 Core Capabilities
|
|
63
|
+
- **React 18** with TypeScript
|
|
64
|
+
- **React Router v6** for client-side routing
|
|
65
|
+
- **Vite** for fast development and building
|
|
66
|
+
- **@bluecopa/react** - Complete hook library for Bluecopa APIs
|
|
67
|
+
- **TailwindCSS** - Utility-first CSS framework
|
|
68
|
+
- **Radix UI** - Accessible component primitives
|
|
69
|
+
- **Lucide React** - Beautiful icon library
|
|
70
|
+
- **Recharts** - Composable charting library
|
|
71
|
+
|
|
72
|
+
### 🏗️ Architecture
|
|
73
|
+
- **Component-based** architecture with reusable UI components
|
|
74
|
+
- **Custom hooks** for API integration and data management
|
|
75
|
+
- **TypeScript** for type safety and better developer experience
|
|
76
|
+
- **Responsive design** that works on all devices
|
|
77
|
+
- **Modern React patterns** with functional components and hooks
|
|
78
|
+
|
|
79
|
+
### 📊 Bluecopa Integration
|
|
80
|
+
- **Pre-configured hooks** for user data, metrics, and datasets
|
|
81
|
+
- **Real-time data** fetching with TanStack Query
|
|
82
|
+
- **Error handling** and loading states
|
|
83
|
+
- **Authentication** integration
|
|
84
|
+
- **Type-safe** API responses
|
|
85
|
+
|
|
86
|
+
### 🎨 UI Components
|
|
87
|
+
- **Card layouts** for dashboard sections
|
|
88
|
+
- **Data tables** for displaying datasets
|
|
89
|
+
- **Charts and graphs** for data visualization
|
|
90
|
+
- **Form components** with validation
|
|
91
|
+
- **Navigation** components with routing
|
|
92
|
+
- **Responsive grid** layouts
|
|
93
|
+
|
|
94
|
+
## 📁 Project Structure
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
src/
|
|
98
|
+
├── components/ # Reusable UI components
|
|
99
|
+
│ ├── ui/ # Base UI components (buttons, cards, etc.)
|
|
100
|
+
│ └── navbar.tsx # Navigation component
|
|
101
|
+
├── hooks/ # Custom React hooks
|
|
102
|
+
│ └── use-api.ts # Bluecopa API hooks
|
|
103
|
+
├── lib/ # Utility functions
|
|
104
|
+
│ └── utils.ts # Helper functions
|
|
105
|
+
├── pages/ # Route components
|
|
106
|
+
│ ├── Home.tsx # Home page
|
|
107
|
+
│ └── Dashboard.tsx # Dashboard page
|
|
108
|
+
├── providers/ # React context providers
|
|
109
|
+
│ └── query-provider.tsx # TanStack Query provider
|
|
110
|
+
├── types/ # TypeScript type definitions
|
|
111
|
+
├── App.tsx # Main app component with routing
|
|
112
|
+
├── main.tsx # Application entry point
|
|
113
|
+
└── index.css # Global styles
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## 🔧 Configuration
|
|
117
|
+
|
|
118
|
+
### Environment Variables
|
|
119
|
+
Create a `.env.local` file in the root directory:
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
# Bluecopa API Configuration
|
|
123
|
+
VITE_BLUECOPA_API_TOKEN=your-bluecopa-api-token
|
|
124
|
+
VITE_BLUECOPA_API_URL=https://develop.bluecopa.com/api/v1
|
|
125
|
+
VITE_BLUECOPA_WORKSPACE_ID=your-workspace-id
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Getting Your Credentials
|
|
129
|
+
1. Log in to your Bluecopa workspace
|
|
130
|
+
2. Navigate to Settings > API Keys
|
|
131
|
+
3. Generate or copy your API token
|
|
132
|
+
4. Note your workspace ID from the URL or settings
|
|
133
|
+
|
|
134
|
+
## 🛠️ Development
|
|
135
|
+
|
|
136
|
+
### Available Scripts
|
|
137
|
+
- `npm run dev` - Start development server
|
|
138
|
+
- `npm run build` - Build for production
|
|
139
|
+
- `npm run preview` - Preview production build
|
|
140
|
+
- `npm run lint` - Run ESLint
|
|
141
|
+
- `npm run type-check` - Run TypeScript compiler
|
|
142
|
+
|
|
143
|
+
### Adding New Routes
|
|
144
|
+
Add new routes in `src/App.tsx`:
|
|
145
|
+
|
|
146
|
+
```tsx
|
|
147
|
+
import { Routes, Route } from 'react-router-dom'
|
|
148
|
+
import NewPage from '@/pages/NewPage'
|
|
149
|
+
|
|
150
|
+
export default function App() {
|
|
151
|
+
return (
|
|
152
|
+
<QueryProvider>
|
|
153
|
+
<Routes>
|
|
154
|
+
<Route path="/" element={<Home />} />
|
|
155
|
+
<Route path="/dashboard" element={<Dashboard />} />
|
|
156
|
+
<Route path="/new-page" element={<NewPage />} />
|
|
157
|
+
</Routes>
|
|
158
|
+
</QueryProvider>
|
|
159
|
+
)
|
|
160
|
+
}
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Adding Navigation Links
|
|
164
|
+
Update the navigation in `src/components/navbar.tsx`:
|
|
165
|
+
|
|
166
|
+
```tsx
|
|
167
|
+
const navigation = [
|
|
168
|
+
{ name: 'Home', href: '/', icon: Home },
|
|
169
|
+
{ name: 'Dashboard Overview', href: '/dashboard', icon: LayoutDashboard },
|
|
170
|
+
{ name: 'New Page', href: '/new-page', icon: Settings },
|
|
171
|
+
]
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## 📚 API Integration
|
|
175
|
+
|
|
176
|
+
This template includes pre-configured hooks for common Bluecopa API operations:
|
|
177
|
+
|
|
178
|
+
```tsx
|
|
179
|
+
import { useUserData, useMetricDataDemo, useDatasetDataDemo } from '@/hooks/use-api'
|
|
180
|
+
|
|
181
|
+
function MyComponent() {
|
|
182
|
+
const { data: userData, isLoading, error } = useUserData()
|
|
183
|
+
const { data: metrics } = useMetricDataDemo()
|
|
184
|
+
const { data: datasets } = useDatasetDataDemo()
|
|
185
|
+
|
|
186
|
+
if (isLoading) return <div>Loading...</div>
|
|
187
|
+
if (error) return <div>Error: {error.message}</div>
|
|
188
|
+
|
|
189
|
+
return <div>Welcome, {userData?.user?.firstName}!</div>
|
|
190
|
+
}
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## 🎨 Styling
|
|
194
|
+
|
|
195
|
+
The template uses TailwindCSS for styling with a custom design system:
|
|
196
|
+
|
|
197
|
+
- **Color palette**: Bluecopa brand colors
|
|
198
|
+
- **Typography**: Inter font family
|
|
199
|
+
- **Spacing**: Consistent spacing scale
|
|
200
|
+
- **Components**: Pre-built component styles
|
|
201
|
+
|
|
202
|
+
### Customizing Colors
|
|
203
|
+
Edit `tailwind.config.js` to modify the color scheme:
|
|
204
|
+
|
|
205
|
+
```js
|
|
206
|
+
module.exports = {
|
|
207
|
+
theme: {
|
|
208
|
+
extend: {
|
|
209
|
+
colors: {
|
|
210
|
+
bluecopa: {
|
|
211
|
+
50: '#eff6ff',
|
|
212
|
+
// ... other shades
|
|
213
|
+
900: '#1e3a8a',
|
|
214
|
+
},
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
},
|
|
218
|
+
}
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
## 🚀 Deployment
|
|
222
|
+
|
|
223
|
+
### Build for Production
|
|
224
|
+
```bash
|
|
225
|
+
npm run build
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
The built files will be in the `dist/` directory.
|
|
229
|
+
|
|
230
|
+
### Deploy to Vercel
|
|
231
|
+
1. Push your code to GitHub
|
|
232
|
+
2. Connect your repository to Vercel
|
|
233
|
+
3. Set environment variables in Vercel dashboard
|
|
234
|
+
4. Deploy
|
|
235
|
+
|
|
236
|
+
### Deploy to Netlify
|
|
237
|
+
1. Build the project locally
|
|
238
|
+
2. Upload the `dist/` folder to Netlify
|
|
239
|
+
3. Set environment variables in Netlify dashboard
|
|
240
|
+
|
|
241
|
+
## 🔒 Environment Security
|
|
242
|
+
|
|
243
|
+
- Never commit `.env.local` files
|
|
244
|
+
- Use environment variables for all sensitive data
|
|
245
|
+
- Rotate API tokens regularly
|
|
246
|
+
- Use different tokens for development and production
|
|
247
|
+
|
|
248
|
+
## 🤝 Contributing
|
|
249
|
+
|
|
250
|
+
1. Fork the repository
|
|
251
|
+
2. Create a feature branch
|
|
252
|
+
3. Make your changes
|
|
253
|
+
4. Add tests if applicable
|
|
254
|
+
5. Submit a pull request
|
|
255
|
+
|
|
256
|
+
## 📄 License
|
|
257
|
+
|
|
258
|
+
This template is part of the Bluecopa ecosystem and follows the project's licensing terms.
|
|
259
|
+
|
|
260
|
+
## 🆘 Support
|
|
261
|
+
|
|
262
|
+
- Check the [Bluecopa documentation](https://docs.bluecopa.com)
|
|
263
|
+
- Review the [React Router documentation](https://reactrouter.com)
|
|
264
|
+
- Open issues in the project repository
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Development helper script for react-router template
|
|
4
|
+
|
|
5
|
+
echo "🧹 Cleaning react-router template..."
|
|
6
|
+
|
|
7
|
+
# Remove build artifacts
|
|
8
|
+
rm -rf dist/
|
|
9
|
+
echo "✅ Removed dist directory"
|
|
10
|
+
|
|
11
|
+
# Remove node_modules and lock files
|
|
12
|
+
rm -rf node_modules/
|
|
13
|
+
rm -f package-lock.json
|
|
14
|
+
rm -f yarn.lock
|
|
15
|
+
echo "✅ Removed node_modules and lock files"
|
|
16
|
+
|
|
17
|
+
# Remove environment files (keeping example)
|
|
18
|
+
rm -f .env.local
|
|
19
|
+
echo "✅ Removed .env.local"
|
|
20
|
+
|
|
21
|
+
# Optionally reinstall dependencies
|
|
22
|
+
if [ "$1" = "--install" ]; then
|
|
23
|
+
echo "📦 Reinstalling dependencies..."
|
|
24
|
+
if command -v pnpm &> /dev/null; then
|
|
25
|
+
pnpm install
|
|
26
|
+
else
|
|
27
|
+
npm install
|
|
28
|
+
fi
|
|
29
|
+
echo "✅ Dependencies reinstalled"
|
|
30
|
+
fi
|
|
31
|
+
|
|
32
|
+
echo "🎉 Cleanup complete!"
|
|
33
|
+
echo ""
|
|
34
|
+
echo "To reinstall dependencies:"
|
|
35
|
+
echo " pnpm install # recommended"
|
|
36
|
+
echo " npm install # alternative"
|
|
37
|
+
echo ""
|
|
38
|
+
echo "To set up environment:"
|
|
39
|
+
echo " ./setup.sh"
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/favicon.ico" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>Bluecopa - AI-powered Finance Automation</title>
|
|
8
|
+
<meta name="description" content="AI-powered close automation for modern finance teams. Streamline your order-to-cash, procure-to-pay, and record-to-report processes." />
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<div id="root"></div>
|
|
12
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
13
|
+
</body>
|
|
14
|
+
</html>
|