A modern React application built with React 19, Vite, and Bootstrap 5 that demonstrates secure JWT authentication using ASP.NET Core Web API.
This project showcases industry-standard authentication techniques including JWT authentication, refresh token rotation, protected routes, automatic token refresh, and Axios interceptors.
- Home Page
- Login
- Register
- Profile
- Automatic Token Refresh
- ✅ User Registration
- ✅ User Login
- ✅ JWT Authentication
- ✅ Refresh Token Authentication
- ✅ Automatic Token Refresh
- ✅ Protected Routes
- ✅ React Context API
- ✅ Axios Request Interceptor
- ✅ Axios Response Interceptor
- ✅ Automatic Request Retry
- ✅ Automatic Logout on Invalid Refresh Token
- ✅ Bootstrap 5 Responsive UI
- ✅ React Router
| Technology | Version |
|---|---|
| React | 19 |
| Vite | Latest |
| React Router | Latest |
| Axios | Latest |
| Bootstrap | 5 |
| JavaScript (ES6+) | ✓ |
src
│
├── api
│ ├── authApi.js
│ ├── axiosClient.js
│ └── refreshApi.js
│
├── components
│ ├── Navbar.jsx
│ └── ProtectedRoute.jsx
│
├── context
│ └── AuthContext.jsx
│
├── hooks
│ └── useAuth.js
│
├── pages
│ ├── Home.jsx
│ ├── Login.jsx
│ ├── Register.jsx
│ └── Profile.jsx
│
├── services
│ └── tokenService.js
│
├── routes
│ └── AppRoutes.jsx
│
├── App.jsx
└── main.jsx
User Login
│
▼
Receive JWT + Refresh Token
│
▼
Store Tokens in Local Storage
│
▼
Axios Request Interceptor
Adds JWT to Every Request
│
▼
Protected API
│
▼
401 Unauthorized
│
▼
Axios Response Interceptor
│
▼
Refresh Token Endpoint
│
▼
New JWT + Refresh Token
│
▼
Retry Original Request
git clone https://github.com/YOUR_USERNAME/SecureAuthLab.React.gitcd SecureAuthLab.Reactnpm installCreate a .env file in the root directory.
VITE_API_BASE_URL=http://localhost:5248/apinpm run devThe application will be available at:
http://localhost:5173
This project works together with the SecureAuthLab ASP.NET Core Web API.
Backend Repository:
https://github.com/amjadaz8s5-dev/SecureAuthLab
- Modern React Development
- React Context API
- JWT Authentication
- Refresh Token Rotation
- Axios Interceptors
- Protected Routing
- Authentication State Management
- REST API Integration
- Component-Based Architecture
- Role-Based Authorization
- Remember Me Functionality
- Dark Mode
- User Profile Management
- Password Reset
- Email Verification
- Unit Testing
- Docker Support
- CI/CD Pipeline
Amjad Ali Khan
Senior Full Stack .NET Developer
- ASP.NET Core
- React
- React Native
- AWS
- SQL Server
GitHub:
https://github.com/amjadaz8s5-dev
This project is created for educational.




