Sample SvelteKit app using sveltekit-keycloak-multitenant library in containerized environment. Example has SvelteKit app, Keycloak, Postgres DB for Keycloak behind Traefik reverse proxy. (Note: docker-compose is for M1 Mac, comment platform lines if not needed.)
- Build the SvelteKit app
cd demoapp
yarn run containerize
- Run the monorepo
cd ..
docker-compose up -d
- Setup tenants in keycloak Open in browser: https://keycloak.localhost login:
- username: admin
- password: S0meP@ssword
Create realms (tenants). For each realm:
- create a client
- Configure redirect for client back to app
- create some testing roles, groups, users in KeyCloak
-
Update tenants.yaml and restart docker-compose
-
Test the app: Open in browser: https://portal.localhost login with any users and their tenants created in step 3...
Here is a video how to build a new SvelteKit app from scratch using the library. You can containerize it following along this example. https://youtu.be/c60uTal3_lU