PRISM: Building an AI-Powered Event Photo Gallery with AWS Serverless Architecture
PRISM is an AI-powered event photo gallery that uses AWS serverless services and Amazon Rekognition to help guests quickly find photos they appear in. This article explores the architecture, authentication flows, serverless backend, image-processing pipeline, data storage, and lessons learned while building the project.
π€ The Problem
We've all been there.
You attend an event πΈ, someone takes hundreds or thousands of photos, and later you're given a huge gallery.
Now begins the adventure:
"Was I in photo 247?" π
"Wait... maybe photo 613?"
"Let me check all 1,200 photos..." π
I wanted to make that process much simpler.
So the idea behind PRISM was:
π€³ Upload a selfie β π Search β πΈ Find your photos
Instead of manually scrolling through an entire event gallery, guests can provide a reference selfie and let the system search for photographs in which they appear.
That's where AWS + Amazon Rekognition came into the picture. βοΈπ€
πͺ How PRISM Works
PRISM has two main types of users:
π¨βπΌ Event Hosts
π Event Guests
π Event Guests
And each has a slightly different journey.
π¨βπΌ For the Host
The host logs in and manages the event:
1
2
3
4
5
6
7
8
9
10
11
π Host Login
β
π€ Amazon Cognito
β
π₯οΈ Host Dashboard
β
π Create Event Room
β
π€ Upload Event Photos
β
βοΈ Amazon S3Hosts can create unique event rooms and upload their event photographs directly to S3.
π For the Guest
Guests don't need to go through the same authentication flow.
Instead:
1
2
3
4
5
6
7
8
9
10
11
12
13
π Event Link
β
π Room Code
β
π« Guest Session / JWT
β
π€³ Upload Selfie
β
π€ Amazon Rekognition
β
π Search
β
πΈ Your Photos!The guest experience is designed to be as simple as possible: enter the event β upload a selfie β find your photos.
βοΈ The AWS Architecture
This is where things get interesting. π
Instead of building a traditional backend running on a dedicated server, I used a serverless AWS architecture.
The main building blocks are:
π₯οΈ AWS Amplify β Frontend hosting
π Amazon Cognito β Host authentication
π API Gateway β API entry point
β‘ AWS Lambda β Backend processing
ποΈ Amazon DynamoDB β Application data
πͺ£ Amazon S3 β Event photo storage
π€ Amazon Rekognition β Facial analysis
β° Amazon EventBridge β Scheduled tasks
π Amazon Cognito β Host authentication
π API Gateway β API entry point
β‘ AWS Lambda β Backend processing
ποΈ Amazon DynamoDB β Application data
πͺ£ Amazon S3 β Event photo storage
π€ Amazon Rekognition β Facial analysis
β° Amazon EventBridge β Scheduled tasks
The frontend uses React, Vite, and Tailwind CSS, while the backend is deployed using AWS SAM/CloudFormation with Python 3.11 Lambda handlers.

