Skip to content

Conversation

@camerondurham
Copy link
Owner

Replaced the vanilla JavaScript + Webpack frontend with a modern Svelte + Vite implementation.

Key changes:

  • Migrated from vanilla JS to Svelte components for better maintainability
  • Replaced Webpack with Vite for faster builds and better developer experience
  • Created modular component structure (CodeEditor, OutputDisplay, App)
  • Improved API integration with async/await and modern fetch API
  • Maintained all existing features: CodeMirror integration, language support, theme switching
  • Preserved dark/light mode support via CSS media queries
  • Updated Docker build configuration to use Vite build output
  • Updated Earthfile for CI/CD compatibility
  • Bundle size reduced from ~250KB to a more optimized build

Features preserved:

  • Support for 6 languages (python3, nodejs, c++, go, bash, rust)
  • 15+ CodeMirror themes
  • Real-time code execution and output display
  • Auto-detection of local vs production API endpoints
  • GoatCounter analytics integration
  • Responsive design

Technical improvements:

  • Component-based architecture for better code organization
  • Modern ES modules and build tooling
  • Faster HMR (Hot Module Replacement) during development
  • Better TypeScript support path for future enhancements
  • Cleaner separation of concerns (UI, API, templates)

Replaced the vanilla JavaScript + Webpack frontend with a modern Svelte + Vite implementation.

Key changes:
- Migrated from vanilla JS to Svelte components for better maintainability
- Replaced Webpack with Vite for faster builds and better developer experience
- Created modular component structure (CodeEditor, OutputDisplay, App)
- Improved API integration with async/await and modern fetch API
- Maintained all existing features: CodeMirror integration, language support, theme switching
- Preserved dark/light mode support via CSS media queries
- Updated Docker build configuration to use Vite build output
- Updated Earthfile for CI/CD compatibility
- Bundle size reduced from ~250KB to a more optimized build

Features preserved:
- Support for 6 languages (python3, nodejs, c++, go, bash, rust)
- 15+ CodeMirror themes
- Real-time code execution and output display
- Auto-detection of local vs production API endpoints
- GoatCounter analytics integration
- Responsive design

Technical improvements:
- Component-based architecture for better code organization
- Modern ES modules and build tooling
- Faster HMR (Hot Module Replacement) during development
- Better TypeScript support path for future enhancements
- Cleaner separation of concerns (UI, API, templates)
Updated API configuration to use environment variables with production as default.
This matches the original behavior where the app defaulted to production API.

Changes:
- API now defaults to https://runner.fly.dev/api/v1/ (production)
- Can be overridden via VITE_API_URL environment variable
- Added .env.example with configuration instructions

To use local backend during development:
1. Create .env file: cp .env.example .env
2. Uncomment: VITE_API_URL=http://localhost:10100/api/v1/
3. Restart dev server

This fixes the "Failed to fetch" error when running locally without a backend.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants