Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/neuodev/receptor
Real-time messaging app. Available as a website and as MacOS, Linux, and Windows application.
https://github.com/neuodev/receptor
chatapp javascript postgresql react rust socket-io tauri typescript websockets
Last synced: 21 days ago
JSON representation
Real-time messaging app. Available as a website and as MacOS, Linux, and Windows application.
- Host: GitHub
- URL: https://github.com/neuodev/receptor
- Owner: neuodev
- Created: 2022-08-12T08:56:19.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2022-11-04T04:02:15.000Z (about 2 years ago)
- Last Synced: 2024-10-07T15:50:51.167Z (about 1 month ago)
- Topics: chatapp, javascript, postgresql, react, rust, socket-io, tauri, typescript, websockets
- Language: TypeScript
- Homepage:
- Size: 13.4 MB
- Stars: 21
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
Awesome Lists containing this project
README
# Receptor
Real-time messaging app. Available as a web, MacOS, Linux, and Windows application.
![group_chat](./preview/group_chat.png)
![friends](./preview/friends.png)See more?
![receptor-chat](./preview/chat.png)
![receptor-chat](./preview/closed_group.png)
![receptor-chat](./preview/empty.png)
![receptor-chat](./preview/sign_in.png)## [Database Schema](https://drawsql.app/teams/no-sim/diagrams/rustchat)
![Schema](./schema.png)
## Events
```ts
// 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",
}
```## API
For full API documentation try import this [postman collection](./receptor-api.postman_collection.json)
Register - POST /api/v1/user/register
### Reqeust
```ts
type Body = {
username: string;
email: string;
password: string;
};
```### Response
```ts
type Response = {
userId: number;
};
```
Login - POST /api/v1/user/login
### Reqeust
```ts
type Body = {
email: string;
password: string;
};
```### Response
```ts
type Response = {
user: User;
token: string;
};
```
Get users - GET /api/v1/user
### Reqeust
| 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 |### Response
```ts
type Reponse = {
users: Array;
count: number;
};
```
Get friends - GET /api/v1/user/friends
### Reqeust
Access only by authorized users
```ts
type Headers = {
authorization: string; // Bearer auth token
};
```### Response
```ts
type Reponse = Array;
```
Get room messages - GET /api/v1/room/:roomId
### Reqeust
Access only by authorized users
```ts
type Headers = {
authorization: string; // Bearer auth token
};
```### Response
```ts
type Reponse = Array;
```
Get user groups - GET /api/v1/group
### Reqeust
Access only by authorized users
```ts
type Headers = {
authorization: string; // Bearer auth token
};
```### Response
```ts
type Reponse = Array<{
id: number;
name: string;
type: string;
createdAt: Date;
updatedAt: Data;
participants: Array;
}>;
```
Create new group- POST /api/v1/group
### Reqeust
```ts
type Body = {
groupName: string;
userIds: number[];
};
```### Response
```ts
type Reponse = {
roomId: number;
};
```
Delete group - DELETE /api/v1/group/:groupId - Owner only
### Reqeust
Access only by authorized users
```ts
type Headers = {
authorization: string; // Bearer auth token
};
```### Response
```ts
type Reponse = {
roomId: number;
};
```
Leave group - DELETE /api/v1/group/:groupId/leave
### Reqeust
Access only by authorized users
```ts
type Headers = {
authorization: string; // Bearer auth token
};
```### Response
```ts
type Reponse = {
roomId: number;
};
```