Prepared for Advanced programming course in Isfahan university of technology
The application uses provided APIs to send requests to the server and receive appropriate responses to be used in the messenger.
http://hostname:port/command?parameters
- hostname: Address of the server where the server code is running.
- port: Port for communication with the server.
- command: Commands requested from the server.
- parameters: Optional key-value pairs sent to the server with the request.
Registering a user with the username Mehran
and password 1383
:
http://api.barafardayebehtar.ml:8080/signup?username=Mehran&password=1383
Responses are in JSON format, with code
and message
fields indicating the status and response message from the server.
- 200: Request successful.
- 404: Request unsuccessful, information not found.
- 204: Request unsuccessful, duplicate information.
- 401: Request unsuccessful, incorrect information.
- hostname:
api.barafardayebehtar.ml
- port:
8080
http://api.barafardayebehtar.ml:8080/command?parameters
- Sign Up: Register as a user.
- Login: Obtain a unique token representing user identity.
- All Requests: Sent with the unique token for user identification.
- Logout: Token is set to
null
and a new token is assigned upon next login.
Command | Parameters | Description |
---|---|---|
signup | username, password, firstname, lastname | Register a new user. |
login | username, password | Log in a user and receive a unique token. |
logout | username, password | Log out a user and nullify their token. |
creategroup | token, group_name, group_title | Create a new group. |
createchannel | token, channel_name, channel_title | Create a new channel. |
getuserlist | token | Get the list of users the current user has chatted with. |
getgrouplist | token | Get the list of groups the current user is a member of. |
getchannellist | token | Get the list of channels the current user is a member of. |
getuserchats | token, dst, date | Get the list of messages with a specific user. |
getgroupchats | token, dst, date | Get the list of messages in a specific group. |
getchannelchats | token, dst, date | Get the list of messages in a specific channel. |
joingroup | token, group_name | Join a specific group. |
joinchannel | token, channel_name | Join a specific channel. |
sendmessageuser | token, dst, body | Send a message to a specific user. |
sendmessagegroup | token, dst, body | Send a message in a specific group. |
sendmessagechannel | token, dst, body | Send a message in a specific channel. |
The application stores all requested messages in categorized files to access the messenger information offline.
- Application creates folders:
Users
,Groups
,Channels
. - For each user, group, and channel, applicaton creates respective files and save messages for offline access.
In addition to sending and receiving messages, this program has these features :
- A beautiful ui which makes this messenger more atractive
- Ability to capture or select a picture for profile
- Changing background theme
- Changing font style and size
- Qt 5.13 or later
- C++ 11 compatible compiler
- qmake (included with Qt)
-
Clone the repository:
git clone <repository-url>
-
Open the project in Qt Creator:
- Open
nmassenger.pro
for the client application.
- Open
-
Build the project using Qt Creator.