important
This is a contributors guide and NOT a user guide. Please visit these docs if you are using or evaluating SuperTokens.
Architecture choice - Backend SDK vs core dashboard
- Status:
- accepted
- Deciders:
- rishabhpoddar, nkshah2, makerboiAdi
- Proposed by:
- makerboiAdi
- Created:
- 2022-11-28
#
Context and Problem StatementWe need to provide a user management dashboard to our users. For this, we need decide:
- What process will serve the dashboard HTML
- Where will the APIs exist that the frontend dashboard client can call.
- What are the differences between managed and self hosted (if any).
#
Considered Options- Have a different github repo for the dashboard and its API that the user can run. This would connect to the user's core service.
- Serve the dashboard client via the core and have its APIs exposed by the core as well.
- Serve the dashboard client via the backend SDK and have its APIs exposed by the backend as well.
#
Decision OutcomeWe decided to do with the option that serves the dashboard via the backend SDK and also has its APIs on the backend SDK level (option 3).
- User's customisations are applied to dashboard APIs (See below for list of customisations considered).
#
Pros and Cons of the Options#
Have a different github repo for the dashboard and its API that the user can run. This would connect to the user's core service.#
Serve the dashboard client via the core and have its APIs exposed by the core as well.We even considered changing how customisations are done to resolve the con above:
- Make webhook based customisations where the core queries the backend SDK for email sending etc..
- It would allow the dashboard APIs in the core to take into account customisations of the user.
- Bad dev experience when the backend is in localhost, but core is in managed service. The dev would need to expose their backend using ngrok and configure the core to query that.
- It would allow the dashboard APIs in the core to take into account customisations of the user.
- It would allow the dashboard APIs in the core to take into account customisations of the user.
#
Serve the dashboard client via the backend SDK and have its APIs exposed by the backend as well.#
List of customisations considered:- Email / SMS sending customisations for email verification / reset password emails.
- Post user creation operations - this was the most important one.
- Recipe functions override.
#
Extra informationLink to summary of conversation on slack: https://supertokens.slack.com/archives/C02JS72AE0Z/p1669213735216679