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-backend
python -m venv venv
source venv/bin/activate # On macOS/Linux
venv\Scripts\activate # On Windows
pip install -r requirements.txt
python app.py
This will create users.db
and necessary tables.
python app.py
The 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! 🚀