{"id":21467501,"url":"https://github.com/alexandergarifullin/paralleltranslator","last_synced_at":"2025-10-04T20:31:41.455Z","repository":{"id":251975287,"uuid":"837270094","full_name":"AlexanderGarifullin/ParallelTranslator","owner":"AlexanderGarifullin","description":"A web application for translating a set of words into another language using concurrency and an external translation service","archived":true,"fork":false,"pushed_at":"2024-08-06T20:00:12.000Z","size":101,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-17T06:12:49.402Z","etag":null,"topics":["api","concurrency","java17","mymemory-api","postgresql","resttemplate","spring-boot","web"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AlexanderGarifullin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-02T15:19:14.000Z","updated_at":"2024-12-18T15:42:06.000Z","dependencies_parsed_at":"2024-08-06T23:21:34.825Z","dependency_job_id":null,"html_url":"https://github.com/AlexanderGarifullin/ParallelTranslator","commit_stats":null,"previous_names":["alexandergarifullin/paralleltranslator"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AlexanderGarifullin/ParallelTranslator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexanderGarifullin%2FParallelTranslator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexanderGarifullin%2FParallelTranslator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexanderGarifullin%2FParallelTranslator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexanderGarifullin%2FParallelTranslator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlexanderGarifullin","download_url":"https://codeload.github.com/AlexanderGarifullin/ParallelTranslator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexanderGarifullin%2FParallelTranslator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278368623,"owners_count":25975476,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","concurrency","java17","mymemory-api","postgresql","resttemplate","spring-boot","web"],"created_at":"2024-11-23T08:18:21.823Z","updated_at":"2025-10-04T20:31:41.118Z","avatar_url":"https://github.com/AlexanderGarifullin.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ParallelTranslator\n\nParallel Translator is a web application built with Java and Spring Boot for translating a set of words into another language using a third-party translation service [MyMemory API](https://mymemory.translated.net/doc/spec.php). Each word is translated in separate threads with a maximum of 10 concurrent threads. The application also logs translation requests to a PostgreSQL database.\n\n## Technologies\n\n- Java 17\n- Spring Boot 3.3.2\n- PostgreSQL 16\n- JDBC\n- RestTemplate\n- Docker\n- HTML + JS\n\n## Requirements\n\n- Java 17\n- Maven\n- Docker and Docker Compose\n\n## Installation and Setup\n\n1. **Clone the repository:**\n\n    ```sh\n    git clone https://github.com/AlexanderGarifullin/ParallelTranslator.git\n    cd ParallelTranslator\n    ```\n\n2. **Build the project using Maven:**\n\n    ```sh\n    ./mvnw clean package\n    ```\n\n3. **Run the application using Docker Compose:**\n\n    ```sh\n    docker-compose build --no-cache\n    docker-compose up\n    ```\n\n4. **Shut down the application:**\n\n    ```sh\n    docker-compose down\n    ```\n\n## Usage\n\nOnce the application is running, it will be accessible at [http://localhost:8080/api/translate](http://localhost:8080/api/translate).\n\n### Web Interface\n\nHere is a screenshot of the main page of the web application:\n\n![Main Page Screenshot](assets/mainPage.png)\n\nIf you navigate to a non-existent page, you will see a custom error page. For example, try visiting [http://localhost:8080/nonexistent](http://localhost:8080/nonexistent).\n\n![Error Page Screenshot](assets/errorPage.png)\n\n### API Endpoints\n\n#### Translate Text\n\n- **Endpoint:** `/api/translate`\n- **Method:** POST\n- **Request Body:**\n    ```json\n    {\n        \"text\": \"your text here\",\n        \"sourceLang\": \"en\",\n        \"targetLang\": \"es\"\n    }\n    ```\n- **Response:**\n    ```json\n    \"your translated text here\"\n    ```\n\n### Example\n\n1. **Send a translation request:**\n\n    ```sh\n    curl -X POST -H \"Content-Type: application/json\" -d '{\"text\": \"hello world\", \"sourceLang\": \"en\", \"targetLang\": \"es\"}' http://localhost:8080/api/translate\n    ```\n\n2. **Response:**\n    ```json\n    \"hola mundo\"\n    ```\n\n## Accessing the Database\n\nYou can view the PostgreSQL database this way:\n\n1. **Access the PostgreSQL container:**\n    ```sh\n    docker exec -it postgres psql -U postgres -d TranslatorDB\n    ```\n\n2. **List all entries in `api_translation_requests_logs`:**\n    ```sql\n    SELECT * FROM api_translation_requests_logs;\n    ```\n\n3. **Exit the PostgreSQL command line:**\n    ```sh\n    \\q\n    ```\n\n## Viewing Javadoc\n\nTo view the Javadoc documentation:\n\n1. **Generate Javadoc:**\n\n   Run the following Maven command to generate the Javadoc:\n\n    ```sh\n    ./mvnw javadoc:javadoc\n    ```\n\n2. **Navigate to the Javadoc directory:**\n\n   The Javadoc will be generated in the `target/site/apidocs` directory.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n## Additional Information\n\n- The application is designed to handle translation of individual words concurrently using up to 10 threads.\n- All translation requests are logged into the `api_translation_requests_logs` table with the following structure:\n    - `id` (integer, primary key)\n    - `client_ip` (varchar(45), not null)\n    - `text` (text, not null)\n    - `translated_text` (text, not null)\n    - `created_at` (timestamp, default current timestamp)\n\n## Contact\n\nFor any issues or questions, please open an issue on GitHub or contact me.\n\n---\n\n© 2024 Alexander Garifullin. All rights reserved.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexandergarifullin%2Fparalleltranslator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexandergarifullin%2Fparalleltranslator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexandergarifullin%2Fparalleltranslator/lists"}