API Documentation and guide.
Google doc edit
Google doc view
Figma desing url
figma crendentails
kansagrasavan111@gmail.com
sa123van
Login
Register user.
Features
request type: POST
path: api/register
request payload: {
"useremail": "kansagra@gmail.com",
"telephoneNumber": "+919316370069"
}
response : {
"message": "otp was send to email and phone. please enter otp."
}
Logic :
- enter email and phone number into user table of database. here we used postgres as database.
- if table already contain the entry then it will return message "fail to save user."
Set the Roles and security
Features
request type: POST
path: api/authentication/useremail
request payload: {
"useremail": "kansagra@gmail.com"
"otp": "636578" // 6 digit otp message
}
success response : {
"message": "Authentication successfull"
}
failed response : { //if email is wrong
"message" : "enter valid email address."
}
failed response : { //if OTP is wrong or expired.
"message" : "OTP is expired or it is wrong."
}
-----------------
request type: POST
path: api/authentication/userTelephoneNumber
request payload: {
"telephoneNumber": "+919316370069",
"otp": "636578" // 6 digit otp message
}
success response : {
"message": "Authentication successfull"
}
failed response : { //if mobile number is wrong
"message" : "enter valid mobile address."
}
failed response : { //if OTP is wrong or expired.
"message" : "OTP is expired or it is wrong."
}
------------------
request type: POST
path: api/role/setRole
request payload: {
"telephoneNumber": "+919316370069",
"Role": "USER" Or "OWNER"
}
success response : {
"message": "USER OR OWNER role is successfully."
}
failed response : { //if mobile number is wrong
"message" : "Setting role is unsuccessfull."
}
Logic :
- enter otp code with the email address or phone number.
- If Authentication with Otp is successfull then create JWT token with all neccesary user claims and send to client.
- It also assign the Role "USER" or "OWNER" with user_role table.
Upload Truck Details - "OWNER" role side.
upload truck details with valid documents.
Features
Thanks to References ##
Spring Security with Jwt token Authentication
https://github.com/murraco/spring-boot-jwt