This is a multilingual translator application built with React and Capacitor, enabling it to run as a web app and a native Android app. It leverages Google's Gemini API for translation and dictionary lookups and Cloudflare Workers for serverless functions.
- Frontend: React, Vite
- Mobile: Capacitor
- Backend: Cloudflare Workers
- Translation: Google Gemini API
Before you begin, ensure you have the following installed:
- Node.js and pnpm
- Android Studio (for Android development)
- Cloudflare Wrangler CLI (for deployment)
-
Clone the repository:
git clone https://github.com/your-username/translator.git cd translator -
Install dependencies:
pnpm install
To build the application for development and run it locally, use the following command:
pnpm run devThis will start a local development server at http://localhost:8788.
To build the application for production, use the following command:
pnpm run buildThis will create a production-ready build in the dist directory.
The web application is deployed to Cloudflare Pages. The wrangler.toml file is configured for this purpose. To deploy the application, run the following command:
wrangler pages deploy dist-
Sync the Capacitor project:
npx cap sync
-
Open the Android project in Android Studio:
npx cap open android
-
Build the Android app: In Android Studio, you can build the app and run it on an emulator or a physical device.