A full-stack user authentication and authorization application built using:
- Frontend: React, Next.js, TailwindCSS, Redux Toolkit, react-hook-form
- Backend: Node.js, Express.js, TypeScript, MongoDB (Mongoose), JWT, Zod
- User Registration & Login (JWT-based)
- Secure route protection (Private/Public routes)
- Zod-powered request validation
- Persistent login with refresh tokens
- Responsive and accessible UI
| Layer | Tech Used |
|---|---|
| Frontend | Next.js, React, TailwindCSS, Redux Toolkit, React Hook Form, Zod |
| Backend | Node.js, Express, TypeScript, MongoDB, Mongoose, JWT, Zod, bcrypt |
| Utilities | dotenv, cookie-parser, cors, eslint, prettier |
Follow these steps to set up and run the project locally.
git clone https://github.com/Shakilofficial/authentication-app.git
cd authentication-appcd server
npm install
cp .env.example .env
npm run devcd client
npm install
npm run devEnsure both the client and server folders have their own .env files.
PORT=5000
MONGO_URI=mongodb://localhost:27017/authdb
JWT_ACCESS_SECRET=your_jwt_access_secret
JWT_REFRESH_SECRET=your_jwt_refresh_secret
JWT_ACCESS_EXPIRES_IN=10d
JWT_REFRESH_EXPIRES_IN=30d
CLIENT_URL=http://localhost:3000