The Sound of Structure

04 Dec 2025

Finding Rhythm

I’ve played piano for over a decade, and something I’ve learned throughout the years is that music only feels effortless when there’s solid technique supporting it. Exceptional playing comes from years of honing technique through scales, fingering patterns, and chord progressions. These patterns aren’t a restriction, but rather, a source of reassurance and confidence that one has the capability to play with both control and expression. Working with my team on our final project application, Mānoa RoomieMatch, made me realize that software engineering isn’t that different from playing an instrument. Design patterns are the “technique” of coding as they make everything cleaner and easier to work with.

Harmonizing Code

Our application uses React and React Bootstrap on the client side, Next.js for server logic, and PostgreSQL for the database. I see these layers like different parts of an ensemble—each one has a role, and if they weren’t coordinated, everything would clash. A design pattern that our application heavily relies on is the Client–Server pattern, where the browser asks for something and the backend responds. It’s simple, but it gives the whole system a steady rhythm. It reminds me of how a pianist’s left hand anchors the right-hand melody. Each side has its job, and things work due to that balance.

Another pattern I’ve found surprisingly helpful is the Module Pattern, especially through JavaScript’s static imports. Breaking the project into components and helpers keeps the code from turning into a giant, unreadable file. It’s like practicing scales or arpeggios on their own—you break the music into manageable pieces so you actually understand what’s happening. Using modules made the application more manageable, reduced the likelihood of bugs, and made it easier for the whole team to collaborate without interfering with each other’s work. Furthermore, each API route in our application lives in its own file and handles everything for that endpoint. For example, the /api/admin/users route exports two functions: GET and POST.

// api/admin/users/route.ts
import { NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { prisma } from '@/lib/prisma';
import authOptions from '@/lib/authOptions';

export async function GET() {
// Fetches users and their profiles
}

export async function POST(req: Request) {
// Deletes a user by ID
}

This approach keeps the logic for each HTTP method organized and the routing straightforward. All necessary imports are at the top, which helps maintain a clean and readable file.

Prisma utilizes another pattern, the Adapter pattern, which takes our TypeScript models and translates them into SQL queries behind the scenes. If I had to write raw SQL everywhere, it would feel like sight-reading a piece written in a musical style I’d never studied before. Prisma handles that translation so the backend side feels more intuitive and consistent. It also helps two very different systems communicate without clashing with one another.

Structuring Data Like Sheet Music

A design choice that worked really well in our project was how we structured the lifestyle survey data. Instead of stuffing all the answers directly inside the User table—which would be like cramming an entire song onto one line of sheet music—we created a join table where each response gets its own row. This relational association pattern keeps the data organized, easy to query, and flexible for additional features. It’s a pattern that’s used in most well-designed relational databases, and using it in our application made it more scalable and cleaner.

From Technique to Mastery

Even though our project isn’t finished yet, these patterns have shaped how we build new features and track down bugs. Just like in piano, good technique makes everything feel intentional. Good design patterns do the same thing—they help the project grow without falling apart. If someone asks, “What are design patterns?” or “Which ones are you using?”, I’ll think back to technique. In music, technique turns scattered notes into something expressive. In software engineering, design patterns turn scattered components into a system that’s logical and functional. In Mānoa RoomieMatch, we used the Client–Server pattern, the Module Pattern, the Adapter pattern through Prisma, and relational association patterns in our database. These patterns have made the project far more manageable, and they’ve given me confidence in the structure and integrity of our application. Therefore, I believe that learning design patterns and reaching a level of proficiency in them will elevate one’s software experience and allow them to build more maintainable and consistent applications.