• Stars
    star
    1,146
  • Rank 39,065 (Top 0.8 %)
  • Language
    TypeScript
  • License
    BSD 3-Clause "New...
  • Created about 6 years ago
  • Updated 20 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The first developer-oriented translation tool. True asynchronous flow between translators and your team.


The first developer-oriented translation tool
True asynchronous flow between translators and your team.

Demo โ€ข Website โ€ข GraphiQL

Actions Status Coverage Status Join the chat at https://gitter.im/mirego/accent Docker Docker Registry

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

  1. The only external dependancy is a PostgreSQL database.
  2. Create a .env file. Example:
DATABASE_URL=postgresql://[email protected]/accent_development
DUMMY_LOGIN_ENABLED=1
  1. 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 ~> 24.0
  • elixir ~> 1.13
  • postgres >= 9.4
  • node.js >= 16.13
  • libyaml >= 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

  1. If you donโ€™t already have it, install nodejs with brew install nodejs
  2. If you donโ€™t already have it, install elixir with brew install elixir
  3. If you donโ€™t already have it, install libyaml with brew install libyaml
  4. If you donโ€™t already have it, install postgres with brew install postgres or the Docker setup as described below.
  5. Install dependencies with make dependencies
  6. Create and migrate your database with mix ecto.setup
  7. 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 GOOGLE_API_CLIENT_ID in the docker-compose.yml file.

  1. Run make build to build the OTP release with Docker
  2. Run make dev-start-postgresql to start an instance of Postgresql. The instance will run on port 5432 with the postgres user. You can change those values in the docker-compose.yml file.
  3. Run make dev-start-application to 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 in docker-compose.yml)

Thatโ€™s it! You now have a working Accent instance without installing Elixir or Node!

๐ŸŒณ 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

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.
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

Authentication setup

Various login providers are included in Accent using Ueberauth to abstract services.

Variable Default Description
DUMMY_LOGIN_ENABLED none If specified, the password-less authentication (with only the email) will be available.
GITHUB_CLIENT_ID none
GITHUB_CLIENT_SECRET none
GITLAB_CLIENT_ID none
GITLAB_CLIENT_SECRET none
GITLAB_SITE_URL https://gitlab.com
GOOGLE_API_CLIENT_ID none
GOOGLE_API_CLIENT_SECRET none
SLACK_CLIENT_ID none
SLACK_CLIENT_SECRET none
SLACK_TEAM_ID none
DISCORD_CLIENT_ID none
DISCORD_CLIENT_SECRET none
MICROSOFT_CLIENT_ID none
MICROSOFT_CLIENT_SECRET none
MICROSOFT_TENANT_ID none

Email setup

If you want to send emails, youโ€™ll have to configure the following environment variables:

Variable Default Description
MAILER_FROM none The email address used to send emails.
SENDGRID_API_KEY none Use SendGrid to send emails
MANDRILL_API_KEY none Use Mandrill to send emails
MAILGUN_API_KEY none Use Mailgun to send emails
SMTP_ADDRESS none Use an SMTP server to send your emails.
SMTP_API_HEADER none An optional API header that will be added to sent emails.
SMTP_PORT none The port ex: (25, 465, 587).
SMTP_PASSWORD none The password for authentification.
SMTP_USERNAME none The username for authentification.

Metrics and monitoring setup

If you want to track performance of Accent, you can configure NewRelic with the following environment variables:

Variable Default Description
NEW_RELIC_APP_NAME none Service APM name
NEW_RELIC_LICENSE_KEY none License key

Kubernetes helm chart setup

You can setup the project with a helm chart like this one. This project uses a fork by andreymaznyak and not this canonical repository. The specs and values may need to be updated if you use this repo.

โœ… Tests

API

Accent provides a default value for every required environment variable. This means that with the right PostgreSQL setup (and a few setup commands), you can just run mix test.

$ npm --prefix webapp run build
$ mix run ./priv/repo/seeds.exs
$ mix test

The full check that runs in the CI environment can be executed with ./priv/scripts/ci-check.sh.

๐Ÿš€ Deploy on Heroku

An Heroku-compatible app.json makes it easy to deploy the application on Heroku.

Deploy on Heroku

Using Heroku CLI

Based on this guide

$> heroku create
Creating app... done, โฌข peaceful-badlands-85887
https://peaceful-badlands-85887.herokuapp.com/ | https://git.heroku.com/peaceful-badlands-85887.git

