GET /health-check
- Response:
OK
- Response:
POST /register
- Body: Use
multipart/form-data
to send the following fields:login
(text): your usernamepassword
(text): your password
- Body: Use
GET /login
- Description: Returns a JWT token.
- Body: Use
multipart/form-data
to send the following fields:login
(text): your usernamepassword
(text): your password
- Response:
{
"token": "your_jwt_token",
"refreshToken": "your_refresh_token"
}
PATCH /login/{type}
- Description:
{type}
can belogin
orpassword
. - Header:
Authorization: Bearer <Your API key>
- Body: Use
multipart/form-data
to send the following fields:new-login
(text): your new loginnew-password
(text): your new password
- Description:
DELETE /login
- Header:
Authorization: Bearer <Your API key>
- Header:
GET /users
- Header:
Authorization: Bearer <Your API key>
- Header:
GET /message/send
- Header:
Authorization: Bearer <Your API key>
- Header:
GET /message/received
- Header:
Authorization: Bearer <Your API key>
- Header:
POST /message
- Header:
Authorization: Bearer <Your API key>
- Body: Use
multipart/form-data
to send the following fields:receiver_id
(text): ID of the receivermessage_text
(text): The message content
- Header:
PATCH /message
- Header:
Authorization: Bearer <Your API key>
- Body: Use
multipart/form-data
to send the following fields:message_id
(text): ID of the messagemessage_text
(text): The message content
- Header:
DELETE /message
- Header:
Authorization: Bearer <Your API key>
- **Body:**Use
multipart/form-data
to send the following fields:message_id
(text): ID of the message
- Header:
GET /message/notifications
- Header:
Authorization: Bearer <Your API key>
- Response: list of unread messages
- Header:
POST /channel
- Header:
Authorization: Bearer <Your API key>
- **Body:**Use
multipart/form-data
to send the following fields:channel_name
(text): name of the channel
- Header:
PATCH /channel
- Header:
Authorization: Bearer <Your API key>
- **Body:**Use
multipart/form-data
to send the following fields:channel_id
(text): ID of the channelchannel_name
(text): name of the channel
- Header:
GET /channel
- Header:
Authorization: Bearer <Your API key>
- Header:
DELETE /channel
- Header:
Authorization: Bearer <Your API key
- **Body:**Use
multipart/form-data
to send the following fields:channel_id
(text): ID of the channel
- Header:
POST /channel/follow
- Header:
Authorization: Bearer <Your API key>
- **Body:**Use
multipart/form-data
to send the following fields:channel_id
(text): ID of the channel
- Header:
DELETE /channel/follow
- Header:
Authorization Bearer <Your API key>
- **Body:**Use
multipart/form-data
to send the following fields:channel_id
(text): ID of the channel
- Header:
POST /channel/follow/message
- Header:
Authorization: Bearer <Your API key>
- **Body:**Use
multipart/form-data
to send the following fields:channel_id
(text): ID of the channelmessage_text
(text): The message content
- Header:
GET /channel/follow/message
- Header:
Authorization Bearer <Your API key>
- Header:
Table Users {
user_id SERIAL [pk]
username VARCHAR(50) [not null]
password VARCHAR(100) [not null]
}
Table Messages {
message_id SERIAL [pk]
sender_id INTEGER [not null, ref: > Users.user_id]
receiver_id INTEGER [not null, ref: > Users.user_id]
message_text TEXT [not null]
read BOOLEAN [default: false]
sent_at TIMESTAMP [default: `CURRENT_TIMESTAMP`]
}
.env in the root folder of the project
host=postgres
dbname=your_db_name
sslmode=disable
port=5432
user=your_user
password=your_password
secret=your_256_bit_secret
PGADMIN_DEFAULT_EMAIL=your_email
PGADMIN_DEFAULT_PASSWORD=your_password
Start project first time or after changes docker-compose up --build
otherwise docker-compose up