This is the monorepo for the full Tokens Studio ecosystem powered by Turborepo
See the Graph-Engine library here
See the hosted documentation here
Run yarn to install dependencies
yarn
Run the appropriate dev script for you app or library.
To setup a docker development environment you can use the provided docker-compose.yaml
file via a docker-compose up
command
Note that we do use images from ghcr.io which means you will need to authenticate there. Follow this guide to logging into ghcr.
Running docker-compose up
will create the following services
- kratos which handles identity management. In our scenario it is responsible for creating users, SSO, MFA ,etc
- mailslurper A small SMTP server that acts as the courier for sending emails for kratos. We can use the UI to view sent emails to handle verification and magic email link logins
- oathkeeper. An identity access proxy. It sits in front of our backend and verifies the identity of users when making server request
- kratos-admin. A simple admin interface for kratos to see which users are being administrated
- kratos-selfservice-ui-node. A user portal for users to signup and login
To use these services, make sure to open the necessary ports on your computer. It's important to consistently use either localhost
or 127.0.0.1
to refer to your local machine. We recommend using 127.0.0.1
.
Here's how to get started:
-
Create an Account:
- Visit
http://127.0.0.1:7979/auth/
to sign up. This page will guide you through creating a new account.
- Visit
-
Verify Your Account:
- After signing up, go to
http://127.0.0.1:4436
to verify your account. You'll need to click on a verification link sent to your email by Kratos.
- After signing up, go to
-
Session Token:
- Once verified, Kratos will issue a session authentication token for
127.0.0.1
.
- Once verified, Kratos will issue a session authentication token for
-
Start the Backend for Development:
- Run
npm run dev:api
from the root directory of your project. This starts the backend API with live reloading enabled.
- Run
-
Access the Backend:
- The backend API can be accessed at
http://127.0.0.1:7979/api/
. Oathkeeper will check your identity with Kratos and allow the API to recognize you.
- The backend API can be accessed at
-
Explore the API:
- For a visual guide to the API, visit
http://127.0.0.1:7979/api/swagger
to access SwaggerUI.
- For a visual guide to the API, visit
Remember to use 127.0.0.1
consistently for all steps.
The graph engine can be run independently of the UI through
yarn run dev:engine
yarn run dev:ui
This builds the required deps and then runs the development server for studio. In the case that you might be changing the dependencies of Studio whilst using studio, you can use
yarn run dev:ui:live
which will run live dev for studio and its deps and update the dependencies
See additional developer documentation here for specifics on how the graph engine works
See the developer API here
You should be able to run the dev:<APP_OR_LIB>:graph
script to generate a dependency graph pdf in the ./graphs
directory.
We use yarn as our package manager. Pnpm causes some issues with libraries that rely on being relative to their source without symlinks
Learn more about the power of Turborepo: