{"id":24738741,"url":"https://github.com/7ossam7atem1/distributed-system","last_synced_at":"2026-02-22T05:33:10.590Z","repository":{"id":254413610,"uuid":"845682803","full_name":"7ossam7atem1/distributed-system","owner":"7ossam7atem1","description":"Educational mock for exploring core concepts of distributed systems and networking without framework","archived":false,"fork":false,"pushed_at":"2024-09-08T21:44:46.000Z","size":204,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-10T08:32:44.879Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/7ossam7atem1.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-08-21T18:10:57.000Z","updated_at":"2025-04-29T05:38:56.000Z","dependencies_parsed_at":"2024-08-23T10:26:07.032Z","dependency_job_id":"0384aec8-72ea-4244-8f6a-5de0026f9952","html_url":"https://github.com/7ossam7atem1/distributed-system","commit_stats":null,"previous_names":["7ossam7atem1/distributed-system"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/7ossam7atem1/distributed-system","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/7ossam7atem1%2Fdistributed-system","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/7ossam7atem1%2Fdistributed-system/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/7ossam7atem1%2Fdistributed-system/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/7ossam7atem1%2Fdistributed-system/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/7ossam7atem1","download_url":"https://codeload.github.com/7ossam7atem1/distributed-system/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/7ossam7atem1%2Fdistributed-system/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29705536,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-22T03:17:42.375Z","status":"ssl_error","status_checked_at":"2026-02-22T03:17:31.622Z","response_time":110,"last_error":"SSL_read: 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":[],"created_at":"2025-01-27T22:55:32.294Z","updated_at":"2026-02-22T05:33:10.572Z","avatar_url":"https://github.com/7ossam7atem1.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Distributed System Mock\n\n## Table of Contents\n\n- [Project Overview](#project-overview)\n- [Features](#features)\n- [Setup and Installation](#setup-and-installation)\n- [Usage Guide](#usage-guide)\n  - [Starting a Server](#starting-a-server)\n  - [Using the Client](#using-the-client)\n- [Visualization](#visualization)\n  - [System Architecture](#system-architecture)\n  - [Command Forwarding](#command-forwarding)\n- [Example Scenarios](#example-scenarios)\n  - [Scenario 1: Basic Operations](#scenario-1-basic-operations)\n  - [Scenario 2: Fault Tolerance and Recovery](#scenario-2-fault-tolerance-and-recovery)\n\n## Project Overview\n\nThis project demonstrates a distributed key-value store using raw TCP connections with Node.js and TypeScript. It is designed to help you understand the principles of distributed systems, low-level networking, and CLI-based interaction.\n\n## Features\n\n- **Distributed Architecture**: Operates across three nodes to ensure data consistency.\n- **Command Support**: Implements basic commands like `GET`, `SET`, `UPD`, and `DEL`.\n- **Node Failure Detection**: Monitors and manages node failures with a heartbeat mechanism.\n- **Recovery Mechanism**: Synchronizes recovered nodes with the rest of the system.\n- **CLI Tools**: Provides command-line interfaces for both server management and client interactions.\n\n## Setup and Installation\n\n1. **Clone the Repository**\n\n   ```bash\n   git clone https://github.com/7ossam7atem1/distributed-system.git\n   cd distributed-system\n   ```\n\n2. **Install Dependencies**\n\n   ```bash\n   npm install\n   ```\n\n## Usage Guide\n\n### [Starting a Server](#starting-a-server)\n\nTo start a server, use the following command:\n\n```bash\nnpm start\n```\n\nYou will be prompted to choose which server instance to run.\n\n### [Using the Client](#using-the-client)\n\nTo interact with a server, use the following command:\n\n```bash\nnpm test\n```\n\nYou will be prompted to select a server instance and then execute commands like `SET`, `GET`, `UPD`, and `DEL`.\n\n## Visualization\n\n### [System Architecture](#system-architecture)\n\n![System Architecture Diagram](/public/Full%20Archeticture/Archeticture.png)\n\n_Diagram showing the overall architecture of the distributed key-value store system._\n\n### [Command Forwarding](#command-forwarding)\n\n![Command Forwarding Diagram](/public/sample%20commands/SET-Command-diagram.png)\n\n_Diagram illustrating how the `SET` command is forwarded from Server A to other nodes._\n\n## Example Scenarios\n\n### Scenario 1: Basic Operations\n\n1. **Start Server Instances:**  \n   Run the servers using `npm start` for Server A, Server B, and Server C.\n\n2. **Set a Value Using Client CLI:**  \n   Connect to Server A and execute the command:\n\n   ```bash\n   SET testKey testValue\n   ```\n\n   The `SET` command will be forwarded to Server B and Server C.\n\n3. **Get the Value:**  \n   Execute the command to retrieve the value:\n\n   ```bash\n   GET testKey\n   ```\n\n   Confirm that `testKey` returns `testValue` from Server A, Server B, and Server C.\n\n4. **Update the Value:**  \n   Update the value using the command:\n\n   ```bash\n   UPD testKey newValue\n   ```\n\n   Ensure that all servers reflect the updated value `newValue`.\n\n5. **Delete the Key:**  \n   Execute the delete command:\n\n   ```bash\n   DEL testKey\n   ```\n\n   Verify that `testKey` is no longer present on Server A, Server B, and Server C.\n\n### Scenario 2: Fault Tolerance and Recovery\n\n1. **Start Server Instances:**  \n   Ensure all server instances are running.\n\n2. **Simulate Node Failure:**  \n   Stop Server B to simulate a failure.\n\n3. **Send Commands:**  \n   Execute commands using the Client CLI and verify that Server A and Server C process them.\n\n4. **Restart the Failed Node:**  \n   Restart Server B and check the recovery process.\n\n5. **Verify Recovery:**  \n   Confirm that Server B resynchronizes with Server A and Server C and reflects the latest data.\n\n6. **Check Data Consistency:**  \n   Ensure that all servers have consistent data after the recovery of Server B.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F7ossam7atem1%2Fdistributed-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F7ossam7atem1%2Fdistributed-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F7ossam7atem1%2Fdistributed-system/lists"}