sf-foodtruck-finder
App that finds the 5 nearest food trucks in San Francisco based on the user's current location as required by: https://github.com/timfpark/take-home-engineering-challenge
The app is no longer accessible.
The application is hosted on Microsoft Azure and utilizes a static website that is the frontend for the application and an Azure Function that acts as the backend by executing a powershell script located in the Azure Functions folder of this project.
The backend of the application leverages the data provided by San Francisco's food truck open dataset located here and an endpoint with a CSV dump of the latest data. A storage account also has a copy for redundancy.
If you want to deploy your own instance of this application, please look at the ARM Template arm.json in Azure Infrastructure folder. The default value of some parameters will need to be modified especially the hostname basra.win and repository url. After modifiying the parameters, The ARM Template can be deployed in a new resource group. This can be done by the following PowerShell Az cmdlets: Instructions to Setup Azure Infrastructure
To create a new resource group use:
New-AzResourceGroup $RG
and then deploy the ARM template use:
New-AzResourceGroupDeployment -ResourceGroupName $RG -TemplateFile $Path_to_arm
After creating and deploying the Infrastructure. The Azure Function will need to be configured. Go to the Kudu Console advanced options and configure the Azure Function as follows: Add a folder named "bin" to "C:\home\site\wwwroot\" and then upload System.Device.dll to "C:\home\site\wwwroot\bin\" so that Get-SFfoodtruck can access it. This dll provides the .NET GeoCoordinate Class and its methods. The PowerShell Script in the Azure Function uses the GeoCoordinate.GetDistanceTo method to calculate distances between the user and the food trucks.
Future Development
Future Development will involve resolving errors related to pushpin visability and add new features including updated data redundancy, manual location entry as well as incorporation of more food truck datasets so that the application can be useful outside San Franciso. If you would like to make a pull request, the CI/CD pipeline is setup using GitHub Actions with PowerShell linting and automated unit testing via PlayWright Test. There are also instructions in /test/localtests/ on setting up a local version and validating local changes.