Chattter

A full-stack social and blogging platform for book enthusiasts — real-time messaging with Firestore, optimistic UI, 85% test coverage, 95+ Lighthouse score.

Role
Full-Stack Developer
Timeline
Jun – Aug 2024
Stack
React · TypeScript · Firebase
Status
Shipped
Chattter social platform preview
01The Problem

Book lovers had no dedicated platform that combined community with content.

Most platforms for readers forced a tradeoff: you could either join a generic social network with weak literary context, or use a niche book product with limited community interaction. I wanted to build something that felt social, expressive, and tailored to how readers actually discuss books.

Because this was a personal full-stack build, I also used it to pressure-test my own engineering process. I wanted realtime chat, optimistic interactions, strong performance, and reliable automated testing in one product — which meant balancing feature ambition with practical architecture choices.

Testing matters more when every product decision is yours to own.
02Architecture

Chattter was where I combined product design instincts with engineering discipline. I used the project to prove I could ship a polished social product end-to-end while keeping realtime behavior, feed logic, and testing strategy coherent.

Firestore real-time subscriptions over polling

Polling would have made chat feel sluggish and wasteful for a product whose value depended on immediacy. Firestore subscriptions gave me live updates by default, while optimistic UI masked network round-trips for an experience that felt fast even before writes settled.

typescript
const q = query(messagesCollectionRef, orderBy('timestamp', 'asc'));
const unsubscribe = onSnapshot(q, (snapshot) => {
  const messages = snapshot.docs.map((doc) => doc.data() as Message);
  queryClient.setQueryData(['messages-in-chat', chatId], messages);
});

Realtime subscriptions kept chat synchronized without building a custom websocket layer.

Cypress E2E + Vitest unit testing

The project had both rich user flows and isolated logic worth protecting, so I intentionally split coverage between E2E and unit tests. That kept critical journeys like auth and messaging honest while letting smaller logic stay fast and focused in Vitest.

Three-feed architecture (For You / All / Following)

A single feed would have flattened the product into generic chronology. I designed three feed modes so users could switch between exploration, platform-wide recency, and relationship-driven content — which made the reading experience feel more intentional and useful.

03The Hard Part

Optimistic updates + Firestore eventual consistency = subtle bugs.

The hardest part was keeping messaging responsive without lying to the user. Optimistic updates made the interface feel immediate, but Firestore's confirmation model meant temporary messages could collide with real writes, duplicate in the cache, or linger in error states if the network failed.

My solution was to treat optimistic messages as first-class temporary records. I assigned temp IDs, reconciled them when confirmed writes arrived, and invalidated queries on failure. That let the UI stay fast while still converging cleanly back to server truth.

04Outcomes

95+

Lighthouse Score

85%

Test Coverage

<1s

Message Delivery

With optimistic UI

Building Chattter alone made tradeoffs impossible to hide. Every choice about DX, product polish, testing, and performance belonged to me. It sharpened my instinct that tests are not a final step — they are part of how you document and defend product behavior while you build.