A powerful, real-time Albanian language translation platform with speech recognition capabilities, built with modern web technologies.
- Real-time Speech Recognition - Instantly capture and transcribe spoken words
- Bidirectional Translation - Seamless translation between Albanian and other languages
- Text-to-Speech - High-quality voice output powered by ElevenLabs
- Modern UI/UX - Beautiful, responsive interface built with Chakra UI
- Real-time Voice Calls - WebSocket-based communication for live translation
- Cross-Platform - Works on all modern browsers and devices
- Node.js (v14 or higher)
- npm (comes with Node.js)
- Google Translate API key
- ElevenLabs API key (for text-to-speech)
- Clone the repository:
git clone https://github.com/tony-42069/translator.git
cd translator
- Install dependencies:
npm install
- Configure environment variables:
- Create a
.env
file in the root directory - Add your API keys:
- Create a
REACT_APP_GOOGLE_TRANSLATE_API_KEY=your_google_translate_api_key
REACT_APP_ELEVENLABS_API_KEY=your_elevenlabs_api_key
- Start the development server:
npm run dev
Visit http://localhost:3000
to see the application in action!
albanian-translator/
├── src/
│ ├── components/ # Reusable UI components
│ │ ├── CallInterface/ # Voice call UI components
│ │ ├── TranslationBox/ # Translation display components
│ │ └── SpeechControls/ # Audio control components
│ ├── services/ # Business logic and API integrations
│ │ ├── AudioService.js # Audio processing service
│ │ ├── SocketService.js # WebSocket communication
│ │ ├── TranslationService.js
│ │ └── ElevenLabsService.js
│ ├── hooks/ # Custom React hooks
│ ├── utils/ # Helper functions and constants
│ ├── tests/ # Test files
│ ├── App.js # Main application component
│ └── index.js # Application entry point
├── public/ # Static assets
└── config/ # Configuration files
- Frontend Framework: React 18.2.0
- UI Library: Chakra UI
- Translation: Google Cloud Translation API
- Speech Recognition: Web Speech API
- Text-to-Speech: ElevenLabs API
- Real-time Communication: Socket.IO
- State Management: React Context API
- Build Tool: Webpack
- Select your speaking language (Albanian or English)
- Click "Start Recording" to begin voice translation
- Speak clearly into your microphone
- View translations in real-time
- Click "Start Call" to create a new room
- Share the room code with another user
- Other user clicks "Join Room" and enters the code
- Begin speaking - translations will be automatic
- Environment variables are used for API key management
- HTTPS encryption for all API communications
- Input sanitization and validation
- Rate limiting implementation
- Regular security audits and updates
- Secure WebSocket connections
IMPORTANT: This application requires API keys for Google Cloud Translation and ElevenLabs. Never commit these keys to version control!
- Create a
.env
file based on.env.example
- Add your API keys to
.env
- Ensure
.env
is in your.gitignore
- Never share or expose your API keys
If you accidentally commit API keys:
- Immediately revoke and regenerate the exposed keys
- Contact the service provider's security team
- Review your git history for other potential exposures
Run the test suite to verify functionality:
npm test
The test suite includes:
- WebSocket connection tests
- Audio processing verification
- Room management testing
- Translation pipeline validation
We welcome contributions! Please follow these steps:
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Google Cloud Platform for translation services
- ElevenLabs for text-to-speech capabilities
- The amazing open-source community
© 2024 Albanian Translator. All rights reserved.