Frontend interface for the Viva Tech R&D Authentication System. This project provides a simple UI for OTP-based login and user registration, connected to the backend REST APIs.
- Mobile number based Login / Signup
- OTP Authentication
- User Registration
- Role Selection
- Resend OTP functionality
- Popup-based authentication UI
- Responsive design
- API integration using Fetch API
- HTML5
- CSS3
- JavaScript (Vanilla JS)
- Fetch API
- SweetAlert2 (alerts & notifications)
VIVATECH_ASSIGNMENT_FRONTEND/
│
├── index.html
├── css/
│ └── style.css
├── js/
└── index.js
Update the backend API URL in index.js:
const BASE_URL = "https://your-backend-url";
Example:
const BASE_URL = "https://vivatechrndbackend--xxxxx.replit.app";
User enters mobile number.
API Request:
GET /check_user_exist
If user exists → OTP will be sent.
GET /send_otp
If user does not exist → Registration form appears.
User provides:
- Name
- Role
API Request:
POST /add_user
OTP will be sent to the registered mobile number.
User enters OTP.
API Request:
POST /otp_submit
If OTP is valid → backend returns JWT token.
| Method | Endpoint | Description |
|---|---|---|
| GET | /check_user_exist |
Check if user exists |
| GET | /send_otp |
Send OTP |
| POST | /add_user |
Register new user |
| POST | /otp_submit |
Verify OTP |
| GET | /get_all_role |
Fetch available roles |
Open the project using Live Server.
Example:
Right Click → Open with Live Server
or open in browser:
http://127.0.0.1:5500
Frontend is deployed using Netlify.
Example:
https://vivatechrnd.netlify.app
- Navbar with Viva Tech R&D
- Login / Signup button
- Welcome message section
- Mobile number input
- Login / Signup button
- Name input
- Role selection dropdown
- OTP input field
- Resend OTP option
Sunny Lalwani
GitHub https://github.com/sunnylalwani41