Saving lives with the help of an app
Euro NCAP, the European New Car Assessment Programme, is making your car as safe as possible. The organization provides consumer information on the safety of new cars and does crash tests to give each model a score on their five-star safety rating system.
Cross-platform development
This information is also used on the rescue sheets, which are provided to the general audience and rescuers. Firefighters, for instance, need to have a blueprint of the cars in case of an accident. Thanks to these rescue sheets, which among other things, show where the battery and airbags are located, they are able to know how to get people out of a crashed car without causing additional damage.
In The Pocket developed an application that will help firefighters to read and use those rescue sheets even better. We developed the application in Xamarin, an efficient way to create an app that can run on both iOS and Android.
With the application, firefighters can easily select the brand and then choose the model based on the body style and generation of the car. This allows them to filter on the number of doors and the fuel type. They are then shown the rescue sheets and the ISO icons with the according fuel type.
Because victims need to be rescued as quickly as possible, we had to ensure that the application can also be used offline and is readable under all circumstances. It is often difficult to identify a car after a crash, so we use large photos in the identification process.
To test if everything works well, we went to the Melle fire station for a demonstration. The firefighters cut open an electric Jaguar by using the app, so we were able to gather their feedback afterward.
Resources
Cloud Scheduler
Cloud Scheduler, Google Cloud’s managed cron job scheduler, is used to start the synchronization. It fires an event on Pub/Sub that gets picked up by a Cloud Function. From then on, the synchronization process has been initiated.
Cloud Functions
The business logic is split up into multiple Cloud Functions. With Cloud Functions, you don’t have to provision servers, they make up what the industry calls an event-driven serverless compute platform. You also only have to pay for the time your code runs. For a synchronization task that runs once a day, this is the perfect solution. In addition, scalability is handled automatically. We developed the Cloud Functions in TypeScript that use a Node.js runtime.
Cloud Firestore
Data is stored in Cloud Firestore, the latest fully managed NoSQL database from Firebase and Google Cloud Platform. Data can be retrieved directly from the database via the native SDK. That way, an extra API layer is not necessary. For a project like this, with a simple data model, the use of Cloud Firestore results in a substantial saving of cost and development time.
Pub/Sub
Cloud Pub/Sub is a messaging service that allows asynchronous communication between autonomous services or applications, using a publish-subscriber pattern as you might have guessed. It is used to transfer data between the Cloud Functions. A Cloud Function is triggered when there’s a new event on the topic that it is listening on.
Cloud Storage buckets
The pictures of cars and rescue sheets are saved in Google Cloud Storage bucket. Buckets are ideal to serve static files. Documents can be uploaded and downloaded with a simple API provided by the native SDK.
Implementation
The project has two Cloud Functions. One Cloud Function is responsible for the synchronization of all data, the other downloads the documents and pictures and stores them in a Cloud bucket.
Cloud Scheduler triggers the data synchronization daily by firing an event on Pub/Sub. The event gets picked up by the Cloud Function and starts fetching the data from SharePoint to store in the Cloud Firestore database. While handling the data, the first Cloud Function fires events with information about rescue sheets or car pictures that have to be downloaded. These events trigger the execution of the second Cloud Function, which downloads and stores the file in a Cloud bucket.
By design, the Cloud Functions scale automatically, so based on the number of events fired, there can be multiple instances of the same Cloud Function running. This makes sure the files are handled very fast.
Infrastructure as Code
We use Terraform, the industry-leading tool to manage cloud infrastructure, for the provisioning of our cloud infrastructure and the deployment of our Cloud Functions. All cloud resources are defined and configured in source controlled terraform files, the so-called Infrastructure as Code.
The use of Terraform allows us to spin up different environments very easily without having to do manual actions in the Google Cloud Console. In combination with our CI/CD pipeline, the setup of the infrastructure and deployment of the code for this project is completely automated.
Next Steps
In time, extra features will be added that will make the recognition of the cars even smoother. For example, new models are often provided with a QR code and license plate recognition might also be an option. In the meantime, an Australian version of the application is being made, which will be used by ANCAP.