ory-kit Svelte Themes

Ory Kit

☄️ An easy-to-use starting point to self-host Ory Kratos with OAuth2 and OIDC, SvelteKit authentication UI [SvelteKit - development stopped]

☄️ Ory Template

[!Warning]
Development on this project has been stopped in favour of Next-Ory!
Next-Ory is the NextJS-based successor to this project.

The goal of this project is to create an easy-to-use setup to self-host Ory Kratos and Ory Hydra. It will contain an authentication UI, implementing all self-service flows for Ory Kratos and Ory Hydra, as well as an admin UI. All UI components are written in Svelte and Typescript, and styled using TailwindCSS.

Getting started

Start the backend services using Docker Compose:

cp /docker/ory-dev/.env.example /docker/ory-dev/.env
docker compose -f docker/ory-dev/docker-compose.yaml up -d
sh docker/ory-dev/hydra-setup.sh # creates an OAuth2 client (test the consent flow on http://localhost:5555)

Then start the authentication UI using npm:

cd authentication
cp .env.example .env
npm install
npm run dev

Deployment

Deploying the authentication Node on your server is relativly easy. Everything is prepared and the required steps to take are as few as possible. Just follow the steps below.

  1. Clone this repository to your development machine.
  2. Replace all occurences of "accounts.thielker.xyz" with your domain.
  3. Copy the .env.example file in /docker/ory-test/ to .env. Make sure the domains were changed in step 2.
  4. Configure the CORS rules in /docker/ory-test/ory/kratos/kratos.yaml and /docker/ory-test/ory/hydra/hydra.yaml.
  5. Configure the cookies in in /docker/ory-test/ory/kratos/kratos.yaml and /docker/ory-test/ory/hydra/hydra.yaml.
  6. Configure the WebAuthn ID in /docker/ory-test/ory/kratos/kratos.yaml. This has to be the top level domain, where the authentication UI will be hosted.

Thats everything you need to change in the configurations. Make sure that all changes are only inside docker/ory-test/. To actually deploy the project, you need to have Docker and Docker Compose installed on your server.

  1. Open the /authentication/deploy.sh script and change the variables at the top to your needs.
  2. Execute the script on your local development machine.

The script will build the docker image for the authentication UI, export it as a tar file, copy it with all required configurations and the docker-compose.yaml to your server and import it there. Then it will start the docker containers on your server.

Authentication UI

The authentication UI is already implemented and working. It supports all self-service flows for Ory Kratos and Ory Hydra. It is implemented in a way, that customizing style and page layout is very easy.

Next steps

The foundation is laid out, but there is still a lot of work to do. The next steps are:

  • Finish the authentication UI
  • Add OpenID Connect sample
  • Add Keto and Oathkeeper to the docker setup
  • Start working on the admin UI

If you want more specific information about the next steps, take a look at the issues.

Admin UI

soon.

Top categories

svelte logo

Need a Svelte website built?

Hire a professional Svelte developer today.
Loading Svelte Themes