$> heroku addons:create heroku-postgresql:hobby-dev --app peaceful-badlands-85887
Creating heroku-postgresql:hobby-dev on โฌข peaceful-badlands-85887... free
Database has been created and is available

$> heroku config:set FORCE_SSL=true DUMMY_LOGIN_ENABLED=true --app peaceful-badlands-85887
Setting FORCE_SSL, DUMMY_LOGIN_ENABLED and restarting โฌข peaceful-badlands-85887... done

$> heroku container:push web --app peaceful-badlands-85887
=== Building web
Your image has been successfully pushed. You can now release it with the 'container:release' command.

$> heroku container:release web --app peaceful-badlands-85887
Releasing images web to peaceful-badlands-85887... done

๐ŸŒŽ Contribute

Before opening a pull request, please open an issue first.

Once youโ€™ve made your additions and the test suite passes, go ahead and open a PR!

Donโ€™t forget to run the ./priv/scripts/ci-check.sh script to make sure that the CI build will pass :)

License

Accent is ยฉ 2015-2019 Mirego and may be freely distributed under the New BSD license. See the LICENSE.md file.

About Mirego

Mirego is a team of passionate people who believe that work is a place where you can innovate and have fun. Weโ€™re a team of talented people who imagine and build beautiful Web and mobile applications. We come together to share ideas and change the world.

We also love open-source software and we try to give back to the community as much as we can.

More Repositories

1

elixir-boilerplate

โš— The stable base upon which we build our Elixir projects at Mirego.
Elixir
1,084
star
2

activerecord_json_validator

๐Ÿ”ฉ ActiveRecord::JSONValidator makes it easy to validate JSON attributes against a JSON schema.
Ruby
383
star
3

mix_audit

๐Ÿ•ต๏ธโ€โ™€๏ธ MixAudit provides a mix deps.audit task to scan a project Mix dependencies for known Elixir security vulnerabilities
Elixir
310
star
4

gaffe

๐Ÿ’ฅ Gaffe handles Rails error pages in a clean, simple way.
Ruby
244
star
5

absinthe_error_payload

Bridges the gap between Ecto and Absinthe for mutation payload
Elixir
112
star
6

elixir-security-advisories

๐Ÿ›ก Public database of Elixir security advisories pulled from GitHub Advisory Database
Elixir
108
star
7

telemetry_ui

Telemetry based metrics UI. Take your telemetry metrics and display them in a web page.
Elixir
108
star
8

trikot

๐Ÿงถ Trikot is a framework that helps building Kotlin Multiplatform apps. iOS, Android and Web are the primary targets.
Kotlin
92
star
9

credo_naming

๐Ÿท A suite of Credo checks to enforce naming best practices in an Elixir project
Elixir
82
star
10

MCUIViewLayout

MCUIViewLayout is a category added over UIView to easily build layouts
Objective-C
77
star
11

react-boilerplate

โš› The stable base upon which we build our React projects at Mirego.
TypeScript
58
star
12

microscope

๐Ÿ”ฌ Microscope adds useful scopes targeting ActiveRecord boolean, date and datetime fields.
Ruby
55
star
13

emojimmy

[Deprecated] Emojimmy makes it possible to store emoji characters in ActiveRecord datastores that donโ€™t support 4-Byte UTF-8 Unicode (utf8mb4) encoding.
Ruby
49
star
14

killswitch

๐Ÿช† Killswitch is a clever control panel that allows mobile developers to apply runtime version-specific behaviors to their iOS or Android application.
Ruby
42
star
15

react-native-boilerplate

The stable base upon which we build our React Native projects at Mirego
TypeScript
38
star
16

ember-boilerplate

๐Ÿ‘“ The stable base upon which we build our Ember.js projects at Mirego.
TypeScript
35
star
17

ekiden

GitHub Actions self-hosted arm64 macOS runners
HCL
33
star
18

trikot.streams

Reactive Streams for Kotlin Multiplatform with mutability checks
Kotlin
33
star
19

partisan

๐Ÿšฉ Partisan is a Ruby library that allows ActiveRecord records to be followers and followables.
Ruby
33
star
20

MCUIImageAdvanced

Advanced and powerful functionality enhancements to UIImage
Objective-C
27
star
21

kmp-boilerplate

๐Ÿงฑ The stable base upon which we build our Kotlin Multiplatform projects at Mirego.
Kotlin
26
star
22

activerecord_sane_schema_dumper

