A multitenantStack in beego, backend only, using postgres
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Lukas Bachschwell e9d3dcb6c9 Fixing Config read 1 year ago
conf Migration Automation 1 year ago
constants Adding static roles 1 year ago
controllers Some unreachable code fixes 1 year ago
database Adding Modified By relation 1 year ago
docker Migration Automation 1 year ago
models Adding Modified By relation 1 year ago
routers Company Delete Endpoint done 1 year ago
scripts move migrateTenants 1 year ago
services Fixing Config read 1 year ago
swagger Protecting Created Date, updating docs, changin errors to JSON 1 year ago
tests Update readme and testconfig 1 year ago
.gitignore remove lastupdate 1 year ago
Dockerfile Adding generated dockerfile 1 year ago
Readme.md Adding final notes 1 year ago
bee.json move migrateTenants 1 year ago
main.go Changing companydb to read config file 1 year ago

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 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

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