CodingNic

Web Fundamentals

Client-Server Architecture

Web Fundamentals 12 min read

Client-Server Architecture

Client-Server Architecture

At the core of every web application is a simple but powerful model: the client and the server.

Understanding how these two interact will help you understand how frameworks like Flask, FastAPI, and Django work behind the scenes.

What is a Client?

A client is the part of the system that sends requests.

In most cases, this is:

  • A web browser (Chrome, Firefox, Safari)
  • A mobile app
  • Another application

The client is responsible for:

  • Sending requests to a server
  • Displaying the response to the user

What is a Server?

A server is the part of the system that receives requests and sends back responses.

It is responsible for:

  • Handling incoming requests
  • Running application logic
  • Interacting with databases
  • Returning data or HTML

How They Work Together

The client and server communicate through HTTP.

  • The client sends a request
  • The server processes it
  • The server sends back a response

Client Server Diagram

This interaction happens every time you load a page, submit a form, or interact with an app.

Responsibilities Breakdown

Understanding responsibilities helps you design better systems.

Client Responsibilities

  • User interface (UI)
  • User interactions
  • Sending requests
  • Rendering responses

Server Responsibilities

  • Business logic
  • Data processing
  • Authentication
  • Database access
  • Returning responses

Real-World Example

When you log into a website:

  • The client collects your username and password
  • The client sends this data to the server
  • The server checks the credentials
  • The server responds with success or failure
  • The client updates the UI

Why This Matters

When building applications:

  • Flask handles server-side logic
  • FastAPI builds APIs for client communication
  • Django manages full client-server workflows

If you understand this separation, your applications will be cleaner and easier to scale.

Summary

  • The client sends requests
  • The server processes them
  • The server returns responses
  • The client displays the result

This separation is the foundation of modern web applications.

In the next lesson, you’ll dive deeper into HTTP and how communication between client and server actually works.