translaite/README.md

133 lines
3.3 KiB
Markdown
Raw Normal View History

2023-08-07 13:42:58 +02:00
# translAIte
2023-08-07 10:52:44 +02:00
2023-08-07 13:42:58 +02:00
Translations app built with Remix, supports authentication. Uses ChatGPT to translate text.
2023-08-07 10:52:44 +02:00
2023-08-07 13:42:58 +02:00
After your first login, you will be prompted to enter your OpenAI API key. You can get one [here](https://platform.openai.com/account/api-keys).
2023-08-07 10:52:44 +02:00
2023-08-07 13:42:58 +02:00
Built for self-hosting: host it anywhere you want, and use it for free.
2023-08-07 10:52:44 +02:00
2023-08-07 13:42:58 +02:00
View on [DockerHub](https://hub.docker.com/r/nzambello/translaite).
2023-08-07 10:52:44 +02:00
2023-08-07 13:42:58 +02:00
## Table of contents
2023-08-07 10:52:44 +02:00
2023-08-07 13:42:58 +02:00
- [Pre-built Docker image](#pre-built-docker-image)
- [Docker compose](#docker-compose)
- [Custom deployments or development](#custom-deployment-or-development)
- [Tech stack](#tech-stack)
- [Running locally](#running-locally)
- [Running with Docker](#running-with-docker)
- [Multi-platform docker image](#multi-platform-docker-image)
- [License](#license)
2023-08-07 10:52:44 +02:00
2023-08-07 13:42:58 +02:00
## Pre-built Docker Image
2023-08-07 10:52:44 +02:00
2023-08-07 13:42:58 +02:00
```bash
docker pull nzambello/translaite
```
2023-08-07 10:52:44 +02:00
2023-08-07 13:42:58 +02:00
If you want to use the pre-built Docker image, you can run it with:
2023-08-07 10:52:44 +02:00
2023-08-07 13:42:58 +02:00
```bash
docker run -d -p 8080:8080 -v /path/to/data:/data/data.db nzambello/translaite
```
2023-08-07 10:52:44 +02:00
2023-08-07 13:42:58 +02:00
If you want to use different defaults, you can build your own image. See [Running with docker](#running-with-docker)
2023-08-07 10:52:44 +02:00
2023-08-07 13:42:58 +02:00
### Docker compose
2023-08-07 10:52:44 +02:00
2023-08-07 13:42:58 +02:00
Basic example:
2023-08-07 10:52:44 +02:00
2023-08-07 13:42:58 +02:00
```yaml
version: "3.8"
2023-08-07 10:52:44 +02:00
2023-08-07 13:42:58 +02:00
services:
translaite:
image: nzambello/translaite
container_name: translaite
restart: always
ports:
- 8080:8080
volumes:
- ./dockerData/translaite:/data # Path to data for DB persistence
```
2023-08-07 10:52:44 +02:00
2023-08-07 13:42:58 +02:00
Example of docker-compose.yml with [Traefik](https://traefik.io/) as reverse proxy:
```yaml
translaite:
depends_on:
- watchtower
image: nzambello/translaite
container_name: translaite
restart: always
volumes:
- /dockerData/translaite:/data # Path to data for DB persistence
labels:
- "com.centurylinklabs.watchtower.enable=true"
- "traefik.enable=true"
- "traefik.http.routers.translaite.rule=Host(`translate.YOURDOMAIN.com`)" # change it to your preferences
- "traefik.http.routers.translaite.entrypoints=websecure"
- "traefik.http.routers.translaite.tls.certresolver=letsencrypt"
- "traefik.http.routers.translaite.service=translaite-service"
- "traefik.http.services.translaite-service.loadbalancer.server.port=8080"
```
2023-08-07 10:52:44 +02:00
2023-08-07 13:42:58 +02:00
## Custom deployment or development
2023-08-07 10:52:44 +02:00
2023-08-07 13:42:58 +02:00
### Tech Stack
2023-08-07 10:52:44 +02:00
2023-08-07 13:42:58 +02:00
- [Remix](https://remix.run)
- [Prisma](https://prisma.io)
- [SQLite](https://sqlite.org)
- [Tailwind](https://tailwindcss.com)
- [Docker](https://docker.com)
2023-08-07 10:52:44 +02:00
2023-08-07 13:42:58 +02:00
### Running Locally
2023-08-07 10:52:44 +02:00
2023-08-07 13:42:58 +02:00
```bash
# Clone the repo
git clone https://github.com/nzambello/translaite.git
cd translaite
2023-08-07 10:52:44 +02:00
2023-08-07 13:42:58 +02:00
# Install dependencies
yarn install
2023-08-07 10:52:44 +02:00
2023-08-07 13:42:58 +02:00
# Setup .env
cp .env.example .env
vim .env
2023-08-07 10:52:44 +02:00
2023-08-07 13:42:58 +02:00
# Start the app
yarn dev
```
2023-08-07 10:52:44 +02:00
2023-08-07 13:42:58 +02:00
### Running with Docker
2023-08-07 10:52:44 +02:00
2023-08-07 13:42:58 +02:00
```bash
# Clone the repo
git clone https://github.com/nzambello/translaite.git
cd translaite
2023-08-07 10:52:44 +02:00
2023-08-07 13:42:58 +02:00
# Setup .env
cp .env.example .env
vim .env
2023-08-07 10:52:44 +02:00
2023-08-07 13:42:58 +02:00
# Build the image
docker built -t translaite .
2023-08-07 10:52:44 +02:00
2023-08-07 13:42:58 +02:00
# Start the app
docker run -p 127.0.0.1:8080:8080 translaite
2023-08-07 10:52:44 +02:00
```
2023-08-07 13:42:58 +02:00
### Multi-platform Docker image
2023-08-07 10:52:44 +02:00
2023-08-07 13:42:58 +02:00
```bash
docker buildx create --name mybuilder --driver docker-container --bootstrap --use # create a new builder and switch to it using a single command.
docker buildx build --platform linux/amd64,linux/arm64 -t nzambello/translaite:latest --push .
2023-08-07 10:52:44 +02:00
```
2023-08-07 13:42:58 +02:00
## License
2023-08-07 10:52:44 +02:00
2023-08-07 13:42:58 +02:00
[Nicola Zambello](https://github.com/nzambello) © 2023
2023-08-07 10:52:44 +02:00
2023-08-07 13:42:58 +02:00
[GNU GPLv3](https://github.com/nzambello/translaite/raw/main/LICENSE)