Client-Server Architecture

How devices communicate in distributed systems

Next Module: Peer-to-Peer
Client
Server

Client

  • • Requests resources from server
  • • Can be a browser, mobile app, or desktop client
  • • Processes and displays server responses

Server

  • • Receives and processes client requests
  • • Stores and manages application data
  • • Returns responses to clients

Request-Response Cycle

// Client request
fetch('https://api.example.com/data')
  .then(response => response.json())
  .then(data => console.log('Received:', data));

// Server response
const express = require('express');
app.get('/data', (req, res) => {
  res.json({ message: 'Hello from server!', timestamp: Date.now() });
});
```


internet/shipwrecked.hackclub.com/tutorials/networking/distributed/clients.html
```

```