๐Ÿ“ ActiveRecord::SaneSchemaDumper removes useless/harmful whitespace from Railsโ€™ generated `db/schema.rb` file.
Ruby
26
star
23

foreigner.js

Foreigner is a JavaScript library that will help you with translations.
JavaScript
25
star
24

bourgeois

๐ŸŽฉ Bourgeois is a Ruby library that makes using presenters a very simple thing.
Ruby
24
star
25

dispatch

๐Ÿฆ€ Dispatch makes sure pull requests within a GitHub organization get reviewed by the right people.
Elixir
24
star
26

trikot.viewmodels

Meta abstraction of visual components for Kotlin Multiplatform
Kotlin
23
star
27

MCUIColorUtils

UIColor missing methods
Objective-C
22
star
28

MCAWSS3Client

Amazon S3 client based on AFHTTPClient
Objective-C
22
star
29

MCDateExtensions

Extensions on the dates classes
Objective-C
21
star
30

phare

๐Ÿšจ Phare looks into your files and check for coding style errors.
Ruby
21
star
31

hanzo

๐Ÿ”ช Hanzo is a sharp tool to handle deploying an application on Heroku on multiple environments.
Ruby
20
star
32

trikot.foundation

Core utilities for Kotlin Multiplatform
Kotlin
20
star
33

simple-css-reset

๐ŸŽ A simple, no-nonsense CSS reset stylesheet to use as an NPM dependency.
CSS
20
star
34

active_model_serializers_validator

๐Ÿƒ An extension to ActiveModel::Serializer that validates serializers output against a JSON schema
Ruby
18
star
35

illusionist

[Deprecated] Illusionist will make you believe ES6 is already available in browsers
JavaScript
18
star
36

ember-best-language

๐Ÿณ A FastBoot-enabled addon to detect the best language for your user.
TypeScript
18
star
37

MCAnimationView

UIImageView alternative for animations that don't need to load all the images in memory at once and provide callbacks when the animation is done.
Objective-C
16
star
38

trikot.http

HTTP networking abstraction for Kotlin Multiplatform
Kotlin
15
star
39

camaraderie

๐Ÿ‘ฌ Camaraderie takes away the pain of managing membership stuff between users and organizations.
Ruby
15
star
40

emotions

๐ŸŽญ Allow ActiveRecord records to express (and hopefully store) emotions (eg. `happy`, `sadness`, `surprise`, etc.) about other records.
Ruby
14
star
41

trikot.patron

Kotlin Multiplatform Sample Project using Trikot libraries
Kotlin
13
star
42

absinthe_security

AbsintheSecurity provides utilities to improve the security posture of APIs built with Absinthe GraphQL.
Elixir
12
star
43

MCColoredPageControl

Fully customizable alternative to UIPageControl
Objective-C
11
star
44

taylor-ios

iOS Framework with a bunch of classes and helpers for Swift.
Swift
11
star
45

sprockets-illusionist

[Deprecated] Transpile your ES6 files into ES5 using the Illusionist node module and Sprockets
Ruby
11
star
46

rack-locale-root-redirect

๐ŸŽŒ Rack::LocaleRootRedirect uses Rack:Accept to map '/' to a path based on the Accept-Language HTTP header.
Ruby
11
star
47

plug_image_processing

Endpoint to process images within your Plug application, compatible with imaginary API
Elixir
10
star
48

parole

๐Ÿ’ฌ Parole adds the ability to comment on ActiveRecord records
Ruby
10
star
49

louche

๐Ÿ“‹ Louche provides common validators for ActiveModel/ActiveRecord classes
Ruby
9
star
50

kotlin-ssml-dsl

A kotlin DSL for SSML, supports Actions-on-google.
Kotlin
9
star
51

trikot.kword

Localization library for Kotlin Multiplatform. Tailor-made for Accent.
Kotlin
9
star
52

encore

[Deprecated] Encore provides serializers and persisters to build JSON API-compliant Web services with Ruby on Rails.
Ruby
9
star
53

MCDebuggingTools

A collection of cool debugging tools
Objective-C
9
star
54

accent-cli

Sync, merge and export with the Accent API.
TypeScript
8
star
55

halfday

โ›ณ Collection of Capistrano recipes โ€” Deploy. Then, take a halfday.
Ruby
7
star
56

html_test_helpers

HTMLTestHelpers provides function helpers for unit testing allowing easy assertions for HTML elements data queried by data-testid attribute.
Elixir
7
star
57

mirego-open-web

Mirego โค๏ธ Open source (libraries & tools for everyone to use!)
JavaScript
6
star
58

