A full-stack web application that provides user authentication with JWT-based cookie authentication, real-time validation, and an enhanced user experience. It can be used as a template to quickly start new projects without setting up authentication from scratch.
✅ User Authentication (Signup, Login, Logout)
✅ Sign in with either Username or Email
✅ JWT Token Authentication (Cookie-based)
✅ Remember Me (Store token locally for persistent login)
✅ Real-time Form Validation (Ensuring proper inputs)
✅ Responsive UI (Mobile-first approach with Tailwind CSS)
✅ Real-time Notifications (Accurate error messages & feedback)
✅ Rate Limiting (Using express-rate-limit
for security)
✅ Backend Validation & Error Handling
✅ Middleware Support (For protected routes & auth checks)
✅ Confetti for Great UX 🎉
✅ Docker Support (Easy setup with docker-compose
)
✅ Production-ready Template (Quickly start new projects)
- Node.js + Express.js
- TypeScript
- MongoDB Atlas (Cloud database)
- JWT Authentication
- Rate Limiting (Prevent brute force attacks)
- React (with Hooks)
- Vite (Fast development build tool)
- TypeScript
- Tailwind CSS (Modern styling)
- Redux Toolkit (State management)
- Confetti & Toast Notifications (For better UX)
git clone https://github.com/ayusharma-ctrl/AuthFlowTs
cd AuthFlowTs
Both frontend and backend require .env
files. Sample files (.env.example
) are provided for reference.
There are two ways to run the app:
cd server
npm install
npm run dev
cd client
npm install
npm run dev
You can use Docker to run both services easily with Docker Compose.
docker-compose up --build
To stop the containers, run:
docker-compose down
- Frontend: http://localhost:5173
- Backend: http://localhost:8000
Method | Endpoint | Description |
---|---|---|
POST | /api/v1/auth/signup |
User Registration |
POST | /api/v1/auth/signin |
User Login |
POST | /api/v1/auth/signout |
User Logout |
Method | Endpoint | Description |
---|---|---|
GET | /api/v1/user |
Get User Details |
Method | Endpoint | Description |
---|---|---|
GET | / |
Test API Response |
- JWT Token Authentication (Cookie-based)
- Rate Limiting (Prevent brute force attacks)
- Secure Password Storage (Using bcrypt)
- Proper Input Validation (Prevent SQL Injection & XSS)
Clone the repo and start building your next project without worrying about authentication setup! 🎉