{"id":14955406,"url":"https://github.com/katsari/rails-multitenant-api","last_synced_at":"2025-10-01T18:31:22.528Z","repository":{"id":131921707,"uuid":"402469628","full_name":"Katsari/rails-multitenant-api","owner":"Katsari","description":"Rails API starter that includes row based multitenant architecture, RLS, authentication, authorization and test framework setup.","archived":false,"fork":false,"pushed_at":"2021-09-21T22:05:08.000Z","size":1060,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-14T11:14:11.959Z","etag":null,"topics":["multitenant-architecure","postgresql","rails-api","rails6","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/Katsari.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":"2021-09-02T15:22:05.000Z","updated_at":"2024-09-02T21:59:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"404fae7d-435f-49e6-a551-4e2d9520a10a","html_url":"https://github.com/Katsari/rails-multitenant-api","commit_stats":{"total_commits":4,"total_committers":1,"mean_commits":4.0,"dds":0.0,"last_synced_commit":"c78c9b3976b824131de1f88611fef0ecb4992792"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Katsari%2Frails-multitenant-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Katsari%2Frails-multitenant-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Katsari%2Frails-multitenant-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Katsari%2Frails-multitenant-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Katsari","download_url":"https://codeload.github.com/Katsari/rails-multitenant-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234719909,"owners_count":18876528,"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":["multitenant-architecure","postgresql","rails-api","rails6","ruby"],"created_at":"2024-09-24T13:11:06.689Z","updated_at":"2025-10-01T18:31:16.948Z","avatar_url":"https://github.com/Katsari.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rails Multitenant API (WIP)\n\nThis is an opinionated Rails application designed to be used as a starter or example on how to implement a REST API with row based multitenancy and extra security by leveraging PostgreSQL's Row Level Security (RLS).\n\n## Main features\n\n* Row based multitenancy for data isolation (adding tenant_id to almost all tables).\n* Automatically add `tenant_id` to database queries using [activerecord-multi-tenant](https://github.com/citusdata/activerecord-multi-tenant).\n* A sencond layer of security for data restriction by using PostgreSQL's Row Level Security (see [PG Docs](https://www.postgresql.org/docs/current/ddl-rowsecurity.html)). Easy policy definition, migrations and controller integration with [rls_rails](https://github.com/suus-io/rls_rails).\n* Email authentication using [Devise Token Auth](https://github.com/lynndylanhurley/devise_token_auth), including:\n  * User registration, creation, update and deletion\n  * Login and logout\n  * Password reset, account confirmation\n* Permission based authorization using [CanCanCan](https://github.com/CanCanCommunity/cancancan).\n* Graph API using RESTful Resources by leveraging the amazing [Graphiti](https://www.graphiti.dev/guides/) gem, which includes:\n  * JSON:API specification (also supports JSON and XML responses)\n  * Sorting\n  * Pagination\n  * Filtering\n  * Statictics\n  * Error handling\n  * Side-loading and side-posting\n* Test framework setup ready for writing unit, request, resource and API tests (Rspec + Factory Bot + Faker + Shoulda Matchers + Database Cleaner + Graphiti spec helpers). Includes tests for users, roles, sessions, registrations and token validations.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkatsari%2Frails-multitenant-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkatsari%2Frails-multitenant-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkatsari%2Frails-multitenant-api/lists"}