- 🌐 Translate text between multiple languages
- 🔍 Live language identification as you type
- 🔗 Multi-message context (chain mode)
- 🎯 Language variety buttons with responsive overflow
- ♿ Accessible, responsive, and mobile-friendly UI
- 🔌 Pluggable AI backend: OpenAI (public or local e.g.: Ollama) or Cohere
- 🧪 Comprehensive test suite with 100% passing tests
- 📊 Full test coverage reporting
- Go 1.20+
- Node.js 18+
- (Optional) Docker
Required (choose one backend):
ENGINE=ollamaOPENAI_HOST(e.g.localhost)OPENAI_PORT(e.g.11434)OPENAI_MODEL(e.g.aya-expanse:8b)OPENAI_API_KEY(optional, for authentication)
ENGINE=cohereCOHERE_API_KEY(required)COHERE_MODEL(e.g.c4ai-aya-expanse-8b)
Optional:
PORT(default: 8080)
-
Install Go dependencies:
go mod tidy
-
Build the frontend:
cd frontend npm install npm run build cd ..
-
Set environment variables for your backend (see above).
-
Run the server:
go run main.go
-
Visit http://localhost:8080 in your browser.
BabelBridge has a comprehensive test suite covering both backend and frontend components.
- Go Backend: Unit tests, integration tests, and mock testing
- Frontend: Component tests, context tests, utility tests, and E2E tests
- Coverage Target: 70%+ for both backend and frontend
- Status: 100% passing tests ✅
make test-all # Run all tests with coverage
npm run test:all # Alternative using npm (frontend only)make test-go # Run Go tests with coverage
go test -v ./... # Basic test run
go test -cover ./... # With coveragemake test-frontend # Run frontend tests with coverage
cd frontend && npm test # Unit tests (watch mode)
cd frontend && npm run test:unit # Unit tests (single run)
cd frontend && npm run test:coverage # With coverage reportmake test-e2e # Run end-to-end tests
cd frontend && npm run test:e2e # Direct E2E run
cd frontend && npm run test:e2e:ui # E2E with UIAfter running tests with coverage, reports are available at:
- Go:
coverage.html(root directory) - Frontend:
frontend/coverage/index.html
All tests run automatically on:
- ✅ Every push to main/develop branches
- ✅ Every pull request
- ✅ Coverage reports posted as PR comments
- ✅ Tests must pass before merging
tests/
├── backend/
│ ├── unit/ # Go unit tests
│ ├── integration/ # Go integration tests
│ └── mock/ # Mock implementations
└── frontend/
├── components/ # React component tests
├── context/ # Context/state tests
├── utils/ # Utility function tests
└── e2e/ # End-to-end tests
You can build and run BabelBridge with Docker:
-
Build the image:
docker build -t babelbridge . -
Create a
.envfile with the required environment variables for your backend. -
Run the container:
docker run -p 8080:8080 --env-file .env babelbridge
frontend/— React frontend (Vite + TypeScript)babel/— Translation logic and AI backend integrationapi/— API handlers and servermain.go— Go entrypoint
MIT