This is a SvelteKit-powered interactive map visualization application specifically designed for European Union country data. The application provides a comprehensive control panel for configuring and customizing map visualizations, with a unique one-click deployment feature.

- Interactive map of European Union countries
- Supports various dataset types (values, binary)
- Flexible data input via CSV
- Multiple color scheme options
- One-click repository creation and deployment
- Automatic GitHub repository setup
- Instant Vercel deployment
- Batch translation file processing
- Embed code generation for easy sharing
- Configurable title and subtitle
- Customizable data sources and notes
- Multiple display options:
- Tooltips
- Legend
- Scale bar
- Color scheme selection:
- Sequential and diverging color schemes
- Color scheme reversal
- Custom number of color classes
- Automatic translation of map text to 24 languages
- Translation progress tracking
- Google Cloud Translation API integration
- Vercel Blob Storage preservation
- Node.js (version 16 or later)
- npm or pnpm
- GitHub account
- Vercel account
- Google Cloud Translation API key
- A modern web browser
- SvelteKit
- Tailwind CSS
- D3.js (for CSV parsing)
- Google Cloud Translation API
- GitHub API
- Vercel Deployment API
- Vercel Blob Storage
- Responsive design
To run and deploy the application, you'll need to configure the following environment variables:
-
GitHub Integration
GITHUB_TOKEN
: Personal access token for GitHub repository creation and managementGITHUB_USERNAME
: GitHub username used for repository operations
-
Vercel Deployment
DEPLOY_VERCEL_TOKEN
: Authentication token for Vercel deployment
-
Translation Service
TRANSLATE_ENGINE
: Translation service to use (e.g., "google")GOOGLE_API_KEY
: API key for Google Cloud Translation service
-
Vercel Blob Storage
BLOB_READ_WRITE_TOKEN
: Token for reading and writing to Vercel Blob storage
# GitHub Configuration
GITHUB_TOKEN=ghp_your_github_personal_access_token
GITHUB_USERNAME=your_github_username
# Vercel Deployment
DEPLOY_VERCEL_TOKEN=your_vercel_deployment_token
# Translation Configuration
TRANSLATE_ENGINE=google
GOOGLE_API_KEY=your_google_cloud_translation_api_key
# Blob Storage
BLOB_READ_WRITE_TOKEN=your_vercel_blob_read_write_token
- Never commit your
.env
file to version control - Use environment-specific
.env
files (e.g.,.env.development
,.env.production
) - Rotate tokens and keys periodically
- Limit token permissions to only necessary scopes
- Create a
.env
file in the project root - Copy the example variables above
- Replace placeholder values with your actual tokens and keys
- Ensure the
.env
file is added to.gitignore
- GitHub Token: GitHub Personal Access Tokens
- Vercel Token: Vercel Account Tokens
- Google Cloud Translation API Key: Google Cloud Console
- Verify all tokens have the necessary permissions
- Check that API keys are correctly configured
- Ensure environment variables are not exposed publicly
The application provides a seamless, automated translation workflow that transforms user-input text into a fully multilingual map experience:
- Users input original text through the control panel
- Translatable content includes:
- Map title
- Subtitle
- Data source description
- Notes
- Additional metadata
- Utilizes Google Cloud Translate API
- Supports 24 European languages (Bulgarian, Croatian, Czech, Danish, Dutch, English, Estonian, Finnish, French, German, Greek, Hungarian, Irish, Italian, Latvian, Lithuanian, Maltese, Polish, Portuguese, Romanian, Slovak, Slovenian, Spanish, Swedish)
- Translations generated in batches of 4 languages
- Handles potential translation errors gracefully
- Provides detailed progress tracking
- Translated content saved to Vercel Blob Storage
- Each language gets a dedicated JSON file
- Public URLs generated for easy access
- Ensures translation persistence and retrieval
- Translated JSON files committed to GitHub repository
- Enables version control of translations
- Provides backup and historical tracking
- Translated files populate language dropdown
- Allows users to switch between languages dynamically
- Seamless user experience across multiple languages
User Input Text
↓
Google Cloud Translation API
↓
24 Language Translations
↓
Vercel Blob Storage (language_code.json)
↓
GitHub Repository Commit
↓
Map Interface Language Selector
- Partial translation support
- Fallback to original text if translation fails
- Detailed error logging
- Batch processing with retry mechanisms
- Batch processing minimizes API calls
- Caching of translation results
- Efficient storage and retrieval mechanisms
- Utilizes secure Google Cloud Translation API
- Temporary storage with controlled access
- Complies with EU multilingual requirements
The deployment process involves a carefully orchestrated sequence of API calls, each handling a specific phase of the map creation and deployment:
- Purpose: Generate multilingual translations for map content
- Input:
sourceObject
: Original text content to translatebatchIndex
: Current processing batch
- Processing Strategy:
- Supports 24 languages
- Batch-based translation processing
- Incremental translation generation
- Features:
- Translates map title, subtitle, descriptions
- Handles text content, source information, notes
- Provides progress tracking
- Output:
translations
: Object containing translations for multiple languagescompletedLanguages
: List of languages processed in current batchhasMore
: Indicates if more batches remainsuccess
: Translation process status
- Purpose: Create a new GitHub repository
- Input:
repoName
: Chosen repository namemapConfig
: Current map configuration
- Actions:
- Validate repository name
- Create GitHub repository
- Prepare initial project structure
- Output:
repoUrl
: URL of the created GitHub repository
- Purpose: Commit translation files to the repository
- Input:
repoName
: Repository nametranslations
: Batch of language translationsisLastBatch
: Flag for final batch
- Processing Strategy:
- Batch processing (6 languages per batch)
- Fallback to single file processing if batch fails
- Features:
- Tracks translation progress
- Handles partial success scenarios
- Provides retry mechanism
- Purpose: Remove temporary files and manage storage
- Input: None
- Actions:
- Clear temporary translation and configuration files
- Report remaining storage blobs
- Output:
remainingBlobs
: Number of files left in storage
- Purpose: Deploy the repository to Vercel
- Input:
repoName
: Repository to deploy
- Actions:
- Connect GitHub repository to Vercel
- Configure project settings
- Trigger deployment
- Output:
projectUrl
: Deployed project URL- Generates embed code
-
Translation Generation
- Collect all translatable content
- Generate translations across 24 languages
- Batch-process translations
-
Repository Preparation
- Create GitHub repository
- Validate project structure
-
Translation File Management
- Commit translation files
- Handle batch processing
- Manage translation progress
-
Storage Optimization
- Clean up temporary files
- Manage storage resources
-
Deployment
- Deploy to Vercel
- Generate project URL
- Create embed code
- Robust retry mechanism (up to 3 attempts)
- Detailed error tracking
- Partial success support for translations
- Graceful fallback strategies
- Retry mechanism for each API call
- Exponential backoff between retries
- Detailed error logging
- Ability to resume from last successful step
The application requires a CSV with the following columns:
country
: Full country nameid
: Two-letter EU country codevalue
: Numerical value (can be null)extraInfo
: Boolean indicator
country,id,value,extraInfo
Austria,AT,0.035,FALSE
Belgium,BE,0.083,FALSE
- Values: Numerical data visualization
- Binary: Binary (true/false) data representation
- Tooltips toggle
- Legend visibility
- Scale bar display
- Custom unit labels
- Override scale bar values
- Sequential: Single-hue color gradients
- Diverging: Contrasting color schemes
- Choose from multiple predefined color schemes
- Reverse color order
- Select number of color classes (3-9)
- Automatically creates a new repository
- Supports repository names with letters, numbers, hyphens, and underscores
- Automatic project setup
- Generates project URL
- Provides embed code for easy integration
- Seamless GitHub repository integration
- Ensure CSV data matches required format
- Check browser console for any runtime errors
- Verify GitHub and Vercel account connections
- Review deployment step messages
- Confirm Google Cloud Translation API key is valid
- Robust retry mechanism for API requests
- Detailed error messages
- Partial success tracking for translations
- Fallback to original text if translation fails
-
Clone the repository:
git clone https://your-repository-url.git cd your-project-directory
-
Install dependencies:
npm install # or pnpm install
-
Run development server:
npm run dev # or pnpm dev
Open http://localhost:5173 in your browser.
Alsino Skowronnek: https://github.com/alsino/