This project provides an API to translate SRT subtitle files into Vietnamese using the Gemini API.
- Node.js and npm installed
- Vercel account
-
Clone the repository:
git clone https://github.com/bihv/subtitle-translate-web.git cd subtitle-translate-web
-
Install dependencies:
npm install
-
Create a
.env
file in the root directory and add your Gemini API key:GEMINI_API_KEY=your_api_key_here
-
Ensure your
package.json
includes the necessary scripts for deployment and testing.
To run the project locally, use the following command:
npm run dev
-
Install the Vercel CLI:
npm install -g vercel
-
Log in to Vercel:
vercel login
-
Initialize the project with Vercel:
vercel
Follow the prompts to set up the project. When asked for the root directory, specify the directory containing your
api
folder. -
Set up environment variables on Vercel:
- Go to your project dashboard on Vercel.
- Navigate to the "Settings" tab.
- Add the environment variable
GEMINI_API_KEY
with your actual API key.
-
Deploy the project:
vercel --prod
Once deployed, you can use the web endpoint provided by Vercel. For example https://your-vercel-endpoint
This project is licensed under the MIT License.