I am new to backend development and recently started learning Node.js. I’m working on a chat application and plan to use Node.js with Express.js and MongoDB as the backend. Since I’m still learning, I want to understand how to structure the backend API for managing users, messages, and real-time interactions.
Some specific points I need guidance on:
- How should I structure the endpoints for sending and receiving messages between users?
- What is the best way to handle user authentication and session management?
- What would be a good database schema for storing users, chat rooms, and messages in
MongoDB?
Any advice or examples would be greatly appreciated!