A React application that extracts BigQuery table schemas, converts them to JSON Schema format, and imports data into Blind Insight using the Blind Proxy.
Note: This is a working prototype (not production code) that demonstrates integration between Blind Insight and BigQuery.
- π Extract schema from any BigQuery table
- π Convert BigQuery schema to JSON Schema format
- π Copy schemas to clipboard
- πΎ Download schemas as JSON files
- π¨ Modern, responsive UI with glassmorphism design
- π± Mobile-friendly interface
- π Real Blind Insight Integration - Creates actual datasets and schemas
- π Data Import - Imports actual data from BigQuery into Blind Insight
- π‘οΈ Blind Proxy Integration - Uses the official Blind Proxy for encryption
- Frontend: React application served via Python HTTP server
- Backend: Express.js server with BigQuery and Blind Proxy integration
- Database: Google BigQuery
- Schema Conversion: Custom BigQuery to JSON Schema converter
- Blind Integration: Blind Proxy CLI for dataset/schema creation and data import
- Node.js (v14 or higher)
- Python 3 (for serving the frontend)
- Google Cloud Project with BigQuery enabled
- Google Cloud Service Account with BigQuery permissions
- Blind Proxy CLI installed and authenticated
git clone https://github.com/blind-insight/importer.git
cd importerInstall backend dependencies:
cd cube-server
npm install
cd ..Important: The Blind Proxy must be installed and authenticated before running this application.
-
Download the Blind Proxy from the Blind Insight documentation
-
Install the Blind Proxy in the parent directory of this project:
# The Blind Proxy should be located at: ../blind/blind ls -la ../blind/blind -
Authenticate with Blind Insight:
../blind/blind login
-
Verify authentication:
../blind/blind organization list
You should see your Blind Insight organizations listed.
- Create a Google Cloud Project
- Enable the BigQuery API
- Create a Service Account with BigQuery permissions:
- BigQuery Data Viewer
- BigQuery Job User
- Download the service account key file (JSON)
Create a .env file in the cube-server directory:
cd cube-server
cp env.example .envEdit the .env file with your Google Cloud credentials:
# BigQuery Configuration
GOOGLE_CLOUD_PROJECT_ID=your-project-id
GOOGLE_CLOUD_KEY_FILE=path/to/your/service-account-key.json
# Server Configuration
PORT=3001
NODE_ENV=developmentStart the backend server:
cd cube-server
node index.jsYou should see:
π Test Schema converter API is running on port 3001
π§ Configure BigQuery credentials in .env file for real data
Start the frontend (in a new terminal):
# From the project root directory
python3 -m http.server 3000You should see:
Serving HTTP on :: port 3000 (http://[::]:3000/) ...
- Frontend: http://localhost:3000
- Backend API: http://localhost:3001
- Open http://localhost:3000 in your browser
- Enter your BigQuery credentials:
- Project ID: Your Google Cloud project ID
- Service Account Key: Upload your JSON service account key file
- Dataset ID: The BigQuery dataset containing your table
- Table ID: The BigQuery table to import
- Enter Blind Insight details:
- Organization: Your Blind Insight organization slug (e.g.,
blind-insight-demo) - Dataset Name: Name for the new Blind Insight dataset
- Schema Name: Name for the new Blind Insight schema
- Organization: Your Blind Insight organization slug (e.g.,
- Click "Convert Schema" to:
- Extract the BigQuery schema
- Convert it to JSON Schema format
- Create a new dataset in Blind Insight
- Create a new schema in Blind Insight
- Import the actual data from BigQuery into Blind Insight
GET /api/health- Health check endpointGET /api/blind/status- Check Blind Proxy authentication statusPOST /api/blind/create-schema- Create dataset, schema, and import data
Solution: The app no longer uses Cube.js. Make sure you're using the updated index.js file.
Solution:
- Ensure the Blind Proxy is installed at
../blind/blind - Check that the Blind Proxy executable has proper permissions:
chmod +x ../blind/blind
Solution:
- Authenticate with Blind Insight:
../blind/blind login - Verify authentication:
../blind/blind organization list
Solution:
- This is a standalone HTML/JS app, not a React app with npm scripts
- Use
python3 -m http.server 3000to serve the frontend
Solution:
- Verify your service account key file is valid
- Ensure the service account has proper BigQuery permissions
- Check that the project ID is correct
Solution:
- Verify the dataset ID and table ID exist in your BigQuery project
- Ensure your service account has access to the dataset
Set NODE_ENV=development in your .env file to enable detailed error logging.
Test the Blind Proxy integration:
curl http://localhost:3001/api/blind/statusYou should see:
{
"authenticated": true,
"organizations": "[...]",
"suggestion": "Use one of the organization slugs shown above"
}importer/
βββ index.html # Main React application (CDN-based)
βββ src/ # React components
βββ cube-server/
β βββ index.js # Express.js backend with Blind Proxy integration
β βββ package.json # Backend dependencies
β βββ .env # Environment configuration
βββ blind/ # Blind Proxy CLI (should be in parent directory)
βββ README.md
The application converts BigQuery data types to JSON Schema types as follows:
| BigQuery Type | JSON Schema Type |
|---|---|
| STRING | string |
| INTEGER/INT64 | integer |
| FLOAT/NUMERIC | number |
| BOOLEAN/BOOL | boolean |
| TIMESTAMP/DATE | string (with format) |
| RECORD | object |
| REPEATED | array |
- Backend changes: Edit
cube-server/index.js - Frontend changes: Edit
index.html(React components in script tags) - Styling: Update CSS in
index.html
# Test API endpoints
curl http://localhost:3001/api/health
# Test Blind Proxy integration
curl http://localhost:3001/api/blind/status
# Test schema extraction (requires valid BigQuery credentials)
curl -X POST http://localhost:3001/api/bigquery/schema \
-H "Content-Type: application/json" \
-d '{"projectId":"your-project","datasetId":"your-dataset","tableId":"your-table"}'- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly with real BigQuery data and Blind Insight
- Submit a pull request
MIT License - see LICENSE file for details.