DEV Community

Cover image for I Built My Own Auth Server Instead of Reusing Firebase — Here’s What I Learned
MSPK
MSPK

Posted on

I Built My Own Auth Server Instead of Reusing Firebase — Here’s What I Learned

I built AuthServer because I got tired of copy-pasting login and OAuth logic every time I started a new project. This semester alone, I had three different apps (React, React Native, and a backend service) that all needed authentication, and maintaining separate auth logic was painful.

uthServer is a standalone authentication backend that handles:

email/password login

Google OAuth

JWT token verification

password resets

basic user profile APIs

It exposes REST APIs so other apps can integrate without handling secrets directly.

I built it using Node.js, Express, and MySQL, containerized everything with Docker, and set up Jenkins to deploy it to my own server. Setting up CI/CD for a personal project was new for me, and I broke the pipeline more times than I’d like to admit.

The hardest part was OAuth and token handling. I ran into multiple issues with Google OAuth callbacks, token expiry, and JWT verification across services. Debugging these taught me a lot about how fragile auth flows can be if you don’t design them carefully.

I originally built this for my own projects, but I ended up documenting it properly so other developers could try it as well. From start to finish (coding, debugging, and writing docs), this took me about 4–5 days of focused work.

It’s not perfect, but it works — and building my own auth system helped me understand why most teams rely on managed providers instead of rolling their own.

Repository: https://github.com/mspk5196/AuthServer.git
NPM client:

npm i @mspkapps/auth-client
Enter fullscreen mode Exit fullscreen mode

Website: https://authservices.mspkapps.in

If you’ve built auth systems yourself or have suggestions on what I should improve next, I’d love feedback.

Top comments (2)

Collapse
 
sigje profile image
Jennifer Davis

I'm really curious what was frustrating about the auth part. One thing I've learned in my years in the industry, never build your own auth system (maybe the only other one higher priority is building your own encryption) but I'm curious what was challenging that you solved for yourself?

Collapse
 
sigje profile image
Jennifer Davis

to be clear, the only higher priority is to never build your own encryption. :)