Technology Primers
This appendix gives quick introductions to technologies mentioned throughout the book. You do not need to study every topic before continuing. Follow a link here when you want more context, then return to the chapter you were reading.
HTTP
HTTP stands for Hypertext Transfer Protocol. It defines a common way for a client and server to exchange information using requests and responses. Just about every website you visit is delivered using HTTP or HTTPS, which is HTTP protected by encryption. Browsers use it to request web pages, images, and other files, and web applications also use it to exchange data with backend servers. A request describes what the client wants to read or change. The response reports the result and may include data.
For example, the Chahua PWA sends an HTTP request when it asks for recent messages. The backend sends an HTTP response containing those messages or an error explaining why the request could not be completed.
API
An Application Programming Interface (API) is a defined way for software to interact with other software. Chahua’s HTTP API describes which requests clients can make, what information each request contains, and what responses the backend returns.
Database
A database stores structured information so it can be found and changed later. Chahua uses PostgreSQL to store information such as users, chats, and messages. Clients ask the backend for this information rather than connecting to the database directly.
WebSocket
A WebSocket is a long-lived connection that allows both sides to send information without starting a new HTTP request each time. Chahua uses it to notify connected clients about events such as newly created messages.
Client and Server
A client asks for information or actions on behalf of a person. A server receives those requests and provides shared services. In Chahua, the PWA and Flutter app are clients, while the backend runs as a server.