Ride Handling App: Azure & .NET
Overview
The AMX Trucking Services Transportation Company wanted to create a ride-hailing app that allowed users to request rides and drivers to accept and provide the rides. They decided to use Microsoft Azure and .NET for the development and hosting of the app.
Requirements
Our client wanted following features in the app:
- Users should be able to request rides and specify their pickup and
drop-off locations. - Drivers should be able to view the rides and accept or reject them.
- Users should be able to track the status of their rides and
communicate with the drivers. - The app should have secure authentication and authorization
features.
Solution
The development team decided to use Xamarin for the frontend of the app because it allowed them to build native iOS, Android, and Windows apps using .NET and C#. They also decided to use ASP.NET Core for the backend because it was a lightweight and scalable framework that supported cross-platform development. They chose to use Microsoft Azure for the development and hosting of the app because of its wide range of services and global infrastructure.
For the ride request feature, the team implemented a Xamarin component that allowed users to request rides and specify their pickup and drop-off locations. They used the Azure Maps service to display the map and the Azure Functions service to store the ride data in a NoSQL database and notify the drivers of the new ride.
The driver acceptance feature was implemented using another Xamarin component that displayed a list of the rides and allowed drivers to accept or reject them. The component was connected to the backend using an Azure Function that updated the ride data in the database and notified the users of the acceptance or rejection.
The ride tracking and communication feature was implemented using another Xamarin component that displayed the status of the rides and allowed users to communicate with the drivers. The component was connected to the backend using another Azure Function that stored the communication data in the database and notified the drivers.
The authentication and authorization feature was implemented using Azure Active Directory (AD) and the Azure AD B2C service. They implemented a login page that used the Azure AD B2C service to authenticate users and send them to the dashboard page. They also implemented an API that verified the access token included in the request header before processing the request. This ensured that only authenticated and authorized users had access to the app.
Here are some technical details of the Microsoft Azure services used in the Uber-like app:
- Azure Maps is a set of tools and services that allows developers to add mapping and location functionality to their
applications. - Azure Functions is a service that allows developers to run small pieces of code, called “functions,” in response to events or
HTTP requests without having to worry about the underlying infrastructure. - Azure Active Directory (AD) is a service that allows developers to add authentication and authorization to their
applications easily. - Azure AD B2C is a service that allows developers to add customer identity and access management to their applications
easily. - Azure App Service is a service that allows developers to build, deploy, and scale web and mobile applications easily. The
team used it to host the frontend and backend of the app. - Azure CDN is a content delivery network (CDN) that allows developers to deliver content, such as HTML, CSS, and
JavaScript files, to users with low latency and high availability - Azure CDN is a content delivery network (CDN) that allows developers to deliver content, such as HTML, CSS, and
JavaScript files, to users with low latency and high availability.
Here are some details of the APIs developed for the Uber-like app:
Ride request API
This API allowed users to request rides and specify their pickup and drop-off locations. It accepted a POST request with the following JSON payload
{
“pickupLocation”: {
“latitude”: 47.6174,
“longitude”: -122.3184
},
“dropoffLocation”: {
“latitude”: 47.6199,
“longitude”: -122.3425
}
}
“pickupLocation”: {
“latitude”: 47.6174,
“longitude”: -122.3184
},
“dropoffLocation”: {
“latitude”: 47.6199,
“longitude”: -122.3425
}
}
It stored the ride data in a NoSQL database and notified the drivers of the new ride using the Azure Functions service. It returned a JSON response with the ride ID and the status
Copy code
{
“id”: “12345”,
“status”: “pending”
}
{
“id”: “12345”,
“status”: “pending”
}
Driver acceptance API
This API allowed drivers to accept or reject rides. It accepted a PATCH request with the following JSON payload:
Copy code
{
“status”: “accepted”
}
{
“status”: “accepted”
}
It updated the ride data in the database and notified the users of the acceptance or rejection using the Azure Functions service. It returned a JSON response with the ride ID and the updated status:
Copy code
{
“id”: “12345”,
“status”: “accepted”
}
{
“id”: “12345”,
“status”: “accepted”
}
Ride tracking and communication API
This API allowed users to track the status of their rides and communicate with the drivers. It accepted a GET request with the ride ID and returned a JSON response with the status and the communication history:
Copy code
{
“id”: “12345”,
“status”: “on the way”,
“communication”: [
{
“sender”: “user”,
“message”: “Where are you?”
},
{
“sender”: “driver”,
“message”: “I’m 5 minutes away.”
}
]
}
{
“id”: “12345”,
“status”: “on the way”,
“communication”: [
{
“sender”: “user”,
“message”: “Where are you?”
},
{
“sender”: “driver”,
“message”: “I’m 5 minutes away.”
}
]
}
It also accepted a POST request with the following JSON payload to send a message to the driver:
Copy code
{
“message”: “Can you pick up my friend as well?”
}
{
“message”: “Can you pick up my friend as well?”
}
It stored the message in the database and notified the driver using the Azure Functions service.
Industry - : Transportation
Technology Leveraged
- Xamarin
- .net
- C#
- ASP.NET
- Microsoft Azure