Hey there! Iβm Yatharth Kumar Saxena, and over the last 30 days I hand-crafted a production-grade authentication service (π 296 commits, 4500+ lines of handwritten code). Now Iβm opening the doors so the community can push it even further.
- π Introduction (#-introduction)
- π οΈ What Went In (#-what-went-in)
- π§© Current Architecture (#-current-architecture)
- ποΈ Folder Structure (#-folder-structure)
- π§βπ» Open Contribution Areas (#-open-contribution-areas)
- π€ How to Contribute (#-how-to-contribute)
- βοΈ Tech Stack & Principles (#-tech-stack--principles)
- π― Final Takeaway (#-π―-final-takeaway)
This repository is purely for external contributions. Think of it as the public workshop where we co-create new features, squash bugs, and polish the architecture. The original solo build lives here.
βSystem fails. Design survives.β β YKS
- β³ 30 days of focused backend design & development.
- β 296 commits β every thought versioned.
- π 4500+ lines of handwritten code (excluding Express.js boilerplate).
- π§ 17 APIs Β· JWT auth Β· device-aware sessions Β· rate limiting Β· single-admin model.
Design Principles: SOLID Β· DRY Β· YAGNI Β· KISS
Design Patterns: Singleton Β· Factory Β· Template Method Β· Strategy Β· Chain-of-Responsibility
The service is microservice-ready and battle-tested for scalability.
Total files: 60+ (source, configs, docs, tests excluding node_modules folder)
π /folder | π·οΈ Description |
---|---|
configs/ |
π οΈ Environment & token configs |
controllers/ |
π§© Route logic & orchestration |
middlewares/ |
π Auth, role, rate-limit chains |
models/ |
ποΈ Mongoose schemas |
rate-limiters/ |
β±οΈ Custom limiter factories |
services/ |
βοΈ Business logic abstractions |
utils/ |
π§° Helper utilities |
README.md |
πΊοΈ You are here! |
Every sub-folder contains its own README.md
with deeper details. π
-
OTP Verification Workflow π²
Goal: After sign-up,isActive
stays false until user verifies a 6-digit OTP (email/SMS).
Controller should wait up to 30 s for verification; else user re-requests OTP.
Clean, modular design (consider pluggable microservice vs internal API). -
Forgot-Password API π
Secure token/OTP flow β password reset. -
Enhanced Logging π
Structured logs, trace IDs, winston/pino integration. -
Performance & Reliability β‘
Caching, graceful shutdowns, horizontal scalability ideas. -
Bug Fixes / Refactors π
Anything that boosts maintainability, reliability, or availability.
Contributions must align with existing HLD/LLD and follow design principles.
- Fork this repo β create a feature branch.
- Run
npm install
& rename.env.sample
β.env
. - Write clean, commented code + unit tests.
- Create a PR referencing an open issue.
- Fill out the PR template (design rationale, test evidence).
Note: First-time OSS contributors welcome! π
- Node.js + Express.js (REST)
- MongoDB/Mongoose (TTL indexes for cleanup)
- JWT (access & refresh)
- Cron jobs (log & account cleanup)
- Rate Limiting (device/user aware)
Design mantra: clean code, clear contracts, scalable architecture.
This project started as my personal deep-dive into system design. Now itβs our playground to experiment, learn, and craft production-ready auth-tech together. Your smallest PR or biggest refactor β everything counts.
Looking forward to your valuable contributions! π