Coder Social home page Coder Social logo

mahamshahid18 / valet-app Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 226 KB

This application aims to automate the general flow of valet parking systems by handling the ticket generation, payment, and verification of payment digitally.

JavaScript 44.41% HTML 55.59%
valet payment ticket backend automation rest api express nodejs

valet-app's Introduction

Valet Ticket Automation Application

This application aims to automate the general flow of valet parking systems by handling the ticket generation, payment, and verification of payment digitally.

This is the item to be reviewed in this repository

How It Works

There are 2 parts of the application. A user-facing application. And a version for the valets/parking attendants. Upon arrival, the user simply has to provide his/her name, phone number and the car's details to the valet. The valet will generate a ticket for them using the application. And the user will get a link through SMS, to view the ticket and associated details. The user can also pay for the ticket. However, the payment system has not been integrated in the current version of the application. When the user wants to leave, instead of handing over the ticket physically to the valet & waiting for the car to arrive, he/she can simply pay for the ticket online and then "Call Car" beforehand. They will receive a QR Code at this point, from the application. This has to be shown to the valet. And the car will be waiting to be picked up - without any wait.

API Design

The application uses 4 endpoints. They have been documented below:


POST {baseurl}/generateTicket

Params
  • name
  • phone_number
  • reg_no
  • color
  • model_make
Returns
  • 200 OK

POST {baseurl}/updatePaymentStatus

Params
  • ticket_no (body param)
Returns
  • 200 OK

GET {baseurl}/user

Params
  • ticket (query param)
Returns
  • ticket_no
  • name
  • amount_to_be_paid

GET {baseurl}/user/validation

Params
  • ticket (query param)
Returns
  • segments (json data containing info for QR Code)

API Implementation

Please see the complete implementation of the API backend here.

API Testing

The API's endpoints have been tested with Postman. Please find the tests here

Usage Instructions

If you want to run the backend server (the REST API), please follow the following steps

  • Install Node.js if you don't already have it installed
  • Run npm install to install all dependencies
  • Make changes in the config.json file to set IP Address and port accordingly
  • Run npm start to start the server
  • app.js code conforms to the Node Style Guide. Run npm run lint to lint the code

Extra Information

This information is just to get the app working. For the app-developers only

  1. Add receiving number to verified list of numbers on Twilio to be able to send sms

    • Login with Twilio Account Credentials
    • Navigate to https://www.twilio.com/console/phone-numbers/verified
    • Click on the Add New Number button
    • Add the new number (+[country code][phone number]) => follow this format
    • Add in the verification code sent to that number
    • Number is verified. Now sms can be sent to this number
  2. Find out IP address of the machine you're using

    • Click Start and type "PowerShell". Open it up
    • Now type ipconfig
    • Under the Wireless LAN adapter Wi-Fi heading, find the number listed with 'IPv4 address' (for example, it can be 192.168.1.7)
    • Copy this IP address
  3. Change IP address in configuration file

    • Open up the config.json file in the main folder (of the project)
    • Replace the number listed against baseUrl field with the IP address you copied
    • Save changes
  4. Start backend server

    • While within the main folder of the project (for example C:/users/user/Valet/), hold down the Shift key and right click with the mouse simultaneously inside the folder window.
    • Click on Open PowerShell window here
    • Now type in the following command to start the server: node app

And that's it. Now you can start using the application. Navigate to http://{your_ip_address}/valet/app/templates/#!/ to open up the main page

valet-app's People

Contributors

mahamshahid18 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.