A multitenantStack in beego, backend only, using postgres
conf | ||
constants | ||
controllers | ||
database | ||
docker | ||
models | ||
routers | ||
scripts | ||
services | ||
swagger | ||
tests | ||
.gitignore | ||
bee.json | ||
Dockerfile | ||
main.go | ||
Readme.md |
MutlitenantStack
This is a project to demonstrate multi tenancy usage in beego using postgres and separated databases
The api was scaffolded using:
bee api multitenantStack -driver=postgres -conn="host=127.0.0.1 port=5435 user=postgres password=postgre dbname=company_template sslmode=disable"
then `bee run -downdoc=true``
To regenerate docs simply run bee generate docs
TODO
Todo till we can fork this repo
/register endpoint creates database, company and first adminload db connections from configuser delete needs to update systemcompany delete needs to exist and update usercompanymaplast modified in update for all tablesmodifiedby (companyuserid) relationchecking some roles in all controller endpointsreturn error in case of not foundgo through all endpoints for errors
Notes:
- Fixes have been placed into the beego orm for setting the timezone when using NewOrmWithDB() (Already merged)
- Bee needs the dir patch (merge pending)
Script
script that runs all migrations (and passes through rollback or others, show states for company, run for single company) (list, connect, migrate)
dependencies
github.com/kennygrant/sanitize github.com/astaxie/beego github.com/beego/bee github.com/dgrijalva/jwt-go golang.org/x/crypto/bcrypt
Final Notes:
On 17.11.18 this project was considered a complete template and forked for granny