Skip to content

High-performance distributed remote cache for Turborepo.

License

Notifications You must be signed in to change notification settings

brunojppb/turbo-racer

Repository files navigation

Turbo Racer

Workflow badge

An open-source backend with a Web UI for managing your Turborepo cache.

Features

There are a few open-source turborepo cache backends out there, but all of them seem to lack management around tokens and teams. If you work in an enterprise, access management is crucial for keeping permissions segregated and I could not find anything supporting that.

So I've built my own remote cache. Besides giving you full control over creating teams, issuing tokens for specific teams and who has access to a given token, it also allows you to go from a simple deployment using your file system as artifact storage to going full scale using a S3-compatible backend service.

Here is what is available for you:

  • Store artifacts
  • Cache busting
    • Automatic artifact busting to keep your disk or your S3 bill sane.
      • Configurable busting period via environment variable (see docker-compose.prod.yml)
  • Management via a Web UI for
    • Teams
    • Tokens
    • User sign-up/sign-in (Will refine this part with more permission controls)
  • Whether users can create accounts (Admin settings)

Web UI for managing accounts, tokens and roles

Turbo Racer provides a fully fledged Web UI for managing user accounts, roles and tokens for cache access and segmentation. Below you can see a few screenshots on how it looks like:

Teams Settings
Teams screen Settings screen
Tokens Users
Tokens screen Users screen

Admin account when running for the first time

Once you deploy Turbo Racer for the first time, you must create an admin account. The first account you signup with from the Sign up Web UI will be the system admin.

Admins can control whether users can create accounts so they can login and manage teams and tokens.

What is coming next

  • Statistics dashboard

Deploying to Production

Turbo Racer is designed to be deployed with Docker. The simplest way is to use docker-compose. Have a look at the docker-compose.prod.yml in the root directory for an deployment example.

Docker images

Whenever a new release is out, a new Docker image is built and pushed to Docker hub.
Here you can find the latest tags:

Deploy to Digital Ocean

You can use our Digital Ocean template to get this running quickly in a droplet.

Deploy to Digital Ocean

Dev Dependencies

To run this app locally, you need the following dependencies installed:

  • Elixir 1.14 and Erlang OTP 25
    • You can quickly do it with asdf. Once asdf is installed and then execute asdf install within the context of the turbo-racer directory. It will automatically pick up the right Elixir and Erlang versions defined in the .tool-versions file at the root of the repo.
  • Postgres 14
    • The simplest way is to have Docker installed and run docker-compose up. It will start up a Postgres container with a database ready for your dev server and for running tests.

Starting development

To start your Phoenix server:

  • Run mix setup to install and setup dependencies
  • Start Phoenix endpoint with mix phx.server or inside IEx with iex -S mix phx.server

Now you can visit localhost:4000 from your browser.

Running tests

Make sure that the Postgres container is running and execute mix test