{"id":14987652,"url":"https://github.com/go-saas/saas","last_synced_at":"2025-04-05T09:07:39.071Z","repository":{"id":37492005,"uuid":"314037846","full_name":"go-saas/saas","owner":"go-saas","description":"go data framework for saas(multi-tenancy)","archived":false,"fork":false,"pushed_at":"2024-04-08T08:54:59.000Z","size":1005,"stargazers_count":284,"open_issues_count":7,"forks_count":46,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-03-29T08:11:15.560Z","etag":null,"topics":["gin","golang","kratos","multi-tenancy","saas","tenant"],"latest_commit_sha":null,"homepage":"","language":"Go","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/go-saas.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":"2020-11-18T19:33:13.000Z","updated_at":"2025-03-21T01:12:22.000Z","dependencies_parsed_at":"2024-06-18T16:46:38.548Z","dependency_job_id":"aadcef3f-17ca-4b1b-a474-4cfa15da2502","html_url":"https://github.com/go-saas/saas","commit_stats":{"total_commits":137,"total_committers":3,"mean_commits":"45.666666666666664","dds":"0.058394160583941646","last_synced_commit":"ad5675338984beec1433054246443a664bb6916c"},"previous_names":["goxiaoy/go-saas","go-saas/go-saas"],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-saas%2Fsaas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-saas%2Fsaas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-saas%2Fsaas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-saas%2Fsaas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/go-saas","download_url":"https://codeload.github.com/go-saas/saas/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247312078,"owners_count":20918344,"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":["gin","golang","kratos","multi-tenancy","saas","tenant"],"created_at":"2024-09-24T14:15:07.141Z","updated_at":"2025-04-05T09:07:39.040Z","avatar_url":"https://github.com/go-saas.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-saas\n\n[English](./README.md) | [中文文档](./README_zh_Hans.md)\n\nheadless go framework for saas(multi-tenancy).   \n`go-saas` targets to provide saas solution for go\nthis project suits for simple (web) project, which is also called monolithic.  \n\nif you are finding complete solution which is microservice compatible, please refer to [go-saas-kit](https://github.com/go-saas/kit)\n\n# Overview\n\n## Feature\n\n* Different database architecture\n  * [x] Single-tenancy:  Each database stores data from only one tenant.\n  \n  ![img.png](docs/mode1.png)\n\n  * [x] Multi-tenancy:  Each database stores data from multiple separate tenants (with mechanisms to protect data privacy).\n  \n  ![img.png](docs/mode2.png)\n\n  * [x] Hybrid tenancy models are also available.\n\n  * [x] Implement your own resolver to achieve style like sharding\n\n\n* Support multiple web framework\n    * [x] [gin](https://github.com/gin-gonic/gin)\n    * [x] [iris](https://github.com/kataras/iris)\n    * [x] net/http\n    * [x] [kratos](https://github.com/go-kratos/kratos)\n* Supported orm with data filter, which means all underlying database\n    * [x] [gorm](https://github.com/go-gorm/gorm)\n    * [x] [ent](https://entgo.io/)\n* Customizable tenant resolver\n    * [x] Query String\n    * [x] Form parameters\n    * [x] Header\n    * [x] Cookie\n    * [x] Domain format\n* Seed and Migration\n  * [x] Seed/Migrate tenant database after creation or upgrade to new version\n* Integration with gateway\n  * [x] [apisix](https://github.com/apache/apisix)\n\n\n## Install\n\n```\ngo get github.com/go-saas/saas\n```\n\n## Design\n```mermaid\ngraph TD\n    A(InComming Request) --\u003e|cookie,domain,form,header,query...|B(TenantResolver)\n    B --\u003e C(Tenant Context)  --\u003e D(ConnectionString Resolver)\n    D --\u003e E(Tenant 1) --\u003e J(Data Filter) --\u003e  H(Shared Database)\n    D --\u003e F(Tenant 2) --\u003e J\n    D --\u003e G(Tenant 3) --\u003e I(Tenant 3 Database)\n```\n\n    \n# Sample Project\n* [example-gorm](https://github.com/go-saas/saas/tree/main/examples/gorm) combination of `go-saas`,`gin`,`gorm(sqlite/mysql)`\n* [example-ent](https://github.com/go-saas/saas/tree/main/examples/ent) combination of `go-saas`,`gin`,`ent(sqlite)`\n* [go-saas-kit](https://github.com/go-saas/kit) Microservice architecture starter kit for golang sass project\n\n# Documentation\n Refer to [wiki](https://github.com/go-saas/saas/wiki)\n\n\n# References\n\nhttps://docs.microsoft.com/en-us/azure/azure-sql/database/saas-tenancy-app-design-patterns\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-saas%2Fsaas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgo-saas%2Fsaas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-saas%2Fsaas/lists"}