Real-time messaging app. Available as a web, MacOS, Linux, and Windows application.
// Websocket events
enum Event {
Connect = "connect",
Disconnect = "disconnect",
AddFriend = "addFriend",
AcceptFriend = "acceptFriend",
RemoveFriend = "removeFriend",
Notification = "notification",
Login = "login",
Logout = "logout",
GetUser = "getUser",
JoinRoom = "joinRoom",
LeaveRoom = "leaveRoom",
RoomMessage = "sendRoomMsg",
UpdateUser = "updateUser",
}
For full API documentation try import this postman collection
Register - POST /api/v1/user/register
type Body = {
username: string;
email: string;
password: string;
};
type Response = {
userId: number;
};
Login - POST /api/v1/user/login
type Body = {
email: string;
password: string;
};
type Response = {
user: User;
token: string;
};
Get users - GET /api/v1/user
Query Param. | Description | Type | Default |
---|---|---|---|
q | Search by email and username |
string | Empty string |
page | Number of the current page | number | 1 |
limit | Number of items per response | number | 10 |
type Reponse = {
users: Array<User>;
count: number;
};
Get friends - GET /api/v1/user/friends
Access only by authorized users
type Headers = {
authorization: string; // Bearer auth token
};
type Reponse = Array<User & { roomId: number }>;
Get room messages - GET /api/v1/room/:roomId
Access only by authorized users
type Headers = {
authorization: string; // Bearer auth token
};
type Reponse = Array<Message & { user: User }>;
Get user groups - GET /api/v1/group
Access only by authorized users
type Headers = {
authorization: string; // Bearer auth token
};
type Reponse = Array<{
id: number;
name: string;
type: string;
createdAt: Date;
updatedAt: Data;
participants: Array<User>;
}>;
Create new group- POST /api/v1/group
type Body = {
groupName: string;
userIds: number[];
};
type Reponse = {
roomId: number;
};
Delete group - DELETE /api/v1/group/:groupId - Owner only
Access only by authorized users
type Headers = {
authorization: string; // Bearer auth token
};
type Reponse = {
roomId: number;
};