<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: 我叫安特雷</title>
    <description>The latest articles on DEV Community by 我叫安特雷 (@roadsman).</description>
    <link>https://dev.to/roadsman</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4221123%2F6f6cc1c6-9b16-4109-8211-94dc9ce22f64.png</url>
      <title>DEV Community: 我叫安特雷</title>
      <link>https://dev.to/roadsman</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/roadsman"/>
    <language>en</language>
    <item>
      <title>I built a self-hosted auth system so you don't have to pay per user</title>
      <dc:creator>我叫安特雷</dc:creator>
      <pubDate>Sun, 01 Nov 2026 19:38:32 +0000</pubDate>
      <link>https://dev.to/roadsman/i-built-a-self-hosted-auth-system-so-you-dont-have-to-pay-per-user-2kdb</link>
      <guid>https://dev.to/roadsman/i-built-a-self-hosted-auth-system-so-you-dont-have-to-pay-per-user-2kdb</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;I got tired of paying per user for authentication services. So I built Knell - a self-hosted auth system that does one thing well.

&lt;span class="gu"&gt;## The Problem&lt;/span&gt;

Every auth vendor wants to charge you per user. Start small, grow big, and suddenly your auth bill is thousands per month. Plus you're handing over all your user data to a third party.

I wanted something I could deploy once, own forever, and actually understand how it works.

&lt;span class="gu"&gt;## What is Knell?&lt;/span&gt;

Knell is a self-hosted authentication system built with TypeScript, Fastify, and PostgreSQL. It handles accounts, sessions, and sign-in so your apps don't have to.

No bloat. No vendor lock-in. No mystery black boxes.

&lt;span class="gu"&gt;## Features&lt;/span&gt;

&lt;span class="gs"&gt;**Security first:**&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; Argon2id password hashing (the strongest algorithm available)
&lt;span class="p"&gt;-&lt;/span&gt; Rate limiting (5 login attempts per 15min)
&lt;span class="p"&gt;-&lt;/span&gt; Account lockout after failed attempts
&lt;span class="p"&gt;-&lt;/span&gt; IP blocking for bad actors
&lt;span class="p"&gt;-&lt;/span&gt; Timing attack prevention
&lt;span class="p"&gt;-&lt;/span&gt; OWASP Top 10 compliant

&lt;span class="gs"&gt;**Session management:**&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; JWT access tokens (15min expiration)
&lt;span class="p"&gt;-&lt;/span&gt; Refresh tokens (7 days, revocable)
&lt;span class="p"&gt;-&lt;/span&gt; Device fingerprinting
&lt;span class="p"&gt;-&lt;/span&gt; Max 5 concurrent sessions per user
&lt;span class="p"&gt;-&lt;/span&gt; Track last activity

&lt;span class="gs"&gt;**Performance:**&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; Handles 15k+ concurrent users
&lt;span class="p"&gt;-&lt;/span&gt; Sub-20ms response times
&lt;span class="p"&gt;-&lt;/span&gt; Connection pooling
&lt;span class="p"&gt;-&lt;/span&gt; Query batching
&lt;span class="p"&gt;-&lt;/span&gt; In-memory caching

&lt;span class="gu"&gt;## Quick Start&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
bash&lt;br&gt;
git clone &lt;a href="https://github.com/roadsman/knell-auth.git" rel="noopener noreferrer"&gt;https://github.com/roadsman/knell-auth.git&lt;/a&gt;&lt;br&gt;
cd knell-auth&lt;br&gt;
docker-compose up -d&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
That's it. Server runs on port 3000.

## API Example

**Sign up:**
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
bash&lt;br&gt;
curl -X POST &lt;a href="http://localhost:3000/signup" rel="noopener noreferrer"&gt;http://localhost:3000/signup&lt;/a&gt; \&lt;br&gt;
  -H "Content-Type: application/json" \&lt;br&gt;
  -d '{"email":"&lt;a href="mailto:user@example.com"&gt;user@example.com&lt;/a&gt;","password":"SecurePass123!"}'&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
Returns access token + refresh token.

**Authenticate requests:**
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
bash&lt;br&gt;
curl &lt;a href="http://localhost:3000/me" rel="noopener noreferrer"&gt;http://localhost:3000/me&lt;/a&gt; \&lt;br&gt;
  -H "Authorization: Bearer "&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;


## Why I Built This

1. **Cost** - No more per-user pricing
2. **Privacy** - My users' data stays with me
3. **Control** - I understand every line of code
4. **Learning** - Built exactly what I needed, nothing more

## Tech Stack

- **TypeScript** - Type safety for auth logic
- **Fastify** - Fast, low overhead HTTP server
- **PostgreSQL** - Reliable, battle-tested database
- **Argon2** - Memory-hard password hashing
- **Docker** - Easy deployment

## What's Next

This is v0.1.0. Coming soon:
- Email verification
- Password reset
- TOTP/2FA
- OAuth providers (Google, GitHub)
- WebAuthn/passkeys

## Try It

GitHub: https://github.com/roadsman/knell-auth

MIT licensed. Deploy it anywhere. Own your data.

Feedback welcome!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>opensource</category>
      <category>security</category>
      <category>node</category>
      <category>typescript</category>
    </item>
  </channel>
</rss>
