Day1: Introduction to web2, general terminology, different architecture, Single Page App, Serverless Functions
Published: 2024-05-20 09:49:46

## Topics
- Client Server Architecture
- Peer to Peer network
- Library vs Framework
- Technical Docs
- Runtime
- Single Page App

# Client Server Architecture

Client-server architecture is a distributed application structure that divides tasks or workloads between two main entities: clients and servers. This model allows multiple clients to request and receive services from a centralized server.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wz11fcd3e01qedx8971i.png)

- **client**: The client is a hardware device or software application that requests a service from the server. Clients initiate communication sessions with servers, send requests for specific resources or services, and wait for responses. Common examples include web browsers, email clients, and mobile apps.

- **server**:  The server is a hardware system or software application that provides resources, data, services, or programs to clients. Servers listen for client requests, process these requests, and return the appropriate responses. Examples include web servers, database servers, and file servers.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f4zac4gs31qjudd5npf5.png)

### Three-Tier Architecture


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b5moz3cn3yq8brdbter4.png)

**Description**: This model introduces an intermediary layer between the client and the server, often called the application server or middleware. This layer processes client requests and interacts with the server to fulfill these requests.
**Example**: A web application where the client interacts with a web server, which then communicates with a database server.

**Response**
```
[
{
    id: 2g72o29yr02
    title: "Learn React"
    status: "Completed"
},
{
    id: 2g72o29yr03
    title: "Learn Express"
    status: "Pending"
}
]
```
# Peer to peer network
A peer-to-peer (P2P) network is a decentralized communication model in which each participant, or "peer," has equal status and can act as both a client and a server. Unlike the client-server model, there is no central server managing the network. Instead, each peer can directly share resources such as files, bandwidth, and processing power with other peers.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v6pttvp0512tma2t2p53.png)

- There is no central authority or server in control of the network. Each peer independently maintains a portion of the network's resources and services.
- This reduces the risk of a single point of failure, making the network more robust and resilient.
- All peers have equal capabilities and responsibilities. Any peer can initiate or complete transactions without needing permission from a central authority.
- This democratizes the network, allowing any user to contribute and consume resources equally.
- **Example**: video calling application, chat application

# Library vs Framework
### **Library**
A library is a collection of pre-written code that developers can use to optimize tasks. It offers a set of functions or classes that can be called upon to perform specific actions or to provide particular functionalities.
- **NumPy (Python)**: A library for numerical computations.
- **jQuery (JavaScript)**: A library for simplifying HTML DOM tree traversal and manipulation.
- **React (JS)**: A frontend library.
### **Framework**
A framework is a more extensive system that provides a foundation on which software applications can be built. It dictates the structure of the application and offers a standardized way to build and deploy applications.
- **Django (Python)**: A web framework for building web applications.
- **Angular (JavaScript)**: A framework for building client-side applications.

# Technical Docs
Technical documentation, often referred to as technical docs, comprises detailed and structured information that explains how to use, maintain, and troubleshoot products or systems. It serves various audiences, including end-users, administrators, and developers, depending on the nature of the product. 

**User Manuals**: Guides designed for end-users to help them understand how to operate and use a product effectively. They often include step-by-step instructions, diagrams, and troubleshooting tips.

**API Documentation**: Provides information for developers on how to use and integrate with an API. This includes details on endpoints, request and response formats, authentication methods, and code examples.

**System Documentation**: Detailed descriptions of the architecture, components, and functions of a system. It often includes information on system requirements, configuration, and deployment processes.

**Technical Specifications**: Documents that outline the technical requirements and features of a product or system. They often include detailed descriptions of hardware and software components, performance metrics, and standards compliance.

**Installation Guides**: Instructions for setting up hardware or software products. These guides typically cover prerequisites, installation steps, configuration settings, and post-installation checks.

**Troubleshooting Guides**: Documents that help users and support staff diagnose and resolve issues. They often include common problems, error messages, and step-by-step solutions.

**Release Notes**: Detailed information about the updates and changes in a new version of a product. This can include new features, bug fixes, known issues, and upgrade instructions.

**White Papers**: Authoritative reports that provide detailed information on a specific topic, often explaining the benefits and technical aspects of a product, technology, or methodology.

# Runtime
"**Runtime**" in computing refers to the period during which a program is executing. It's the phase in a program's lifecycle that occurs after the program has been loaded into memory and the process of execution begins.

# A Single Page Application (SPA)
A Single Page Application (SPA) is a web application or website that interacts with the user by dynamically rewriting the current page rather than loading entire new pages from a server. This approach aims to provide a more seamless and fluid user experience, similar to that of a desktop application.
- React
- Angular
- Vue