- Notifications
You must be signed in to change notification settings - Fork0
Social Network Web Application with Kotlin Spring Boot, Node.Js with socket.io, Angular and PostgreSQL.
License
enaki/MyMess
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
MyMess is a social network application where users can make friends and communicate with each other.
A short demo can be foundhere.
The application is built on 3 servers:
- front-end service (usingAngular) (running on port 4200)
- back-end service (usingKotlin Spring Boot (running on port 2020)
- notification socket service (usingNode.js and socket.io (running on port 2021)
The back-end server is built on multi-layer-architecture:
- Presentation Layer (responsible for the controllers/user interface)
- Bussiness Layer (responsible for the logic and functionality)
- Persistence/Database Layer (responsible for CRUD operations)
Password are encrypted using SHA-256.
The service is using 4 collections (can be scaled and integrated with a MongoDb database):
- actives - contains uid - last time (unix) seen online (0 if the user is online)
- allUsers - contains socket id, friendId, and username
- socketsUidPair - contains socket id - uid
- unseenFrom - contains uid - list of unseen messages from user
Note
:actives is initialized with mock Data.
Events handled:
- establish-connection - the user connects and gets back a list with unseen messages
- notify-is-typing - the user's friend (if it is online) is notified that current user is typing
- notify-stop-typing - the user's friend (if it is online) is notified that current user has stopped typing
- friend-ids - the user request the list of friends ids and their last time seen online
- send-chat-message - the user send a message to a friend and the message is redirected to backend service. If the user is online the message is sent to him to be updated live
- send-message-notifications - the user send a message notification to a friend
- message-notification-clear - the user notifies socket server to clear its message notification
- logout - update socket server's collections
Events emited:
- message-notifications - onestablish connection user receives notifications from received messages
- receive-is-typing - onnotify-is-typing friend receives typing notification from his friend
- receive-stop-typing - onnotify-stop-typing friend receives stop typing notification from his friend
- take-friends-status - onfriend-ids user receives his friends' status
- receive-chat-message - onsend-chat-message friend receives the incoming message
- notify-inbox - onsend-chat-message friend receives the incoming message notification for the inbox
- message-notifications - onsend-message-notifications friend receives the incoming message notification for a specific user in the inbox
ConfigurePostgreSQL
- Make a database
- Change thebackend configuration with the created database's configuration
- Changepython script for creating the database's tables with the created database's configuration
Run python script for creating the tables and for inserting the initial data (users passwords can be found inusers.json)
Run the backend service
Run the notification service
npm install
node App.js
Run the frontend service
npm install
ng serve
Note
: Reconnecting to socket on refreshing the frontend page from the browser when logged in was not implemented.