{"id":19509997,"url":"https://github.com/permify/node-demo-app","last_synced_at":"2026-06-06T23:31:24.537Z","repository":{"id":257470312,"uuid":"852123715","full_name":"Permify/node-demo-app","owner":"Permify","description":"A Backend service using Permify Cloud","archived":false,"fork":false,"pushed_at":"2024-09-16T18:23:43.000Z","size":75,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-01-08T11:47:01.146Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/Permify.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-09-04T09:09:14.000Z","updated_at":"2024-09-16T18:27:49.000Z","dependencies_parsed_at":"2024-09-17T00:38:46.490Z","dependency_job_id":"3b4c95b6-723a-4ea4-b9f4-dd82982b4bae","html_url":"https://github.com/Permify/node-demo-app","commit_stats":null,"previous_names":["permify/node-demo-app"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Permify%2Fnode-demo-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Permify%2Fnode-demo-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Permify%2Fnode-demo-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Permify%2Fnode-demo-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Permify","download_url":"https://codeload.github.com/Permify/node-demo-app/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240761122,"owners_count":19853255,"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":[],"created_at":"2024-11-10T23:14:08.465Z","updated_at":"2026-06-06T23:31:23.785Z","avatar_url":"https://github.com/Permify.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Backend Service with Permify Integration\n\nThis repository contains a backend service built with **Node.js** that communicates with **Azure Service Bus** and interacts with **Permify** for permission management. The project consists of two main components:\n\n1. **Node.js Backend**: Sends messages to Azure Service Bus and interacts with the Permify API using the **Permify JavaScript REST SDK** for permission checks and data filtering.\n2. **Java Consumer Service**: Reads messages from Azure Service Bus and writes data to Permify using the **Permify Java SDK**.\n\n## Architecture\n\nThe architecture consists of the following components:\n- **Node.js Backend**: Responsible for sending user-organization and user-repository relation data to the Service Bus queue and performing permission checks.\n- **Service Bus Queue**: Used for decoupling the backend from the Java consumer service.\n- **Java Consumer Service**: Reads messages from the Service Bus queue and writes user-organization and user-repository relations to Permify.\n- **Permify**: Provides the API and SDKs for permission management, data filtering, and relationship handling.\n\n## Entities and Schema\n\nThe entities used in this project are **user**, **organization**, and **repository**. The relationships between these entities, as well as permissions, are managed through the following schema:\n\n### Entity Definitions\n\n```permify\nentity user {}\n\nentity organization {\n    relation admin @user\n    relation member @user\n}\n\nentity repository {\n    relation parent @organization\n    relation owner @user\n\n    permission edit   = parent.admin or owner\n    permission delete = owner\n}\n```\n- **User**: Represents a user in the system.\n- **Organization**: Represents an organization. It has two relations: `admin` and `member`, both pointing to the `user` entity.\n- **Repository**: Represents a repository. It has a `parent` relation pointing to the `organization` entity and an `owner` relation pointing to the `user` entity. Permissions for `edit` and `delete` are derived from these relations.\n\n### Permissions\n\n- **Edit Permission**: A user can edit a repository if they are either an `admin` of the parent organization or the `owner` of the repository.\n- **Delete Permission**: Only the `owner` of a repository can delete it.\n\n## Features\n\n1. **User-Organization and User-Repository Relationship Management**:\n   - The backend sends a message to the Azure Service Bus to create relationships between users, organizations, and repositories.\n   - The Java consumer service reads the message and creates the relationships in Permify.\n\n2. **Permission Checks**:\n   - The backend service uses the **Permify JavaScript REST SDK** to check user permissions and filter data based on roles.\n\n3. **Decoupled Communication**:\n   - The use of Azure Service Bus allows asynchronous communication between the Node.js backend and the Java consumer service, ensuring scalability and separation of concerns.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpermify%2Fnode-demo-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpermify%2Fnode-demo-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpermify%2Fnode-demo-app/lists"}