{"id":22165667,"url":"https://github.com/yogyy/fastify-roles","last_synced_at":"2026-05-09T02:35:12.843Z","repository":{"id":221125723,"uuid":"752567968","full_name":"yogyy/fastify-roles","owner":"yogyy","description":"fastify RBAC using typescript and postgresql","archived":false,"fork":false,"pushed_at":"2024-11-22T17:08:54.000Z","size":140,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-22T07:52:38.209Z","etag":null,"topics":["drizzle-orm","fastify","jwt","postgresql"],"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/yogyy.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-02-04T08:14:01.000Z","updated_at":"2025-04-24T19:32:06.000Z","dependencies_parsed_at":"2025-01-29T21:46:22.681Z","dependency_job_id":null,"html_url":"https://github.com/yogyy/fastify-roles","commit_stats":null,"previous_names":["yogyy/fastify-postgresql","yogyy/fastify-roles"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yogyy/fastify-roles","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yogyy%2Ffastify-roles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yogyy%2Ffastify-roles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yogyy%2Ffastify-roles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yogyy%2Ffastify-roles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yogyy","download_url":"https://codeload.github.com/yogyy/fastify-roles/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yogyy%2Ffastify-roles/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32805007,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"online","status_checked_at":"2026-05-09T02:00:06.633Z","response_time":123,"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":["drizzle-orm","fastify","jwt","postgresql"],"created_at":"2024-12-02T05:15:55.172Z","updated_at":"2026-05-09T02:35:12.827Z","avatar_url":"https://github.com/yogyy.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Multi Tenant Role Based Access Control (RBAC) Authentication API\n\n## Features\n\n- Create an application\n- Register a user for an application\n- Login\n- Create a role\n- Assign a role to a user\n\n- Check user permissions with a guard\n\n## What are we using?\n\n- [Drizzle ORM](https://github.com/drizzle-team/drizzle-orm)\n- [Fastify](https://www.fastify.io/)\n- [PostgreSQL](https://www.postgresql.org/)\n- [TypeScript](https://www.typescriptlang.org/)\n\n## What you'll need\n\n- Node.js - [Download](https://nodejs.org/en/download/)\n- A database - [PostgreSQL by Neon](https://bit.ly/tomdoestech)\n- A REST client - [Thunder Client](https://marketplace.visualstudio.com/items?itemName=rangav.vscode-thunder-client)\n\n## What you will learn\n\n- How to create a multi tenant application\n- How to create a role based access control system\n- Some basic relational database concepts\n- A nice and neat file structure for backend services\n- TypeScript\n- Fastify\n- RESTful API design\n- How to use Drizzle ORM\n\n## Data structure\n\n\u003cimg src =\"./img/diagram.png\" /\u003e\n\n## Data flow\n\n\u003cimg src =\"./img/data-flow.png\" /\u003e\n\n## Code structure\n\n1. Setup the initial application\n2. Create a database with Neon\n3. Create database schemas\n4. Run migrations\n5. Register an application\n6. Register a user\n7. Login\n8. Create a role\n9. Assign a role to a user\n10. Check user permissions with a guard\n\n## Tips\n\n- Infer the applicationId from the JWT where possible\n- Include the applicationId in queries\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyogyy%2Ffastify-roles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyogyy%2Ffastify-roles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyogyy%2Ffastify-roles/lists"}