AWS Builder Center
The Exodus: Find your Cabmate Journey

The Exodus: Find your Cabmate Journey

How we built Exodus for the First Commit, Bharat Builds Tour hackathon.

The Prelude

For the First Commit of the Bharat Builds Tour, my teammate Siddharth and I kept going back and forth about the problems we face as students and how we could solve them as part of the hackathon. While thinking about the problem statement, we got a WhatsApp message on our college campus group asking, "Anyone reaching Bangalore airport around 8 pm today? Please DM." After the reading message, we realized that during every long weekend or semester break, we get a spam of messages in our WhatsApp group from everyone looking for a "cabmate" to share a cab with. It's difficult to sift through 100s of messages to find the perfect match. To solve this, we decided to build Exodus.
Exodus is a "cabmate" matching engine where users can enter their desired departure time and route, and Exodus will provide them with the optimal group to share a cab for their journey. While there are apps that help us find a suitable "cabmate", the problem is that they don't give you a match. A student still has to browse through all the requests. What we did was add an algorithm that automatically groups students in the best possible way.

Rising Action

To get started, we needed to design Exodus's architecture and decide on its complexity. The overall complexity depended on whether we wanted to attack the "Build It" or "Ship It" problem. Since it was our first time working with AWS, we decided to build our application locally using the open-source AWS stack.
The overall flow was simple and intuitive. All the students from our college can log in to the application using their college email ID. Only verified email IDs, ending with @iiitb.ac.in, are allowed to use the application, and we used AWS Cedar Policy to define our authorization policies.
Once they are in, they are prompted to complete a form requesting their trip details. All a student has to fill in is their source and destination, departure date and time, and their buffer time (how flexible they are about leaving early or late). So if I wanted to leave for the airport at 5 pm on 21st September 2026, the details will be as follows:
  • Source: IIITB Campus
  • Destination: Kempegowda International Airport
  • Departure Date and Time: 21st September 2026, 5:00 pm
  • Buffer Window: 4:40 pm to 5:10 pm
The input collection phase was the easiest part of the build because we had to design the algorithm that would underlie student clustering. Based on our personal experience, where we get a regular sedan with 3 students sharing it, we decided to create groups of 3 based on their departure times and buffer windows. To create the groups, we used the generic greedy strategy of sorting the intervals and then getting the overlapping intervals. We run this grouping at a regular interval of 2 hours. In each iteration, we will have some number of students in the matching pool, and the scheduler will run our algorithm over the pool and generate the groups.
Once the groups are generated, each group will see its details, including the ideal departure time based on everyone's window and the cabmates' details. Students can choose to accept or decline the offered group. If everyone accepts the assigned group, we are happy; we don't have to worry about them again. But then the question was: what if students A and B accept the group, but C declines? It was a critical step in the decision-making process, as we had to ensure that one student's decision didn't affect others. To tackle this, we decided to leave the decision of dissolving the group in the hands of students A and B. If they want to leave the group, they will be returned to the matchmaking pool. Otherwise, they will be paired together in a single group. It ensures they have a group of two, and in the future scheduler release, if another student whose window matches theirs is available, that student will be assigned to this group.
We also wanted to make the application feel at home, so we decided to go with a little Cyberpunk theme. The login screen is visible as the cover image of this article.

AWS Integration

Until now, we had to fight back against the algorithmic decisions about how our application would process the trip details into meaningful groupings. While it wasn't easy, it was still the most familiar territory for us. It was then time to step into the alien land of AWS. None of us had worked with it before, so it was going to be a challenge, but a good learning experience for us. We decided to go with AWS LocalStack and AWS SAM (Serverless Application Model).
We defined our infrastructure as code using AWS SAM CLI. To run it locally, we used LocalStack in Docker and managed to simulate the AWS environment perfectly (small win, yayyy). After that, we had to come back to integrating our logic with the infrastructure. One basic security nuance was that if a student is not a part of a particular group, he/she shouldn't see that group. Thanks to Cedar, we managed to add this security using simple, human-readable policies. It helped us to decouple our security logic from our Python code.
Since the application consists of multiple functionalities, we needed to break our application down into small, single-purpose Lambda functions. So we decided to use one Lambda to handle students' request submissions, one to handle the scheduler release, which wakes everything up every few hours to run our grouping algorithm, and a third one to clean up dissolved groups. To store all the information, including the Pool of active requests and the Formed Groups, we used Amazon DynamoDB.
The best part of the build was to see everything come together. We used the EventBridge scheduler to schedule the regular triggers of our "Release" Lambda. We were thrilled to see the logs in our terminal as EventBridge triggered the Lambda, which pulled students from DynamoDB, ran our "Greedy" overlap algorithm, and then pushed the new groups back to the UI was a "Eureka" moment.
We are glad to have completed our project and delivered the agreed features within the given time constraints. We wanted to play more with the UI, like adding some cool animations with the cab, but due to time constraints, we couldn't. We would love to do that and also try deploying the application to AWS Cloud to see how it works in the real world.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article