Running Recontent.app

Setting up the database

Recontent.app uses Prisma to manage its DB schema & migrations. A recontentapp-migrate docker image is available to migrate an existing Recontent.app database or a fresh one.

# Pull Docker image
docker pull recontentapp/recontentapp-migrate:0.8.1

# Run migrations against database
docker run --env DATABASE_URL="postgres://postgres:postgres@host.docker.internal:6033/recontentapp" recontentapp/recontentapp-migrate:0.8.1

If your database is accessible from the Internet, these commands can be run from your computer by making sure the DATABASE_URL environment variable is correct. For more advanced contexts, this Docker image can be used to spawn a container on each deployment or app restart.

On Apple Silicon processors, you might need to use export DOCKER_DEFAULT_PLATFORM=linux/amd64

Running the app

Apart from its database, Recontent.app is packaged as a single Docker image that can be executed on Cloud services like AWS ECS, Digital Ocean or Google Cloud Platform.

# Pull Docker image
docker pull recontentapp/recontentapp:0.8.1

# Run container
docker run -p 127.0.0.1:8080:8080/tcp --env DATABASE_URL="postgres://postgres:postgres@host.docker.internal:6033/recontentapp" recontentapp/recontentapp:0.8.1

Environment variables

Here's the full list of environment variables that need to be passed to the application container to run successfully.

APP_URL & API_URL are usually the same. For example, if Recontent.app is hosted at recontent.my-app.com, https://recontent.my-app.com can be used for both environment variables.

You can choose to disable workspace creation on your Recontent.app instance. Once the first user signs up & creates a first workspace, it's no longer possible to create a new one for new users.

Google sign-in with Google OAuth2 application

Recontent.app supports logging in users using Google accounts through OAuth2.

To set it up, follow the next steps:

  • Create a project on Google Cloud Console

  • Go to "APIs & Services"

  • Click "OAuth consent screen" & set it up based on your needs (internal or external)

  • Click "Add or remove scopes" & add the following ones:

    • userinfo.email

    • userinfo.profile

  • Click "Credentials" > "Create credentials"

    • Select "OAuth client ID"

    • Select "Web application" as application type

    • Add authorized JavaScript origins based on your Recontent.app instance

      • https://recontent.my-app.com

    • Add authorized redirect URIs based on your Recontent.app instance

      • https://recontent.my-app.com/sign-in

  • Copy the generated client ID, client secret & redirect URI to pass them as environment variables

Auto translation with Google Gemini Pro

Recontent.app supports auto-translating & rephrasing phrases once a translation is available in at least one language for a given phrase. AI features are powered by Google Gemini Pro.

Worker with AWS SQS queue

Recontent.app sometimes needs to perform tasks (eg. daily destinations sync) on a regular basis (eg. CRON jobs) which do not fit the request/response model. To ensure these tasks can be performed at scale, an AWS SQS queue is used for batch processing.

You can set up this worker by using the SQS_QUEUE_URL environment variable.

Using Google Gemini Pro

Google Gemini Pro requests are authenticated using a standard API key. Make sure to pass the GOOGLE_GEMINI_API_KEY environment variable. To get one, check out this documentation page from Google AI.

CDN with S3-compatible object storage

Recontent.app has a built-in destination type called CDN which allows users to expose their translations on public URLs using various formats like JSON.

An S3-compatible object storage bucket (AWS S3, Cloudflare R2) is used to store generated files, which can then be accessed publicly behind AWS CloudFront for example.

The environment variable S3_BUCKET_NAME is used to indicate which bucket to use & S3_BUCKET_URL defines the base URL for bucket objects. For example, if your S3 bucket points to translations-cdn.my-app.com, https://translations-cdn.my-app.com should be used.

The AWS S3 SDK is initialized using standard AWS credentials retrieval mechanisms.

Make sure credentials are provided in one of the listed ways & that the following policy is used:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": ["s3:*"],
      "Effect": "Allow",
      "Resource": "arn:aws:s3:::example-bucket/*"
    }
  ]
}

Last updated