📄️ API basics
Spika has several sets of APIs divided by their purpose.
📄️ The message-sending process
The process of how the message data travels in Spika roughly looks like this:
📄️ File upload
The Spika backend uses a custom file upload mechanism to have better control over the uploading process than it would by using a standard multi-part file upload. The file upload roughly looks like this:
📄️ Reaction system design
Reaction is the feature which users can react by emoji for each message. This page explains how we implement the feature. We use MessageRecord model for this purpose. MessageRecord is used to record “delivered” and “seen” information.
📄️ Message format
| | |
📄️ Server-sent events
Spika uses the Server-sent event to realize the server-to-client communication. We decided to not use WebSocket because of stability and maintainability. Spika backend sends JSON packets to the client in each event so the client can react to these events in real time like when a user sends a message to a room. Here is a type of SSE we use in Spika:
📄️ System messages
Spika uses the system messages to communicate important events with all group members. All system messages have type=system.