Skip to content

aivuk/phonetics

Repository files navigation

Phonetic API and frontend

Calculate if two separate list of words are homophones as:

Screenshot from 2023-08-27 23-32-15

Here is working demo.

API documentation here or here in redoc.

Running with docker-compose

First you do need to copy .env.sample to .env and change it if you want.

cp .env.sample .env

If you don't do the step above the database container will not be initialized. Just copy the file and run docker-compose build. Change docker-compose.yml if necessary, specially the services port number. Run it with:

$ docker-compose up

Running the API

Create first a python virtual environment and activate it:

  1. python -m venv ~/phonetic-env
  2. source ~/phonetic-env/bin/activate
  3. cd phoneticapi && pip install -r requirements.txt
  4. uvicorn main:app

Building the frontend

  1. cd phoneticapi-frontend
  2. yarn
  3. yarn run dev # or yarn run build

If you want to ran the development server with yarn run dev and use a running backend in the docker container you will need to change .env.development VITE_API_URL to point to your container address and port (if you haven't changed the docker-compose.yml this is 'http://localhost:8082').