← Back

PROJECT 002 · 2025–26 · JS · FIREBASE

Journalist

Live ↗Code ↗

Summary

A journaling app with Google login, a real database and public share links. My first project built without a tutorial, and the first app I use every day.

Why I built it

Courses taught me pieces of JavaScript, but not how they fit together. So I built something real, with real problems, in plain JavaScript on purpose.

How it works

Journalist: how it worksFirestore feeds entries (the state), which render the UI. The URL is part of the state: ?entry=id is the private view, ?share=id is a public, read-only view; navigation uses history.pushState without page reloads. Login: popup on desktop, redirect on mobile. A service worker keeps the app shell in cache.Firestoreentries (state)UIURL?entry=idprivate view?share=idpublic, read-only viewhistory.pushStatewithout page reloadsLoginpopupdesktopredirectmobileservice workerapp shellin cache
FIG. 1 — How it worksNTS

Firestore → entries (state) → UI, plus the URL as part of the state: ?entry=id is the private view, ?share=id is a public, read-only view. Navigation runs on history.pushState, without page reloads. Login has two paths: popup on desktop, redirect on mobile. A service worker keeps the app shell in cache.

Hard parts

  • Login on phones. signInWithPopup didn't work reliably on mobile. I added a separate flow with signInWithRedirect and getRedirectResult().
  • The URL as app state. Share links open one entry directly, in read-only mode, without reloading the page.
  • Events on a dynamic UI. After rendering with innerHTML, listeners went missing or got duplicated. I learned to bind them after every render.

What I learned

Keep data, state, rendering and events separate. Test on real phones, because mobile has its own bugs. Think in systems, not in lines of code.