Skip to content

Auth

The authentication system is handled by the Better Auth library, which provides most features you will ever need, plus some more.

Better-auth is heavily plugin-based, we propose a few guides on how to add some specific features like organizations, admin, etc.

Better-auth is using your database to store all of its data. Depending on the ORM you use, you might need to create some entities to store the data.

We use MikroORM in this boilerplate, and you can find the entities in the auth module.

Better-auth provides server and client methods, see the Better Auth documentation for more details.

Better-auth provides a OpenAPI schema and a live documentation of your API endpoints. You can find it at http://localhost:3000/api/auth/reference by default.

  1. Delete the auth module from the api/src/modules folder
  2. Remove the AuthModule from the api/src/app.module.ts file
  3. Remove the api/src/config/better-auth.config.ts file
  4. Remove the following dependencies from the api/package.json file:
"better-auth",
"better-auth-mikro-orm",
  1. Remove the following dependecies from the frontend apps
"better-auth",
  1. Remove the following env variables from the api/.env file:
BETTER_AUTH_SECRET=