GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - codelion/stack: Open-source Clerk/Auth0 alternative

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

939 Commits
939 Commits

Folders and files

NameName
Last commit message
Last commit date
.changeset
.changeset
 
 
.github
.github
 
 
.vscode
.vscode
 
 
apps
apps
 
 
docs
docs
 
 
eslint-configs
eslint-configs
 
 
examples
examples
 
 
packages
packages
 
 
.gitignore
.gitignore
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
code-style.md
code-style.md
 
 
dependencies.compose.yaml
dependencies.compose.yaml
 
 
package.json
package.json
 
 
pnpm-lock.yaml
pnpm-lock.yaml
 
 
pnpm-workspace.yaml
pnpm-workspace.yaml
 
 
style-guide.md
style-guide.md
 
 
turbo.json
turbo.json
 
 
vercel.json
vercel.json
 
 
vitest.workspace.ts
vitest.workspace.ts
 
 

Repository files navigation

Stack Logo

📘 Docs | ☁️ Hosted Version | ✨ Demo | 🎮 Discord

Stack Auth: Open-source Clerk/Auth0 alternative

Stack Auth is a managed user authentication solution. It is developer-friendly and fully open-source (licensed under MIT and AGPL).

Stack gets you started in just five minutes, after which you'll be ready to use all of its features as you grow your project. Our managed service is completely optional and you can export your user data and self-host, for free, at any time.

We support Next.js frontends, along with any backend that can use our REST API. Check out our setup guide to get started.

Stack Setup

Table of contents

  • How is this different from X?
  • ✨ Features
  • 📦 Installation & Setup
  • 🌱 Some community projects built with Stack
    • Templates
    • Examples
  • 🏗 Development & Contribution
    • Requirements
    • Setup
    • Database migrations
    • Chat with the codebase
    • Architecture overview
  • ❤ Contributors

How is this different from X?

Ask yourself about X:

  • Is X open-source?
  • Is X developer-friendly, well-documented, and lets you get started in minutes?
  • Besides authentication, does X also do authorization and user management (see feature list below)?

If you answered "no" to any of these questions, then that's how Stack Auth is different from X.

✨ Features

<SignIn/> and <SignUp/>

Authentication components that support OAuth, password credentials, and magic links, with shared development keys to make setup faster. All components support dark/light modes.
Sign-in component

Idiomatic Next.js APIs

We build on server components, React hooks, and route handlers.
Dark/light mode

User dashboard

Dashboard to filter, analyze, and edit users. Replaces the first internal tool you would have to build.
User dashboard

Account settings

Lets users update their profile, verify their e-mail, or change their password. No setup required.
Account settings component

Multi-tenancy & teams

Manage B2B customers with an organization structure that makes sense and scales to millions.
Selected team switcher component

Role-based access control

Define an arbitrary permission graph and assign it to users. Organizations can create org-specific roles.
RBAC

OAuth Connections

Beyond login, Stack can also manage access tokens for third-party APIs, such as Outlook and Google Calendar. It handles refreshing tokens and controlling scope, making access tokens accessible via a single function call.
OAuth tokens

Impersonation

Impersonate users for debugging and support, logging into their account as if you were them.
Webhooks

Webhooks

Get notified when users use your product, built on Svix.
Webhooks

Automatic emails

Send customizable emails on triggers such as sign-up, password reset, and email verification, editable with a WYSIWYG editor.
Email templates

User session & JWT handling

Stack manages refresh and access tokens, JWTs, and cookies, resulting in the best performance at no implementation cost.
User button

M2M authentication

Use short-lived access tokens to authenticate your machines to other machines.
M2M authentication

📦 Installation & Setup

Refer to our documentation on how to set up Stack Auth in your Next.js project.

🌱 Some community projects built with Stack

Have your own? Happy to feature it if you create a PR or message us on Discord.

Templates

  • Stack Template by Stack Team
  • Next SaaSkit by wolfgunblood

Examples

  • Stack Example by career-tokens
  • Stack Demo by the Stack team
  • Stack E-Commerce Example by the Stack team

🏗 Development & Contribution

This is for you if you want to contribute to the Stack project or run the Stack dashboard locally.

Important: Please read the contribution guidelines carefully and join our Discord if you'd like to help.

Requirements

  • Node v20
  • pnpm v9
  • Docker

Setup

Pre-populated .env files for the setup below are available and used by default in .env.development in each of the packages. You should copy all the .env.development files to .env.local in the respective packages for local development.

In a terminal, start the dependencies (Postgres and Inbucket) as Docker containers:

docker compose -f dependencies.compose.yaml up

Then open a new terminal:

pnpm install

# Run build to build everything once
pnpm run build

# initialize the database and seed it with some data
pnpm prisma db push
pnpm prisma db seed

# Run code generation (repeat this after eg. changing the Prisma schema). This is part of the build script, but faster
pnpm run codegen

# Start the dev server
pnpm run dev

# In a different terminal, run tests in watch mode
pnpm run test

You can now open the dashboard at http://localhost:8101, API on port 8102, demo on port 8103, docs on port 8104, Inbucket (e-mails) on port 8105, and Prisma Studio on port 8106.

Your IDE may show an error on all @stackframe/XYZ imports. To fix this, simply restart the TypeScript language server; for example, in VSCode you can open the command palette (Ctrl+Shift+P) and run Developer: Reload Window or TypeScript: Restart TS server.

You can also open Prisma Studio to see the database interface and edit data directly:

pnpm run prisma studio

Database migrations

If you make changes to the Prisma schema, you need to run the following command to create a migration:

pnpm run prisma migrate dev

Chat with the codebase

Storia trained an AI on our codebase that can answer questions about using and contributing to Stack.

Architecture overview

  graph TB
      User((User))
      Admin((Admin))
      subgraph "Stack Auth System"
          Dashboard[Dashboard<br/>Next.js Application]
          Backend[Backend Service<br/>Next.js API]
          Database[(PostgreSQL Database)]
          EmailService[Email Service<br/>Inbucket]
          WebhookService[Webhook Service<br/>Svix]
          subgraph "Shared Packages"
              StackUI[Stack UI<br/>React Components]
              StackShared[Stack Shared<br/>Utilities]
              StackEmails[Stack Emails<br/>Email Templates]
          end
      end
      ExternalOAuth[External OAuth Providers]
      User --> Dashboard
      Admin --> Dashboard
      Dashboard --> Backend
      Dashboard -.-> |"(To be removed)"| Database
      Dashboard -.-> |"(To be removed)"| EmailService
      Backend --> Database
      Backend --> EmailService
      Backend --> WebhookService
      Backend --> ExternalOAuth
      Dashboard --> StackUI
      Dashboard --> StackShared
      Dashboard --> StackEmails
      Backend --> StackShared
      Backend --> StackEmails
      subgraph "External Services"
          Svix[Svix]
          WebhookService --> Svix
      end
      classDef container fill:#1168bd,stroke:#0b4884,color:#ffffff
      classDef database fill:#2b78e4,stroke:#1a4d91,color:#ffffff
      classDef external fill:#999999,stroke:#666666,color:#ffffff
      classDef deprecated stroke-dasharray: 5 5
      class Dashboard,Backend,EmailService,WebhookService container
      class Database database
      class ExternalOAuth,Svix external
Loading

Thanks to CodeViz for generating the diagram!

❤ Contributors

About

Open-source Clerk/Auth0 alternative

stack-auth.com

Resources

Readme
License

Contributing

Contributing

Security policy

Security policy
Activity

Stars

2 stars

Watchers

0 watching

Forks

1 fork
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.