Getting Started

Architecture

Overview of the AuthSetu system architecture and design principles.


Architecture Overview

AuthSetu is designed as a modular, scalable identity management platform. It follows a multi-tenant architecture where organizations can manage multiple isolated projects.

System Components

1. Dashboard (Next.js)

The administrative interface for organization owners and admins. It allows for project configuration, API key management, and auditing.

2. API Server (Next.js Route Handlers)

A unified API for both the Dashboard and external integrations. It handles authentication, registration, and management tasks.

3. Database (PostgreSQL with Drizzle ORM)

The primary data store for all entities including Organizations, Projects, Customers, and Audit Logs.

4. SDKs

  • Android SDK: A Jetpack Compose based SDK for mobile authentication.
  • SDK-JS: A JavaScript client for web applications.

Key Design Principles

  • Security First: Passwords are never stored in plain text. JWTs are used for stateless authentication.
  • Multi-Tenancy: Data is strictly partitioned by projectId.
  • Developer Experience: Easy-to-use APIs and pre-built UI components.

Data Flow (Registration Example)

1. Client sends a POST request to /api/v1/auth/register.
2. resolveProject middleware identifies the project via API key or origin.
3. Password is hashed using argon2/bcrypt.
4. Customer record is inserted into the database.
5. Tokens are issued and returned to the client.

Was this page helpful?