Somali News Translator Prototype
# AI Translator News Prototype
The AI Translator News Prototype is a platform for publishing and translating news articles from English to Somali using the `facebook/nllb-200-distilled-600M` model. The backend is built with Django, connected to an external Render PostgreSQL database, while the frontend uses React with Vite. This guide explains how to set up and run the project locally using Docker.
## Table of Contents
- Prerequisites
- Project Structure
- Setup Instructions
- 1. Clone the Repository
- 2. Set Up the `.env` File
- 3. Generate `package-lock.json` for Frontend
- 4. Build and Start Containers
- 5. Create a Superuser
- 6. Access the Application
- 7. Test Translation
- Development Notes
- Troubleshooting
- Frontend Build Fails
- Backend Build Slow
- Database Connection Issues
- Translation Errors
- Deployment
## Prerequisites
Before starting, ensure you have:
- **Docker and Docker Compose**: Install Docker.
- **Node.js**: Optional, for local `package-lock.json` generation.
- **.env File**: Provided separately, containing `DATABASE_URL` and `SECRET_KEY`.
## Project Structure
- **`Backend/`**: Django backend with translation logic and API endpoints.
- **`Frontend/`**: React + Vite frontend for the user interface.
- **`docker-compose.yml`**: Configuration for backend and frontend services.
## Setup Instructions
### 1. Clone the Repository
Clone the project and navigate to the directory:
```bash
git clone
cd AI_translator
2. Set Up the .env File
Copy the provided .env file to the Backend/ directory:
bash
cp /path/to/provided/env/file Backend/.env
The .env file should include:
text
DATABASE_URL=postgresql://newsdb_zlju_user: @
dpg-d17t5kbuibrs738427ig-a.…
SECRET_KEY=
Warning: Never commit the .env file to Git. Confirm Backend/.env is in .gitignore.
3. Generate package-lock.json for Frontend
Navigate to the Frontend/ directory and install dependencies:
bash
cd Frontend
npm install
This creates package-lock.j …