Fix NodeJS Exrpess MySql SocketIO backend API
The right skills
NodeJs - Express
SocketIO
MySql
There is a non-working code for the following TK (the task is to make what is there work):
chat on sockets
1. Write a new method to handle the submite of the message in the chat.
Request fields:
IdFrom: int,
IdTo: int,
Text: varchar| text (Length 1000)
Attachments: (server implementation)
Datetime: datetime default NOW()
2. Receive messages
- authorization or other mechanism that only the recipient/sender would have access to messages
https://www.npmjs.com/package/express-socket.io-se...
http://www.passportjs.org/packages/passport-local/ - local strategy
at the handshake socket stage, check the validity of the clients cookie. and thereby authorize it by the current heums.
- receiving messages from a pagina database (20 messages per request) endless scroll
3. Online Tag
-every 30 seconds send alive packet and process the status of the user in the DB (if within a minute the package did not appear - put the status offline)
organize presence based on the heartbeat mechanism built into the socket.io
to attach to its events and on the basis of this to keep the flag of presence of the user relevant
4. Payments
https://www.npmjs.com/package/uniteller-node
- connect Uniteller payment
- transfer money to the balance if you have replenished the balance
- write off money if the user bought the service at the expense of the balance
- create payment data for input data (if the user pays not from the balance but directly) (for the total amount of the order to make a payment)
- payment verification
write documentation for the above described functionality
We work only on a secure transaction or post-payment
Not a studio, own project
12.11.2021 20:55