Hello and welcome!
Your task is to create a simple REST API for a mini Translation Management System (TMS) plus the underlying MySQL database structure. You will have a Dockerized development environment as well as a couple of tools provided to get you started, however, you have full creative freedom in choosing the way you want to complete this task.
Please read the description carefully.
The goal of our little TMS is to allow multiple different Translation
texts in different Languages
to be linked to a single Key
. For example, you can have a Key
with the name main.title
with Hello world
and Hallo Welt
translations for English and German respectively.
In order to perform requests to the API, an authentication token must be provided. A token can have either read
or read/write
access.
You would need to create the following entities (feel free to add or modify them if you think it would benefit the final result):
- Has a name
- Has an ISO code
- Can be LTR (Left To Right by default) or RTL
- Has a text value
- Has a language associated with it
- Belongs to a
Key
- Has a unique name
- Has one translation per Language at all times
- Is unique
- Can have
read
orread/write
access
- API token authentication
- List available languages
- Manage
Keys
- List
- Retrieve
- Create
- Rename
- Delete
- Manage
Key
Translations
- Ability to update
Translation
value for any language for a given key
- Ability to update
- Export all
Keys
and theirTranslations
in.json
or.yml
format as azip
archive.json
export should have one file per language (e.g.[language-iso].json
) with the following format:{ <key.name>: <translation.value>, ... }
.yaml
export should contain all languages in a singletranslations.yaml
file with the following format:<language.iso>: <key.name>: <translation.value> ... <language2.iso>: <key.name>: <translation.value> ...
- This repository should be forked and the final result should be submitted as a link to that fork
- SQL of the final database structure/data should be included
- If you change the development environment, please make sure that you include some instructions on how to run the final result
- You can use any PHP framework that you are comfortable with (though using Symfony will be considered a plus)
- The quality and structure of the code is important, so use the best coding practices that you know
- Unit tests will be considered a plus
You can find a simple Dockerized development environment included with this assignment. Please follow the steps below to set it up (or use your own environment, however, please make sure to include instructions on how to run it).
Bonus: Linux Post-install
- Make sure that Docker is running
- Navigate to the project folder using a Terminal
- Run the
docker-compose up -d
command to bring the containers online
After making modifications to composer.json
you can run the docker-compose exec php bash -c "php composer.phar install"
command to perform the installation
The environment includes the phpmyadmin
tool. In order to access it, use the http://127.0.0.1:8080 URL. Use mysql
as the Server name, root
as the User and you can find the password inside the docker-compose.yml
file.
Use the http://127.0.0.1 URL to access your application