{"id":33261997,"url":"https://github.com/artemlymarenko/parallel-course-work","last_synced_at":"2026-05-12T23:06:53.048Z","repository":{"id":259012863,"uuid":"876109203","full_name":"ArtemLymarenko/parallel-course-work","owner":"ArtemLymarenko","description":"This repo contains UML diagrams and source code for the parallel computing course work.","archived":false,"fork":false,"pushed_at":"2025-01-06T22:32:49.000Z","size":2644,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-17T04:09:03.452Z","etag":null,"topics":["concurrent-map","coursework","docker-compose","golang","htmx","tcp-client","tcp-server","threadpool","university"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ArtemLymarenko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-10-21T12:17:55.000Z","updated_at":"2025-01-25T15:18:12.000Z","dependencies_parsed_at":"2024-12-12T18:28:15.228Z","dependency_job_id":"00431d34-af4f-4582-a587-dcb240cd8866","html_url":"https://github.com/ArtemLymarenko/parallel-course-work","commit_stats":null,"previous_names":["artemlymarenko/parallel-course-work"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ArtemLymarenko/parallel-course-work","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtemLymarenko%2Fparallel-course-work","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtemLymarenko%2Fparallel-course-work/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtemLymarenko%2Fparallel-course-work/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtemLymarenko%2Fparallel-course-work/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArtemLymarenko","download_url":"https://codeload.github.com/ArtemLymarenko/parallel-course-work/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtemLymarenko%2Fparallel-course-work/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32960357,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-12T09:19:52.626Z","status":"ssl_error","status_checked_at":"2026-05-12T09:17:33.438Z","response_time":102,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["concurrent-map","coursework","docker-compose","golang","htmx","tcp-client","tcp-server","threadpool","university"],"created_at":"2025-11-17T04:01:20.933Z","updated_at":"2026-05-12T23:06:53.042Z","avatar_url":"https://github.com/ArtemLymarenko.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Parallel Computing Course Work\n\nThis repo contains UML diagrams and source code for the parallel computing course work.\n\n# Project Setup Guide\n\n## Prerequisites\n\n### Clone the repository to your local machine\n```bash\n   git clone https://github.com/ArtemLymarenko/parallel-course-work.git \n   cd parallel-course-work\n```\n\n## Python Installation (\u003e=3.12.3)\n1. **Download Python** from the official website: [python.org](https://www.python.org/downloads/)\n    - Ensure you have Python version 3.12.3 or higher installed.\n\n2. **Install `pip` Package Manager:**\n    - For **Mac/Linux**:\n      ```bash\n      python -m ensurepip --default-pip\n      ```\n    - For **Windows**:\n      ```bash\n      py -m ensurepip --default-pip\n      ```\n\n3. **Install Python Dependencies:**\n    - Navigate to the Python client directory:\n      ```bash\n      cd clients/python\n      ```\n    - Install the required packages:\n      ```bash\n      pip install -r requirements.txt\n      ```\n\n4. **Running Locust Client:**\n    - To start the Locust client:\n      ```bash\n      locust\n      ```\n    - To run the server in a different mode:\n      ```bash\n      locust -f locustfile_open.py\n      ```\n\n5. **Additional Flags:**\n   You can add `--master` and `--worker` flags to create separate processes for testing. These should be run in different console windows:\n    - For the master process:\n      ```bash\n      locust --master\n      ```\n    - For worker processes:\n      ```bash\n      locust --worker\n      ```\n\n---\n\n## Golang Installation (\u003e=go1.22)\nDownload Golang from the official website: [go.dev](https://go.dev/dl/)\n\n### Linux\n\n1. Remove previous Go installation and extract archive:\n   ```bash\n     rm -rf /usr/local/go \u0026\u0026 tar -C /usr/local -xzf go1.23.4.linux-amd64.tar.gz\n   ```\n   Note: May require root/sudo access. Do not extract into existing /usr/local/go directory.\n\n2. Add to PATH in `$HOME/.profile` or `/etc/profile`:\n   ```bash\n   export PATH=$PATH:/usr/local/go/bin\n   ```\n   Note: Log out and back in for changes to take effect, or run `source $HOME/.profile`.\n\n3. Verify installation:\n   ```bash\n   go version\n   ```\n\n### macOS\n   1. Open and run the downloaded package installer\n   2. Go will be installed to `/usr/local/go`\n   3. `/usr/local/go/bin` will be added to PATH automatically\n   4. Restart Terminal sessions for changes to apply\n   5. Verify installation:\n   ```bash\n   go version\n   ```\n\n### Windows\n   1. Run the downloaded MSI installer\n   2. Default installation: Program Files or Program Files (x86)\n   3. Close and reopen command prompts after installation\n   4. Verify installation:\n       - Click Start menu\n       - Search for \"cmd\" and press Enter\n       - Run:\n   ```bash\n   go version\n   ```\n---\n\n# Setting Up Go Project\n## Locally\n1. **Install Go Dependencies:**\n    - For **Linux/macOS**:\n      ```bash\n      cd server \u0026\u0026 go mod tidy \u0026\u0026 cd ../pkg \u0026\u0026 go mod tidy \u0026\u0026 cd ../clients/golang \u0026\u0026 go mod tidy \u0026\u0026 cd ../..\n      ```\n    - For **Windows**:\n      ```bash\n      cd server; go mod tidy; cd ../pkg; go mod tidy; cd ../clients/golang; go mod tidy; cd ../..\n      ```\n\n2. **Start Server and Client:**\n    - For **Linux/macOS**:\n        - To start the server:\n          ```bash\n          cd server \u0026\u0026 go run cmd/main.go\n          ```\n        - To start the client:\n          ```bash\n          cd clients/golang \u0026\u0026 go run cmd/main.go\n          ```\n    - For **Windows**:\n        - To start the server:\n          ```bash\n          cd server; go run cmd/main.go\n          ```\n        - To start the client:\n          ```bash\n          cd clients/golang; go run cmd/main.go\n          \n          ```\n\n## Using Docker\n1. **Run Docker Compose in the root folder:**\n   - To start the containers:  \n   ```bash\n     docker-compose up\n     ```\n   - To stop the containers:\n   ```bash\n     docker-compose down\n     ```\n\n\u003e⚠️ **IMPORTANT:**\n\u003e\n\u003e Files for building an inverted index should be stored in the ```server/resources/data/``` folder.\n\u003e\n\u003e File for logs should be stored in the ```server/resources/logs``` foler and named ```logs.txt```.\n---\n## Open the clients\n\n\u003e To open Golang client use localhost:3000\n\n\u003e To open Locust client use localhost:8089\n---\n\n# Application Protocol Documentation\n\n## Overview\nThis document describes the protocol for communicating with the server via TCP connection. All requests and responses use JSON serialization.\n\n## Connection Protocol\n## How to communicate?\n- First, you need to serialize your request into special format using JSON, described below.\n- Then you need to calculate `chunkSize` and `totalChunks` and before sending each request you need to send size of chunk and their total number.\n1. chunkSize   - `4 bytes`\n2. totalChunks - `4 bytes`\n- To get response from the server, you first need to retrieve `chunkSize` and `totalChunks` and then all other data splitted by chunks.\n- Finally, deserialize retrieved data from JSON.\n\n### Request Format\nAll requests must include a `meta` object and may optionally include `body` and `connectionAlive` fields.\n\n**Allowed Methods:** `GET`, `POST`, `DELETE`\n\n```json\n{\n    \"meta\": {\n        \"path\": { \"type\": \"string\" },      \n        \"method\": { \"type\": \"string\" }    \n    },\n    \"body\": {},             \n    \"connectionAlive\": { \"type\": \"boolean\" }\n}\n```\n\n### Response Format\n```json\n{\n    \"status\": \"ResponseStatus\",\n    \"body\": {}\n}\n```\n\n### Status Codes\n```go\nStatusOK                  ResponseStatus = 0\nStatusProcessing          ResponseStatus = 1\nStatusNotFound            ResponseStatus = 2\nStatusBadRequest          ResponseStatus = 3\nStatusInternalServerError ResponseStatus = 4\n```\n\n### Error Response\nWhen an error occurs, the response body will contain a message:\n```json\n{\n    \"message\": { \"type\": \"string\" }\n}\n```\n\n## API Endpoints\n\n### 1. Search Files\nSearch for files matching a specific query.\n\n- **Path:** `index/search`\n- **Method:** `GET`\n- **Request Body:**\n```json \n{\n    \"query\": \"string\"\n}\n```\n- **Response Body:**\n```json \n{\n    \"files\": [\"string\"]\n}\n```\n\n### 2. Search Any\nSearch for files with more flexible matching.\n\n- **Path:** `index/search-any`\n- **Method:** `GET`\n- **Request Body:**\n```json \n{\n    \"query\": \"string\"\n}\n```\n- **Response Body:**\n```json \n{\n    \"files\": [\"string\"]\n}\n```\n\n### 3. Get File Content\nRetrieve the content of a specific file.\n\n- **Path:** `/index/file`\n- **Method:** `GET`\n- **Request Body:**\n```json \n{\n    \"fileName\": \"string\"\n}\n```\n- **Response Body:**\n```json \n{\n    \"fileContent\": \"string\"\n}\n```\n\n### 4. Add File\nAdd a new file to the index.\n\n- **Path:** `/index/file`\n- **Method:** `POST`\n- **Request Body:**\n```json \n{\n    \"fileName\": \"string\"\n}\n```\n\n### 5. Remove File\nDelete a file from the index.\n\n- **Path:** `/index/file`\n- **Method:** `DELETE`\n- **Request Body:**\n```json \n{\n   \"fileName\": \"string\"\n}\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartemlymarenko%2Fparallel-course-work","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartemlymarenko%2Fparallel-course-work","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartemlymarenko%2Fparallel-course-work/lists"}