A web-based clone of the classic MSN Messenger, built with TypeScript, React, Node.js, Express and Webscokets. This project aims to replicate the core functionalities of MSN Messenger, including real-time chat, user status updates, and contact management.
- Real-time Chat: Engage in real-time messaging with your contacts.
- User Status Updates: See the current status of your contacts (online, offline, etc.).
- Contact Management: Add, accept, and reject contact requests to manage your contact list.
- Receive Notifications: Get notifications on new messages and user connections.
- Tab management: Manage tabs with Windows XP's style.
-
Register an Account:
- Open the application in your browser.
- Navigate to the registration page and create a new account. (Get a .NET Passport)
-
Login:
- Use your registered credentials to log in.
-
Add Contacts:
- Use the 'Add Contact' functionality to find and add contacts.
- Send contact requests and manage incoming requests.
-
Chat:
- Start a conversation with your contacts.
- Enjoy real-time messaging and status updates.
The following API endpoints are available for interacting with the server:
- POST
/login
: Log in to the application. - GET
/logout
: Log out of the application (requires authentication). - POST
/register
: Register a new account. - GET
/auth
: Check user authentication status. Used for client protected routes. - POST
/contact-request/send
: Send a contact request (requires authentication). - POST
/contact-request/accept
: Accept a contact request (requires authentication). - POST
/contact-request/reject
: Reject a contact request (requires authentication). - PUT
/update/username
: Update your username (requires authentication). - POST
/search-contact
: Search for contacts (requires authentication).
The application uses WebSocket for real-time communication. Here are the events:
- register-user: Register the user with the server and update their status to online.
- user-status-change: Change the user's status (e.g., online, offline).
- get-chat-history: Retrieve the chat history for a specific chat.
- new-message: Send a new message in a chat.
- user-typing: Notify when a user is typing.
- logout: Disconnect the user from the server.
- disconnect: Handle user's socket disconnection.
- Node.js (version 18.x.x recommended)
- npm (version 8.x.x recommended)
npm install -g typescript
npm install -g nodemon
git clone https://github.com/mmillenaar/my-msn-messenger.git
cd my-msn-messenger
cd client
npm install
cd server
npm install
Create a .env
file in the client
directory and add the necessary environment variables. Example:
REACT_APP_BACKEND_URL=http://localhost:3030
Create a .env
file in the server
directory and add the necessary environment variables. Example:
PORT=3030
NODE_ENV=development
MONGOURL=your-database-url
JWT_SECRET=your-secret-key
CLIENT_ORIGIN=http://localhost:3000
cd server
npm run dev
cd client
npm start