Accent
The first developer-oriented translation tool. True asynchronous flow between translators and your team.
Install / Use
/learn @mirego/AccentREADME
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 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 | Quickly setup a working app | | 🚧 Requirements | Dependencies required to run Accent’ stack | | 🎛 Mix commands | How to execute mix task with the Twelve-Factor pattern | | 🏎 Quickstart | Steps to run the project, from API to webapp, with or without Docker | | 🌳 Environment variables | Required and optional env var used | | ✅ Tests | How to run the extensive tests suite | | 🚀 Heroku | Easy deployment setup with Heroku | | 🌎 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
- The only external dependancy is a PostgreSQL database.
- Create a
.envfile. Example:
DATABASE_URL=postgresql://postgres@docker.for.mac.host.internal/accent_development
DUMMY_LOGIN_ENABLED=1
# Required for session management. Must be a 64-byte string.
# Generate one using: openssl rand -hex 64
SECRET_KEY_BASE=KEY
- Run the image
$ 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.1elixir ~> 1.15postgres >= 9.4node.js >= 16.19libyaml >= 0.1.7
🎛 Executing mix commands
The app is modeled with the Twelve-Factor App 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 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:
$ nv .env mix <mix command>
🏎 Quickstart
This is the full development setup. To simply run the app, see the Getting started instructions
- If you don’t already have it, install
nodejswithbrew install nodejs - If you don’t already have it, install
elixirwithbrew install elixir - If you don’t already have it, install
libyamlwithbrew install libyaml - If you don’t already have it, install
postgreswithbrew install postgresor the Docker setup as described below. - Install dependencies with
make dependencies - Create and migrate your database with
mix ecto.setup - Start Phoenix endpoint with
mix phx.server
That’s it! You should now be able to open the app at http://localhost:4000
Makefile
The Makefile should be the main entry for common tasks such as tests, linting, Docker, etc. This simplifies the development process since you don’t have to search for which service provides which command. mix, npm, prettier, docker, stylelint, etc are all used in the Makefile.
Docker
For the production setup, we use Docker to build an OTP release of the app. With docker-compose, you can run the image locally. Here are the steps to have a working app running locally with Docker:
When running the production env, you need to provide a valid authentication setup in the environment section in docker-compose.yml file.
See the following sections to see available variables to enable third-party logins or dummy login (email only, no password).
- Run
make buildto build the OTP release with Docker - Run
make dev-start-postgresqlto start an instance of Postgresql. The instance will run on port 5432 with thepostgresuser. You can change those values in thedocker-compose.ymlfile. - Run
make dev-start-applicationto start the app! The release hook of the release will execute migrations and seeds before starting the webserver on port 4000 (again you can change the settings indocker-compose.yml)
That’s it! You now have a working Accent instance without installing Elixir or NodeJS!
🌳 Environment variables
Accent provides a default value for every required environment variable. This means that with the right PostgreSQL setup, you can just run mix phx.server.
| Variable | Default | Description |
| ----------------- | ----------------------------------------- | ------------------------------------------------------- |
| DATABASE_URL | postgres://localhost/accent_development | A valid database URL |
| PORT | 4000 | A port to run the app on |
| SECRET_KEY_BASE | DEFAULT_UNSAFE_KEY | The secret key that is used to encrypt session (cookie) |
| SIGNING_SALT | DEFAULT_UNSAFE_SALT | The salt used to sign session cookies |
Production setup
| Variable | Default | Description |
| ----------------------------------------- | -------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| RESTRICTED_PROJECT_CREATOR_EMAIL_DOMAIN | none | If specified, only authenticated users from this domain name will be able to create new projects. |
| FORCE_SSL | false | If the app should always be served by https (and wss for websocket) |
| SENTRY_DSN | none | The secret Sentry DSN used to collect API runtime errors |
| WEBAPP_SENTRY_DSN | none | The public Sentry DSN used to collect Webapp runtime errors |
| CANONICAL_URL | none | The URL of the app. Used in sent emails and to redirect from external services to the app in the authentication flow. |
| DISABLE_CANONICAL_HOST_REDIRECT | none | Remove the redirect to the canonical host URL. Use with caution. |
| STATIC_URL | none | The URL of the app. Default to the CANONICAL_URL value. |
| WEBAPP_SKIP_SUBRESOURCE_INTEGRITY | none | Remove integrity attributes on link and script tag. Useful when using a proxy that compress resources before serving them. |
| DATABASE_SSL | false | If SSL should be used to connect to the database |
| DATABASE_POOL_SIZE | 10 | The size of the pool used by the database connection module |
| MACHINE_TRANSLATIONS_VAULT_KEY | DEFAULT_UNSAFE_VAULT_KEY | The secret key that is used to encrypt machine translations services config key
Related Skills
node-connect
343.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
92.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
343.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
343.3kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
