The idea
Finding out what’s happening tonight usually means checking five Instagram pages and a couple of group chats. PartyPopped puts it all in one place. Organisers post events with ticket tiers, a lineup and a venue. Everyone else can browse by city or category, search, bookmark events, and follow the organisers they like.
My favourite feature is “I’m here”. Once an event has actually started, people who are there can post a photo from it. Your feed then has a Live tab that shows where the people you follow are right now, with attendance counts. Afterwards, organisers can download every photo from their event as a single ZIP.
Supabase logs you in, Spring checks the token
I didn’t want to write password storage, email verification and Google sign-in myself, so Supabase handles all of that. But I also didn’t want the backend to just trust whatever the frontend tells it. So every request carries the Supabase token, and a custom Spring Security filter checks its signature with a shared HMAC secret before anything runs:
if (authHeader == null || !authHeader.startsWith("Bearer ")) {
filterChain.doFilter(request, response);
return;
}
String token = authHeader.substring(7);
if (jwtService.validateToken(token) &&
SecurityContextHolder.getContext().getAuthentication() == null) {
String personId = jwtService.extractPersonId(token);
var authToken = new UsernamePasswordAuthenticationToken(personId, null, List.of());
SecurityContextHolder.getContext().setAuthentication(authToken);
}
The user ID inside the token becomes the logged-in user for that request. The backend never stores a session, and login logic lives in exactly one place. Most GET requests are public, so you can browse without an account. Anything that creates, changes or deletes something needs a valid token.
Same structure in every module
The backend is split by feature: events, profiles, attendance, follows, bookmarks, feed, search, ticket tiers. Each one has the same folders inside it: controller, service, repository, entity, DTO and mapper. I wrote the DTO mappers by hand so the API’s responses never accidentally leak a database entity.
Feeds without the N+1 problem
The feed is the part I rewrote the most. The obvious version loads a page of events and then runs one more query per event for its ticket prices, which falls over fast. The version that shipped:
- Gets the list of organisers you follow.
- Runs one paged query for their events.
- Loads the ticket tiers for every event on that page in one
INquery and groups them in memory. - For the Live tab, adds attendance counts with one grouped query.
That’s three or four queries per page, no matter how many events are on it. Deciding whether an event is “upcoming” or “live” happens in SQL, using each event’s own timezone, so a party in another country doesn’t show as live an hour early:
SELECT * FROM events
WHERE organiser_id IN :organiserIds
AND status IN :statuses
AND (date + time_start) AT TIME ZONE timezone > NOW()
ORDER BY created_at DESC
On the frontend, infinite scroll uses an IntersectionObserver on an empty element at the bottom of the list. It keeps loading until Spring’s page response says it’s the last page.
Search that handles half-typed words
Search covers events, profiles and cities from one search bar. Instead of LIKE '%...%', it uses the database’s built-in full-text search, with an indexed search column that triggers keep up to date. To make it work while you’re still typing, each word becomes a prefix match, so “house par” finds “house party”:
// "house par" → "house:* & par:*"
for (String word : words) {
String clean = word.replaceAll("[^\\p{L}\\p{N}]", "");
if (!clean.isEmpty()) tokens.add(clean + ":*");
}
return String.join(" & ", tokens);
Some of the work happens in the database
Some jobs make more sense in the database than in Java:
- An hourly cron job marks finished events as expired. This turned out to be fiddly: parties often end after midnight (an end time earlier than the start time means the next day), and some events don’t have an end time at all, so I default those to ten hours after the start.
- A trigger creates your profile only once your email is confirmed. Before that, confirming from a different device than the one you signed up on broke profile creation.
- For Google sign-ups, a trigger turns your name into a username and adds a number to the end until it’s unique.
Uploads go through my backend
The browser never writes to storage directly. Photos go to Spring, which checks that they’re actually images, then sends them to Supabase Storage with a small custom HTTP client. Event covers are named after the event’s ID, so uploading a new cover just replaces the old one.
Running it in production
The backend runs as a Docker image and the frontend runs on Vercel. Metrics and logs go to Grafana Cloud through Spring Actuator and OpenTelemetry, and that’s how I found the problems a real server has that localhost doesn’t:
- Supabase’s connection pooler was dropping idle database connections after five minutes. I set the connection pool to recycle connections every four minutes and ping the database every minute.
- The logs were full of broken-pipe errors from people closing the tab mid-request. Those are now ignored instead of logged as errors.
I also added a 5-minute Caffeine cache in front of event and profile lookups, which are by far the most common reads.