Social audio · Ongoing
Hush
Real-time social audio platform
Hush is a social audio app for live group discussions. Sign-in and profile activation are implemented, and audio rooms are in progress.
Role Independent developer
Tools and technologies
- TypeScript
- Bun
- Express 5
- MongoDB
- React
- Redux Toolkit
- Axios
- JWT
Why I built it
Hush is an ongoing social audio project for people who want to join live group discussions. I used a reference MERN application as a starting point and rebuilt the foundation in TypeScript, with Bun, Express 5, and React. I started with sign-in and activation because a room needs to know who joined and whether their profile is ready, including when they return after a reload.
Authentication and onboarding
- React onboardingThe user starts by entering a phone number and verifying a one-time code.
- Express OTP handlersThe server creates an expiring challenge and checks the submitted code against its HMAC.
- Session and user recordsExpress issues HTTP-only JWT cookies and records the refresh session in MongoDB.
- Profile activationAn authenticated user adds a name and avatar, and the server updates the activation flag.
I implemented passwordless sign-in as a short-lived challenge. The server signs the phone number, code, and expiration together with HMAC-SHA256. Verification checks the expiry and recomputes the signature. This keeps the verification challenge from needing a plaintext OTP record in MongoDB. The current delivery path is a development stub. Live SMS delivery remains unfinished.
Once verification succeeds, the backend looks up or creates the user and issues access and refresh JWTs in HTTP-only cookies. I separated authentication from activation so a new user can complete onboarding while signed in. React tracks the user and activation state in Redux Toolkit. The activation endpoint processes the uploaded avatar before saving the profile and marking it active. The route guards use that state to send returning users to the appropriate screen.
Restoring a session
A reload clears the in-memory React state even when the browser still has the session cookies. I added a startup refresh to restore the user and activation flag from the server. The refresh handler checks the JWT and looks up its stored session record before issuing a fresh access token.
I also wired Axios to try a refresh after an unauthorized response. Concurrent callers share the pending refresh promise, so requests that fail together don’t each start a separate refresh. The refresh call uses a separate Axios client, and each original request can retry once. This keeps a failed refresh from sending the interceptor back through the same retry loop.
Audio rooms in progress
The current implementation covers OTP verification, session restoration, and profile activation. I’m working toward room creation and discovery, with speaker and listener roles, participant management, and microphone controls. The intended design uses Socket.IO for signaling and WebRTC for peer-to-peer media. Room membership, moderation, and live audio are outside the completed authentication flow shown above.