This project was created as an assessment task for a job interview at a California startup company (not related to Twilio itself). It uses React for the frontend and PHP for the backend. It does the following:
- Shows a list of some providers with contact info and Call button.
- When the button is clicked, the backend calls some administrator using Twilio API and speaks a message.
- From the same call the selected provider is called and connected to the administrator when the call is answered.
The frontend UI features include custom dropdown lists, table sorting, and an adaptive layout. It also queries the backend for call status and shows notifications.
Any phone numbers can be used for both calls. Call status is tracked with hooks. A MySQL database is used to store the list of providers and call history.
- Create a MySQL database and run
generate.sqlon it. - Edit
hidden/config.jsonand fill all the missing data. - Place the
backfolder to a web server so thatpublicdirectory is used as the doc root, or renamepublicto anything you like.
You may use localhost for almost all the testing, except that Twilio hooks require a public host name.
To test your setup, request the URL:
https://your-public-host.com/api/getProviders
- Edit
front/src/Client.jsand set your backend URL inbaseUrlproperty. - Run:
npm install
npm startThis should open https://localhost:3000 in your default browser. Navigate there manually if this did not happen.
- The layout was provided as a raster image by the company requesting the task be done. Frontend and the screenshot are a custom work of mine.
- The public domain logo placeholder was obtained at https://publicdomainvectors.org/en/free-clipart/Daisy-vector-border/1462.html