Skip to content

Latest commit

 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Brel

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.

Known Limitations

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.

📁 Project Structure

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

Architecture Overview

This project uses a static architecture. All heavy processing is done remotely.

This allows:

  • modularization
  • simple maintanence
  • minimal server costs
  • simple deployment

API Version

  • Built with FastAPI library
  • Deployed on Render

Endpoints

  • POST /translate/

More detailed information on the api on https://brel.onrender.com/docs.

🔐 CORS

The API only allows requests from:

https://peramoniss.github.io

This prevents unauthorized usage while keeping the frontend functional.

Web app Version

  • built upon the api
  • user-friendly
  • allows the user to interactively change the lyrics
  • no file or terminal dependencies

Script Version

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

🚀 Deployment

Frontend

  • GitHub Pages

Backend

  • 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.

🤝 Contribute or Fork

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!

Test the app

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

📄 License

Personal project.


🗂️ Assets

Logo icon

About

A song translation system. Distributed through terminal, api, and through a web page. The name references Jacques Brel, the man whose lyrics inspired me to build this.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages