The app can be run as a standalone or using Docker, unless you are working on an machine running linux/ubuntu, it is adviseable to use Docker.
To run the app in production, see here.
For any errors during setup, please see the debugging doc.
Review the project details doc for more information on the technology stack.
Take note of the Client and Server README's.
The better/easier way to run the app is to use Docker, which will build both the frontend and the backend with the correct enviroment setup.
Ensure you have docker
& docker-compose
installed on your computer, you can check with the following commands:
docker --version
docker-compose --version
If the above commands return an error, please install Docker and Docker-compose.
To build the app, from the root project directory, run the following command:
docker-compose -f docker-compose.yml up -d --build
Docker should create a container named 'masakhane-web' with the images 'db-1', 'server-1', and 'client-1'.
The server should be active on http://localhost:5000 and the client on http://localhost:3000
Look here for checking these services manually.
To shut down the app, run the following command to remove the docker container:
docker-compose -f docker-compose.yml down
Add a Language
docker-compose -f docker-compose.yml exec server python manage.py add_language en-sw-JW300
The language code parameter en-sw-JW300
represents {src-lang}-{tgt-lang}-{shortform}
So en-sw-JW300
represents English-Swahili using JW300 shortform
Note - A code parameter example without shortform is en-tiv-
Download available languages csv here
Update Langugaes
curl --request GET 'http://127.0.0.1:5000/update'
Check available languages
docker-compose -f docker-compose.yml exec server python manage.py all_languages
Remove a language
docker-compose -f docker-compose.yml exec server python manage.py remove_language en-sw-JW300
docker-compose -f docker-compose.yml exec server python manage.py tests
Look here for more information about accessing the database
In order to run the app, we need to set up the backend and frontend seperately.
Note It is advisable to be working on an linux/ubuntu machine.
First, ensure you are running Python 3.6.9
Within the src/server
directory of the project
Install required packages:
pip install -r requirements.txt
Run the following commands:
export FLASK_APP=core/__init__.py
export FLASK_ENV=development
To start the API and database services, run the command:
python manage.py run
Look here for more information about accessing the database
Add a Language
python manage.py add_language en-sw-JW300
The language code parameter en-sw-JW300
represents {src-lang}-{tgt-lang}-{shortform}
So en-sw-JW300
represents English-Swahili using JW300 shortform
Note - A code parameter example without shortform is en-tiv-
Download available languages csv here
Update Langugaes
curl --request GET 'http://127.0.0.1:5000/update'
Check available languages
python manage.py all_languages
Remove a language
python manage.py remove_language en-sw-JW300
python manage.py tests
The API is available at http://localhost:5000
, see notable API endpoints here
Ensure you have node.js and yarn installed
Within the src/client/
directory of the project:
Install required packages:
npm install --legacy-peer-deps
Run the following commands:
npm i webpack webpack-cli --legacy-peer-deps
npm i @babel/core @babel/preset-env @babel/preset-react babel-loader --legacy-peer-deps
To start the client , run the command:
npm run develop
The client is available at http://localhost:3000
If there was a problem during setup, review this doc for possible errors and solutions.