The first developer-oriented translation tool
True asynchronous flow between translators and your team.
[Demo](https://accent-demo.fly.dev) • [Website](https://www.accent.reviews) • [GraphiQL](http://demo.accent.reviews/graphiql/)
[![Actions Status](https://github.com/mirego/accent/workflows/CI/badge.svg)](https://github.com/mirego/accent/actions)
[![Coverage Status](https://coveralls.io/repos/github/mirego/accent/badge.svg?branch=master)](https://coveralls.io/github/mirego/accent?branch=master) [![Join the chat at https://gitter.im/mirego/accent](https://badges.gitter.im/mirego/accent.svg)](https://gitter.im/mirego/accent?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Docker](https://img.shields.io/badge/docker-mirego/accent-blue.svg)](https://hub.docker.com/r/mirego/accent/)
[![Docker Registry](https://img.shields.io/docker/pulls/mirego/accent.svg)](https://hub.docker.com/r/mirego/accent/)
Accent provides a powerful abstraction around the process maintaining translations in a web/native app.
- **History**. Full history control and actions rollback. _Who_ did _what_, _when_.
- **UI**. Simple yet powerful UI to enable translator and developer to be productive.
- **CLI**. [Command line tool](https://github.com/mirego/accent/tree/master/cli) to easily add Accent to your developer flow.
- **Collaboration**. Centralize your discussions around translations.
- **GraphQL**. The API that powers the UI is open and documented. It’s easy to build a plugin/cli/library around Accent.
## Contents
| Section | Description |
| --------------------------------------------------- | -------------------------------------------------------------------- |
| [🚀 Getting started](#-getting-started) | Quickly setup a working app |
| [🚧 Requirements](#-requirements) | Dependencies required to run Accent’ stack |
| [🎛 Mix commands](#-executing-mix-commands) | How to execute mix task with the Twelve-Factor pattern |
| [🏎 Quickstart](#-quickstart) | Steps to run the project, from API to webapp, with or without Docker |
| [🌳 Environment variables](#-environment-variables) | Required and optional env var used |
| [✅ Tests](#-tests) | How to run the extensive tests suite |
| [🚀 Heroku](#-deploy-on-heroku) | Easy deployment setup with Heroku |
| [🌎 Contribute](#-contribute) | How to contribute to this repo |
## 🚀 Getting started
Easiest way to run an instance of Accent is by using the offical docker image: https://hub.docker.com/r/mirego/accent
1. The only external dependancy is a PostgreSQL database.
2. Create a `.env` file. Example:
```
DATABASE_URL=postgresql://postgres@docker.for.mac.host.internal/accent_development
DUMMY_LOGIN_ENABLED=1
```
3. Run the image
```shell
$ docker run --env-file .env -p 4000:4000 mirego/accent
```
This will start the webserver on port 4000, migrate the database to have an up and running Accent instance!
## 🚧 Requirements
- `erlang ~> 26.1`
- `elixir ~> 1.15`
- `postgres >= 9.4`
- `node.js >= 16.19`
- `libyaml >= 0.1.7`
## 🎛 Executing mix commands
The app is modeled with the [_Twelve-Factor App_](https://12factor.net/) architecture, all configurations are stored in the environment.
When executing `mix` commands, you should always make sure that the required environment variables are present. You can `source`, use [nv](https://github.com/jcouture/nv) or a custom l33t bash script.
Every following steps assume you have this kind of system.
But Accent can be run with default environment variables if you have a PostgreSQL user named `postgres` listening on port `5432` on `localhost`.
### Example
With `nv` you inject the environment keys in the context with:
```shell
$ nv .env mix