Follow the steps below to set up and run the translation app backend.
- Python 3.x installed
- pip installed
git clone https://github.com/Shaganashree97/translator.git
cd translator-backendpython -m venv venv
source venv/bin/activate # On macOS/Linux
venv\Scripts\activate # On Windowspip install -r requirements.txtpython app.pyThis will create users.db and necessary tables.
python app.pyThe backend will start on http://0.0.0.0:5000.
- Register:
POST /register(Sendusername&password) - Login:
POST /login(Returns token)
- Get Languages:
GET /languages - Translate Text:
POST /translate(Requirestext&target_language)
- Get History:
GET /history(Requires authentication)
curl -X POST http://localhost:5000/register -H "Content-Type: application/json" -d '{"username":"test","password":"1234"}'Press CTRL+C to stop the running server.
Now your backend is ready to use! 🚀