{"id":21338683,"url":"https://github.com/andmelox/clock-synchronization-project","last_synced_at":"2026-04-18T15:38:16.709Z","repository":{"id":262481024,"uuid":"887366796","full_name":"AndMelox/Clock-Synchronization-Project","owner":"AndMelox","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-12T16:24:17.000Z","size":2462,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-22T15:09:46.488Z","etag":null,"topics":["docker","docker-image","html","javascript","syncronization","watch"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/AndMelox.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-11-12T16:11:21.000Z","updated_at":"2024-11-12T16:26:42.000Z","dependencies_parsed_at":"2024-11-12T17:40:04.352Z","dependency_job_id":null,"html_url":"https://github.com/AndMelox/Clock-Synchronization-Project","commit_stats":null,"previous_names":["andmelox/clock-synchronization-project"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndMelox%2FClock-Synchronization-Project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndMelox%2FClock-Synchronization-Project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndMelox%2FClock-Synchronization-Project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndMelox%2FClock-Synchronization-Project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AndMelox","download_url":"https://codeload.github.com/AndMelox/Clock-Synchronization-Project/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243814895,"owners_count":20352038,"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","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":["docker","docker-image","html","javascript","syncronization","watch"],"created_at":"2024-11-22T00:34:33.144Z","updated_at":"2026-04-18T15:38:11.649Z","avatar_url":"https://github.com/AndMelox.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Clock Synchronization Project\n\nThis project consists of two main components: `node-client` and `node-coordinator`. The goal is to synchronize the clocks of multiple `node-client` instances using a `node-coordinator`.\n\n## Project Structure\n\nnode-client/ ├── clock-endpoints.js ├── clock.js ├── Dockerfile ├── index.js ├── logs.js ├── package.json └── public/ ├── index.html └── index.js\n\nnode-coordinator/ ├── .env ├── clients-endpoints.js ├── index.js ├── logs.js ├── package.json └── public/ ├── index.html ├── index.js └── socket-server.js\n\n\n## Setup\n\n### 1. Configure IP Addresses\n\n1. Open the `.env` file in the `node-coordinator` folder and change the IP to your machine's IP address.\n\n2. Open the `index.js` file in the `node-coordinator/public` folder and replace the IP with your machine's IP address:\n\n    ```javascript\n    fetch('http://your_ip:5000/createInstance')\n    fetch('http://your_ip:5000/syncNodes', { method: 'PUT' })\n    ```\n\n### 2. Build and Run Containers\n\n#### node-client\n1. Navigate to the `node-client` folder:\n    ```bash\n    cd node-client\n    ```\n\n2. Build the Docker image:\n    ```bash\n    docker build -t node-client .\n    ```\n\n#### node-coordinator\n1. Navigate to the `node-coordinator` folder:\n    ```bash\n    cd node-coordinator\n    ```\n\n2. Install dependencies and start the server:\n    ```bash\n    npm install\n    npm start\n    ```\n\n### 3. Open in Browser\n\nOpen your browser and go to `http://your_ip:5000` to view the `node-coordinator` interface.\n\n## Features\n\n- **node-client**: Provides endpoints to get and update the clock of each instance.\n- **node-coordinator**: Coordinates clock synchronization across multiple `node-client` instances.\n\n## Endpoints\n\n### node-client\n\n- `GET /clock`: Retrieves the current time of the clock.\n- `PUT /clock`: Updates the clock with a specified adjustment.\n\n### node-coordinator\n\n- `POST /clients`: Registers a new client.\n- `GET /createInstance`: Creates a new `node-client` instance.\n- `PUT /syncNodes`: Synchronizes the clocks of all registered instances.\n\n## Notes\n\n- Ensure that Docker is installed and running on your machine.\n- Make sure the configured IP addresses are accessible on your network.\n\n\n## Authors\n\n[\u003cimg alt=\"GitHub\" src=\"https://img.shields.io/badge/GitHub-@AndMelox-181717?style=flat-square\u0026logo=github\"\u003e](https://github.com/AndMelox)  \n[\u003cimg alt=\"GitHub\" src=\"https://img.shields.io/badge/GitHub-@sebastian11020-181717?style=flat-square\u0026logo=github\"\u003e](https://github.com/sebastian11020)  \n[\u003cimg alt=\"GitHub\" src=\"https://img.shields.io/badge/GitHub-@SamVargasGit-181717?style=flat-square\u0026logo=github\"\u003e](https://github.com/SamVargasGit)\n\n\n## 🔗 Contact Links\n\n\u003cimg alt=\"instagram\" src=\"https://img.shields.io/badge/instagram-E4405F?style=for-the-badge\u0026logo=instagram\u0026logoColor=white\"\u003e \n\u003cimg alt=\"linkedin\" src=\"https://img.shields.io/badge/linkedin-0A66C2?style=for-the-badge\u0026logo=linkedin\u0026logoColor=white\"\u003e \n\u003cimg alt=\"gmail\" src=\"https://img.shields.io/badge/gmail-D14836?style=for-the-badge\u0026logo=gmail\u0026logoColor=white\"\u003e \n\u003cimg alt=\"twitter\" src=\"https://img.shields.io/badge/twitter-1DA1F2?style=for-the-badge\u0026logo=twitter\u0026logoColor=white\"\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandmelox%2Fclock-synchronization-project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandmelox%2Fclock-synchronization-project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandmelox%2Fclock-synchronization-project/lists"}