> For the complete documentation index, see [llms.txt](https://iqtlabs.gitbook.io/packet-cafe/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://iqtlabs.gitbook.io/packet-cafe/design/architecture.md).

# Architecture

Packet Café is laid out in a series of components, each with their own purpose while still being flexible to add or remove components as needed.

There are 7 major components and any number of analytic processes, or tools, that can be included. By default there [9 analytic processes](https://iqtlabs.gitbook.io/packet-cafe/design/tools) included.

![Components of this are run in Docker containers](/files/-MEaQDe4YS3tJv5Z7XZP)

An end user interacts with the `ui` component for uploading PCAP files and interacting with the results of the analytic processes. The `ui` component was built with [ReactJS](https://reactjs.org/) and can be scaled out to `n` instances behind the `load balancer`.

The `lb` component is the load balancer which processes requests to both instances of the `ui` component as well as instances of the `web` component. It allows both of those components to scale out to `n` instances as needed.

The `web` component serves up a RESTful [API](https://iqtlabs.gitbook.io/packet-cafe/design/api#web-port-80) for retrieving results from the analytic processes and passing them on to the `ui` component.

Optionally, there is an `admin` component that serves up a RESTful [API](https://iqtlabs.gitbook.io/packet-cafe/design/api#admin-port-5001) for making requests about the service at a global level to identify sessions, IDs, and files.

The `messenger` component is a [RabbitMQ](https://www.rabbitmq.com/) server which brokers messages between the `web` components, the `workers` components, and the analytic processes.

The `worker` component is responsible for taking requests from the `web` component of files to process and spinning up analytic processes to process those files. These processes can be run in parallel as well as in a pipeline that feeds inputs and outputs in a chain of analytic processes. The `worker` component can be scaled out to `n` number of `workers` and maintains the state and status of jobs in the `redis` component.

The `redis` component is a [Redis](https://redis.io/) server which stores state and status of jobs across the entire system.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://iqtlabs.gitbook.io/packet-cafe/design/architecture.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
