๐Ÿ“ฆ savankansagra / transportOne

backend of transportation APIs

โ˜… 1 stars โ‘‚ 0 forks ๐Ÿ‘ 1 watching
hacktoberfestjava
๐Ÿ“ฅ Clone https://github.com/savankansagra/transportOne.git
HTTPS git clone https://github.com/savankansagra/transportOne.git
SSH git clone git@github.com:savankansagra/transportOne.git
CLI gh repo clone savankansagra/transportOne
savan savan sending email functionality made async. 88c1c7a 3 years ago ๐Ÿ“ History
๐Ÿ“‚ main View all commits โ†’
๐Ÿ“ .mvn
๐Ÿ“ APICollection
๐Ÿ“ src
๐Ÿ“„ .gitignore
๐Ÿ“„ learning.txt
๐Ÿ“„ mvnw
๐Ÿ“„ mvnw.cmd
๐Ÿ“„ pom.xml
๐Ÿ“„ Readme.md
๐Ÿ“„ README.md

API Documentation and guide.

Google doc edit

Google doc view

Figma desing url figma crendentails kansagrasavan111@gmail.com sa123van

Login

Register user.

Features
  • It will save the useremail and phone number to postgresql database.
  • generate random otp and save to storage for limited time.
  • send otp to email using smtp.google.com server.
  • send otp to mobile using twillo apis.
  • do more research into mobile send otp for optimization of cost.
  • Request type
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."
  • ROLES

Set the Roles and security

Features
  • Authentication of OTP.
  • create two Roles as "USER" and "OWNER" and assign them access.
  • Not Working, need to do more research. - create authentication of the user roles and roles based access of APIs.
  • Request type
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
  • create POST request of truck details. with OWNER role.
  • creating flag of verification pending.
  • verify document by admin user. and make flags true.

Thanks to References ##

Spring Security with Jwt token Authentication https://github.com/murraco/spring-boot-jwt