πΈ PRISM AWS Serverless Architecture & Data Flow. The diagram illustrates the complete PRISM architecture, showing how the frontend, authentication layer π, Lambda compute β‘, DynamoDB ποΈ, S3 π¦, Amazon Rekognition π€, and EventBridge β° work together. It also highlights separate host and guest access flows, JWT authorization π, photo processing π€, facial-recognition search π, and cascade deletion operations ποΈ.
π Authentication: Hosts vs Guests
One of the interesting design problems was:
How do you authenticate event organizers without forcing every guest to create an account? π€
I decided to separate the two flows.
π¨βπΌ Hosts
Hosts use Amazon Cognito.
1
2
3
4
5
6
7
8
9
π¨βπΌ Host
β
π Cognito
β
π« Authentication Token
β
π API Gateway
β
β‘ LambdaThis gives hosts authenticated access to their event management functionality.
π Guests
Guests use a different flow:
1
2
3
4
5
6
7
8
9
10
11
π Guest
β
π Room Code
β
π« JWT Session
β
π‘οΈ Lambda Authorizer
β
π API Gateway
β
β‘ LambdaThe guest authorization layer uses JWT-based sessions with an API Gateway Lambda Authorizer.
This was one of those architectural decisions that looks simple on paper but becomes really interesting when you actually implement it. π
π€ Uploading Event Photos
Now comes the part where things get photo-heavy. πΈπΈπΈ
Imagine an event with hundreds or thousands of photos.
I didn't want every large image to travel through the application backend unnecessarily.
Instead, PRISM uses Amazon S3 as the main photo storage layer.
The simplified flow is:
1
2
3
4
5
6
7
8
9
π₯οΈ Application
β
β‘ Lambda
β
π Presigned S3 URL
β
πͺ£ Amazon S3
β
πΈ Image StoredThis keeps the actual image storage separate from the application logic.
And that's one of the things I really enjoyed about working with AWS β you can let each service focus on what it does best. π‘
π€ Where the AI Comes In
This is probably my favorite part of PRISM. π
Once photographs are uploaded, PRISM can process them using Amazon Rekognition.
The basic idea is:
1
2
3
4
5
6
7
8
9
10
11
πΈ Photo Uploaded
β
πͺ£ Amazon S3
β
β‘ Event Trigger
β
Ξ» AWS Lambda
β
π€ Amazon Rekognition
β
π§ Face IndexingThe architecture uses S3 object creation events to trigger processing and connect the uploaded images with Rekognition indexing.
So instead of manually asking the backend to process every image, the system can react to the upload event automatically.
That's where the event-driven architecture starts becoming really useful. π
π Finding Your Photos
Now imagine you're attending an event.
You upload one selfie:
π€³ "This is me."
PRISM then uses the facial information provided by Amazon Rekognition to search the indexed event photographs.
Conceptually:
1
2
3
4
5
6
7
8
9
10
11
π€³ Reference Selfie
β
β‘ Search Lambda
β
π€ Amazon Rekognition
β
π Matching Faces
β
ποΈ Photo Metadata
β
πΈ Matching PhotosAnd hopefully...
π There you are!
ποΈ DynamoDB: Keeping Everything Organized
Of course, finding faces isn't enough.
PRISM also needs to know things like:
- π Which event does this photo belong to?
- πΈ Which S3 object represents the photo?
- π€ Which guest session is accessing it?
- π Which room is being requested?
That's where Amazon DynamoDB comes in.
DynamoDB acts as the application's NoSQL data layer, while S3 handles the actual image objects.
So I ended up with a nice separation:
DynamoDB β "What is this data?" ποΈ
S3 β "Where is the actual image?" πͺ£
π§Ή What Happens When an Event Is Deleted?
This turned out to be more interesting than I initially expected. π
Deleting an event isn't necessarily:
ποΈ Delete one database row.
An event can have:
π Event information
πΈ Photo records
πͺ£ S3 objects
π€ Rekognition face data
πΈ Photo records
πͺ£ S3 objects
π€ Rekognition face data
So the deletion process needs to consider the relationships between these resources.
PRISM includes cascading operations to keep related application data synchronized when event resources are removed.
This was a good reminder that:
Cloud architecture isn't just about creating resources β you also have to think about what happens when those resources need to disappear. π§ΉβοΈ
β° EventBridge & Background Tasks
Not everything needs to happen while a user is staring at the screen.
Some maintenance operations can happen in the background.
That's where Amazon EventBridge comes into the architecture. β°
The idea is:
1
2
3
4
5
β° Scheduled Event
β
β‘ Lambda
β
π§Ή Cleanup / MaintenanceThis allows scheduled operations to run independently from normal user requests.
π§° Tech Stack
Here's the toolbox behind PRISM π οΈ:
π¨ Frontend
- βοΈ React
- β‘ Vite
- π¨ Tailwind CSS
- βοΈ AWS Amplify
βοΈ Backend
- π Python 3.11
- β‘ AWS Lambda
- π Amazon API Gateway
- ποΈ AWS SAM / CloudFormation
ποΈ Storage & Database
- πͺ£ Amazon S3
- ποΈ Amazon DynamoDB
π€ AI
- π§ Amazon Rekognition
π Security
- π€ Amazon Cognito
- π‘οΈ API Gateway Lambda Authorizers
- π« JWT-based guest sessions
β° Automation
- π Amazon EventBridge
The repository contains separate frontend and backend components along with the AWS infrastructure configuration and architecture diagrams.
π§ What I Learned
This project changed the way I think about learning AWS.
Initially, it can feel like AWS is just a huge list of services:
"Learn S3."
"Learn Lambda."
"Learn DynamoDB."
"Learn Cognito." π΅βπ«
But building PRISM showed me that the interesting part isn't just knowing what each service does.
It's understanding:
How do these services work together? π€
Through PRISM, I got hands-on experience with:
βοΈ Serverless architecture
β‘ AWS Lambda
π API Gateway
π Cognito
π« JWT authorization
πͺ£ S3
π Presigned URLs
ποΈ DynamoDB
π€ Rekognition
β‘ Event-driven processing
β° EventBridge
ποΈ Infrastructure as Code
π§Ή Cross-service cleanup
β‘ AWS Lambda
π API Gateway
π Cognito
π« JWT authorization
πͺ£ S3
π Presigned URLs
ποΈ DynamoDB
π€ Rekognition
β‘ Event-driven processing
β° EventBridge
ποΈ Infrastructure as Code
π§Ή Cross-service cleanup
And probably the biggest lesson:
A cloud application is more than a collection of services. The real engineering challenge is designing how those services communicate with each other.
π What's Next?
PRISM is still a project I'm using to learn and experiment, so there are plenty of things I'd like to explore next. π
Some areas I'm interested in:
π More security improvements
π Better monitoring and observability
π° AWS cost optimization
π Scalability for larger event galleries
π οΈ More robust error handling
β‘ Performance improvements
βοΈ Making the architecture more production-ready
π Better monitoring and observability
π° AWS cost optimization
π Scalability for larger event galleries
π οΈ More robust error handling
β‘ Performance improvements
βοΈ Making the architecture more production-ready
There is still a lot to learn, and that's honestly one of the most enjoyable parts of working on cloud projects. π
π Try PRISM!
Enough reading. π
If you'd like to see the project in action:
π Live Demo: Try PRISM πΒ
You can explore the deployed application and try the event photo workflow.
π» Explore the Code
Want to see what's happening behind the scenes? π
π GitHub: AnweshBhattacharya/PRISM π»Β
The repository includes the frontend, backend, AWS infrastructure configuration, and architecture documentation.
π― Final Thoughts
PRISM started with a pretty simple question:
"What if finding your photos at an event was as easy as uploading a selfie?" π€³
Building that idea turned into a much bigger learning experience around AWS, serverless architecture, AI, authentication, storage, APIs, and event-driven systems.
The coolest part for me wasn't using one particular AWS service.
It was seeing this:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
π€ User
β
π Frontend
β
π Authentication
β
π API Gateway
β
β‘ Lambda
β
ποΈ DynamoDB
β
πͺ£ S3
β
π€ Rekognition
β
πΈ Photos...actually become a working application. πβοΈ
I'm continuing to explore AWS, cloud architecture, and DevOps, and PRISM has been a great hands-on project along that journey.
π¬ Your turn!
If you're also building something with AWS:
What's the coolest AWS project you've built, and which service gave you the biggest "aha!" moment? π€βοΈ
I'd love to hear about it! π
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article