With Heroku's change of free plan, this project no longer works.
Simple web application and API to learn Toki Pona from a corpus of sentences and their English translations.
- Filter by jan Pije's lessons if you are learning along.
- Choose between translating English to Toki Pona or the other way around.
- Found an error? Improve the original sentences on Tatoeba.
The Python 3 scripts need a few libraries available from requirements.txt
. The recommended way to install these is with a virtualenv. After setting it up, run:
pip install -r requirements.txt
When working on the frontend, get dependencies from package*.json
into node_modules/
with npm
as usual:
npm install
The rest of the project is structured as follows:
app.py
: Main Flask application.scripts/
: Database definitions and auxiliary scripts, such as scripts to download translations and insert to PostgreSQL. See the README for more information.Procfile
andapp.json
: Heroku's application and manifest files, respectively..circleci
: CircleCI script to re-populate database every week.src/
,public/
, and*.js
: Frontend content and configuration, such as VueJS, PostCSS, TailwindCSS...
When running the Flask API, use these environment variables:
DATABASE_URL
(required): A PostgreSQL URI in the formatpostgresql://[user[:password]@][netloc][:port][/dbname]
DEBUG
(optional): Sets Flask to debug mode. Useful for development, but must not be used in production mode.SECRET_KEY
(required for production): Flask's secret key, optional for development. Seeapp.json
for more information.
When running the VueJS frontend, use these environment variables:
VUE_APP_API_URL
(required for production): Base URL for the API. If unset, it will use Flask's default development location (http://127.0.0.1:5000/
).
The application and PostgreSQL database are hosted in Heroku with their free plans.
The translation files are provided by Tatoeba under CC BY 2.0 FR.