html_test_identifiers

HTMLTestIdentifiers provides the basic functionality to add data-testid attribute depending on configuration.
Elixir
5
star
59

ember-cli-graphql-file

An addon to precompile your `.graphql` files with `graphql-tag` and turn them into importable modules.
JavaScript
5
star
60

csgames17-competition

CS Games 2017 Mobile Competition http://2017.csgames.org
Swift
5
star
61

trikot.analytics

Elegant implementation of multiplatform analytics in ReactiveStreams.
Kotlin
5
star
62

activerecord_strict_validations

๐Ÿšง ActiveRecord::StrictValidations adds validations to ActiveRecord models to make sure they donโ€™t trigger database errors.
Ruby
5
star
63

konnectivity

๐Ÿ“ก A lightweight Kotlin Multiplatform library to monitor network state changes
Kotlin
5
star
64

MCHTTPRequestLogger

Output HTTP requests made with AFNetworking in the debug console
Objective-C
4
star
65

csgames16-competition

CS Games 2016 Mobile Competition
Swift
4
star
66

ember-cli-foreigner

ember-cli-foreigner is a set of helpers and mixins to interface with the foreigner.js library in Ember.
JavaScript
4
star
67

csgames-sample-ios

CS Games - Sample iOS App
3
star
68

ember-chai-dom-helpers

A set of Chai helpers ready for your DOM.
JavaScript
3
star
69

compose-utils

Compose Utils is a library that contains several helpful components and extension methods to help you build the best Compose layouts.
Kotlin
3
star
70

csgames-sample-mobile

CS Games - Sample Mobile App
Swift
3
star
71

stylelint-mirego

๐Ÿ’… A collection of Stylelint rules that help our code meet our code styling guidelines.
JavaScript
3
star
72

react-native-killswitch

The official React Native implementation of Miregoโ€™s killswitch
TypeScript
3
star
73

ember-cli-pod-translations

An addon to compile your locale files inside pods.
JavaScript
2
star
74

trikot.datasources

Datasource and cache layers for Kotlin Multiplatform
Kotlin
2
star
75

csgames19-competition

CS Games 2019 Mobile Competition http://2019.csgames.org
Swift
2
star
76

fastlane-toolkit

Boilerplate for faster fastlane integration
Ruby
2
star
77

MCForms-iOS

Forms engine for iOS in Swift
Swift
2
star
78

MRGLaunchImageViewController

A view controller that displays the launch image to ease your transitions at app launch
Objective-C
2
star
79

csgames-sample-android

CS Games - Sample Android App
2
star
80

MCKillSwitch

MCKillSwitch is the official kill switch to use with Miregoโ€™s backend implementation
Objective-C
2
star
81

swiftui-utils

Swift
2
star
82

debug-panel

A Kotlin Multiplatform library that allows mobile developers to generate boilerplate code to display a debug panel with different component types.
Kotlin
2
star
83

MRGPagerController

An highly customizable pager controller
Objective-C
1
star
84

csgames18-competition

CS Games 2018 Mobile Competition http://2018.csgames.org
Java
1
star
85

ember-cli-encore

[Deprecated] ember-cli-encore is an adapter and a serializer to use with the Encore gem.
JavaScript
1
star
86

MRGPDFKit

A simple objective-C Toolkit to fill PDF forms.
Objective-C
1
star
87

csgames18-precompetition

CS Games 2018 Mobile Pre-competition
Swift
1
star
88

carlito

A Chrome extension to switch from Core to iOS / Android repositories
JavaScript
1
star
89

MRGDiagnostics

An iOS framework that offers you an easy way to add a diagnostics view to your iOS project.
Swift
1
star
90

MRGControlPanel

The Control panel of your dream.
Objective-C
1
star
91

ember-encore

[Deprecated] EmberEncore is an adapter and a serializer to use with the Encore gem.
JavaScript
1
star
92

MRGArchitect

Provides your app with device-agnostic measurements.
Objective-C
1
star
93

heroku-buildpack-bower

Install Bower and Bower components
1
star
94

minimal-json

[Fork] Optimized version of minimal-json, a fast and small JSON parser and writer for Java.
Java
1
star
95

killswitch-mobile

Multiplatform library for using the Mirego Killswitch inside mobile applications
Kotlin
1
star
96

patch-patch

[Deprecated] PatchPatch changes Railsโ€™ default behavior of mapping PUT and PATCH requests on resources to the same action.
Ruby
1
star