Video tutorial & Architecture
Quick implementation video 📺
- 00:00 Project Setup
- 00:35 Frontend SDK Setup
- 02:37 Backend SDK Setup
- 04:21 Checking if a session exists on the frontend
- 06:00 Fetching session userId on the frontend
- 06:47 Setting up session verification
- 08:45 Implementing sign out & testing
- 10:00 Running the SuperTokens core for your app
- 11:12 Connecting the core to a MySQL database & testing it
Application Architecture 🏰
- Frontend SDK: Responsible for rendering the login UI widgets and managing session tokens automatically.
- Backend SDK: Provides APIs for sign-up, sign-in, signout, session refreshing etc... You can also disable these default APIs and build your own using the provided functions from this SDK.
- SuperTokens Core: This is an HTTP service that contains the core logic for auth and sessions. It's also responsible for interfacing with the database. We have one instance of the Core running on
https://try.supertokens.iowhich is used in the Demo app.
Why we chose Java for the SuperTokens core
- ✅ Whilst running Java can seem difficult, we provide the JDK along with the binary / docker image when distributing it. This makes running SuperTokens just like running any other http microservice.
- ✅ Java has a very mature ecosystem. This implies that third party libraries have been battled tested.
- ✅ Java's strong type system ensures fewer bugs and easier maintainability. This is especially important when many people are expected to work on the same project.
- ✅ Our team is most comfortable with Java and hiring for great Java developers is relatively easy as well.