1.4 KiB


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= 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 till we can fork this repo

  • /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
  • modifiedby (companyuserid) relation
  • checking some roles in all controller endpoints
  • return error in case of not found
  • go through all endpoints for errors


  • 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 that runs all migrations (and passes through rollback or others, show states for company, run for single company) (list, connect, migrate)


Final Notes:

On 17.11.18 this project was considered a complete template and forked for granny