A realtime, time-boxed chat product where connection is only possible during rare signal windows.
Last Signal explores a product concept built around urgency and emotional context: users can only enter chat when a signal condition is active.
At its heart, the project is meant to support youngsters who stay awake late at night and may be carrying stress, loneliness, or emotional overload. The product direction aims to offer a calm, human moment of connection during those night-owl hours, helping reduce stress through brief, meaningful conversation.
Signal windows:
- Battery mode: battery is 10% or below
- Midnight mode: local time between 12:00 AM and 4:00 AM
- Developer bypass: controlled override for test flows
The app is implemented as a React + Vite Progressive Web App with Firebase Auth, Firestore realtime sync, mode-aware matchmaking, and timed chat sessions.
Important: Last Signal is a peer-connection product and not a replacement for professional mental health care.
This project demonstrates:
- Product thinking: a clear behavioral concept translated into interaction design
- Frontend execution: polished multi-screen React experience with strong motion and state transitions
- Real-time systems work: transactional matchmaking and live Firestore listeners
- Reliability mindset: session expiry, room cleanup, queue cancellation, and reconnection handling
- Engineering discipline: modular architecture, unit tests, linting, and analytics instrumentation
- Real-time 1:1 chat with Firestore subcollections
- Signal-aware matchmaking (battery users with battery users, midnight users with midnight users)
- Timed sessions by mode
- Battery mode: 3 minutes
- Midnight mode: 5 minutes
- Presence metadata per participant (connection, visibility, typing state, heartbeat)
- Login and account support (email/password + Google)
- Username claim flow with uniqueness checks
- PWA install support via vite-plugin-pwa
- Firebase Analytics event tracking with a local debug buffer fallback
-
Matchmaker transaction model
- A single Firestore document stores mode-specific queues.
- Firestore transactions atomically enqueue users or create a room when a partner exists.
-
Session lifecycle and cleanup
- Rooms are created with explicit expiry and lifecycle status metadata.
- Ended rooms are marked and cleaned up (messages + room document).
- App can restore active sessions after refresh/auth restore.
-
Presence and connection resilience
- Participant state tracks connection, visibility, typing, and last-seen timestamps.
- Listeners gracefully handle permission and closed-room edge cases.
-
State architecture
- A reducer-based app flow centralizes screen transitions and session state.
- Signal mode logic is normalized in reusable utilities for deterministic behavior.
- It shows end-to-end ownership from concept and UX framing to data model and deployment-ready setup.
- It balances product feel and engineering rigor instead of optimizing one at the cost of the other.
- It is constrained by real-world browser and realtime-system limitations, with practical fallbacks.
- It is intentionally designed to support stressed late-night users with low-pressure social connection.
- Frontend: React 19, Vite, Tailwind CSS, Framer Motion
- Backend: Firebase Authentication, Firestore, Firebase Analytics
- PWA: vite-plugin-pwa, service worker, install prompt support
- Tooling: ESLint, Vitest
Client (React PWA) -> Firebase Authentication -> Firestore (users, chatRooms, messages, matchmaker) -> Realtime listeners + transactional matchmaking
last-signal/: main app codebasepages/: recruiter-ready visual assets and UI screenshotsPRODUCT REQUIREMENTS DOCUMENT (PRD).txt: product goals and scopeTECHNICAL REQUIREMENTS DOCUMENT (TRD).txt: technical architecture direction
cd last-signal
npm install
npm run devCreate a .env file in last-signal/ with:
VITE_FIREBASE_API_KEY=
VITE_FIREBASE_AUTH_DOMAIN=
VITE_FIREBASE_PROJECT_ID=
VITE_FIREBASE_STORAGE_BUCKET=
VITE_FIREBASE_MESSAGING_SENDER_ID=
VITE_FIREBASE_APP_ID=
VITE_FIREBASE_MEASUREMENT_ID=cd last-signal
npm run lint
npm run test
npm run build- Deploy last-signal/firestore.rules to your Firebase project.
- Configure Firestore TTL on chatRooms.expiresAt for automatic expiration cleanup.
- Enable Firebase Authentication providers you plan to use:
- Email/Password
Unit tests currently cover:
- App flow reducer behavior
- Matchmaker queue logic
- Signal mode utilities
- Moderation and session history helpers
- Username generator behavior
- Sentiment-aware matching service
- Push notification improvements
- Expanded moderation workflow
- Session recap exports and richer analytics dashboards





