Brel is an automatic song translation system. It is distributed as a terminal app, an API, and a webpage. The name references Jacques Brel, who inspired the development of this app.
Since the project is built upon free of charge software, multiple languages are not supported. Romaji writing in Japanese also has very poor translation, so prefer using native alphabets instead.
The project is split into:
- a static front-end (GitHub Pages)
- a Python API (Render)
The folder structure of the source project is as follows:
Brel/
│
├── api/ # Python API
│ ├── src/
│ │ ├── app.py # FastAPI application
│ ├ ├── test.py # Quick test script
│ └────requirements.txt
│
├── script/ # Terminal version
│ ├── html/ # Store HTMLs generated
│ ├── originals/ # Stores txt files with song lyrics
│ └── local.py # The terminal app
│
├── www/
│└──index.html # Web app
│
└── README.md
This project uses a static architecture. All heavy processing is done remotely.
This allows:
- modularization
- simple maintanence
- minimal server costs
- simple deployment
- Built with FastAPI library
- Deployed on Render
- POST /translate/
More detailed information on the api on https://brel.onrender.com/docs.
The API only allows requests from:
https://peramoniss.github.io
This prevents unauthorized usage while keeping the frontend functional.
- built upon the api
- user-friendly
- allows the user to interactively change the lyrics
- no file or terminal dependencies
The script version is terminal-based and was developed to make an easily modifiable script so that you can massively generate translated versions of songs. It has a txt file as input and outputs an HTML to visualize the translation. It uses terminal arguments that allow to configure several details of the HTML. To learn what you can do with it, run:
cd script
python local.py --help
- GitHub Pages
- Render (Free Tier)
- Auto-deploy on new commits
- Hosted in Virginia (USA)
- API start command is:
cd api
uvicorn src.app:app --host 127.0.0.1 --port 8000
The API may take around 50 seconds to wake up after inactivity.
To make contribute, you must:
- Fork the repository
- Clone the forked repository to your local machine
- Set the remote in your development environment
- Program your changes
- Stage and commit them
- Push the changes to the GitHub repository
If this is your own version, you will already have it up and running after GitHub pages is deployed!
If you want to contribute, GitHub will show you a button suggesting a Pull Request. Click it and I'll analyze the contribution!
While developing, you can run the API locally for testing using:
cd api
uvicorn src.app:app --reload
After that, use "Run Live" extension or any other local webserver application to open a local server containing the index.html.
You can also test the api by simply running:
cd api
python test.py
Or test the script version by using:
cd script
python local.py "originals/Mathilde - Jacques Brel.txt" --lang=en
Personal project.