A multitenantStack in beego, backend only, using postgres
Go to file
2018-11-16 11:48:45 +01:00
conf Migration Automation 2018-11-14 18:47:42 +01:00
constants Adding static roles 2018-11-15 18:10:07 +01:00
controllers Protecting Created Date, updating docs, changin errors to JSON 2018-11-16 11:48:45 +01:00
database Adding all migrations 2018-11-14 18:34:03 +01:00
docker Migration Automation 2018-11-14 18:47:42 +01:00
models Protecting Created Date, updating docs, changin errors to JSON 2018-11-16 11:48:45 +01:00
routers Company Delete Endpoint done 2018-11-16 09:44:09 +01:00
scripts Migration Automation 2018-11-14 18:47:42 +01:00
services Register endpoint working 2018-11-13 21:39:04 +01:00
swagger Protecting Created Date, updating docs, changin errors to JSON 2018-11-16 11:48:45 +01:00
tests Update readme and testconfig 2018-11-14 18:49:49 +01:00
.gitignore remove lastupdate 2018-11-12 12:31:12 +01:00
bee.json Migration Automation 2018-11-14 18:47:42 +01:00
Dockerfile Adding generated dockerfile 2018-11-06 13:02:44 +01:00
main.go Changing companydb to read config file 2018-11-13 19:02:47 +01:00
Readme.md Protecting Created Date, updating docs, changin errors to JSON 2018-11-16 11:48:45 +01:00

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

  • Not found for endpoints should be Json response
  • migrations for company_template
  • hardcoded roles
  • /register endpoint creates database, company and first admin
  • load db connections from config
  • user delete needs to update system
  • company delete needs to exist and update usercompanymap
  • last modified in update for all tables
  • checking some roles in all endpoints
  • modified by relation (companyuserid)
  • return error in case of not found

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