zeeguu / api

API for tracking a learner's progress when reading materials in a foreign language and recommending further personalized exercises and readings.
https://zeeguu.org
MIT License
8 stars 24 forks source link

Zeeguu-API Build Status

Zeeguu-API is an open API that allows tracking and modeling the progress of a learner in a foreign language with the goal of recommending paths to accelerate vocabulary acquisition.

The API is also currently deployed as the backend for the zeeguu.org website.

Overview

The API offers translations for the words that a learner encounters in their readings. The history of the translated words and their context is saved and used to build a dynamic model of the user knowledge. The context is used to extract the words the user knows and their topics of interest.

A teacher agent recommends the most important words to be studied next in order for the learner to accelerate his vocabulary retention. This information can be used as input by language exercise applications, for example interactive games.

A text recommender agent crawls websites of interest to the user and recommend materials to read which are in the zone of proximal development.

Read More

To read more about the API see the article published about Zeeguu in the CHI'18 conference.

Development Notes

Once you clone the repo, please run:

git config --local core.hooksPath .githooks/

This will make the rules in the .githooks/rules folder be run before every commit. The rules check for well-known bugs and code conventions.

Prerequisites

  1. Install docker on your machine. For Ubuntu you can run the following:
sudo apt-get install docker.io -y

With MySQL Locally

This is useful for MacOS machines (M1 and later) on which MySQL does not seem to be running within docker

  1. Create a zeeguu_test DB
  1. Build the zeguu_api_dev development image

    docker build -f Dockerfile.development -t zeeguu_api_dev .

  2. Run the _playground.py to ensure that you have something in the DB

    docker-compose up dev_play

    To ensure that the changes to the files on your local dev machine are reflected inside the container try to modify something in the tools\_playground.py file and rerun this command. Do you see the changes? That's good.

  3. Run the development server inside of the container

    docker-compose up dev_server

    to test it open http://localhost:9001/available_languages in your browser and you should be able to see a list of language codes that are supported by the system

  4. Test the deployment

    docker-compose up dev_test

Note

Running from a docker image, at least on my M1 Max from 2021, is terribly slow. The _playground.py script takes 1s natively and 6s in Docker. Tests natively are 22s and in Docker are 280s! So for running the development server this is ok, but for actual development, this might be quite annoying :(

From docker-compose on Mac OS

Starting the API

Developing

Once you make changes to the code you have to restart the apache2ctl inside the container. To test this do the following:

That's all. Go have fun!

Further Notes

Running MySQL locally, not in a container on a mac

(Mircea, Feb 2024)

On Mac, if you want to run mysql locally, and not from within Docker, you need to install mysql-client with brew:

brew install mysql-client

Mircea: On my M2 mac the pip instal mysqlclient (called indirectly via pip install -r requirements) still fails till I define the following:

export MYSQLCLIENT_CFLAGS="-I/opt/homebrew/opt/mysql-client/include/mysql/"
export MYSQLCLIENT_LDFLAGS="-L/opt/homebrew/opt/mysql-client/lib -lmysqlclient"

Connecting and loading a database in DBeaver