# OJ Structure

The OJ consists of 3 parts.

![the oj system](https://2451206113-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LxjkeLB1kzNwHjiPZ5X%2F-LxjnpnvzD1CGPDoutY0%2F-Lxjo8ZwBKsV3fRZZTCk%2Fimage.png?alt=media\&token=620fe3d5-899d-4b7a-b6c2-f5f8e3d8f843)

## Judger

Judgers are servers that run and grade codes. There are many judgers and each of them is independent. They are all connected by socket to the Server Manager.

Judgers receive code and problem information from server manager and judge the code, then they return the result to the server manager. Sometimes they are called Judging Daemon

## Server Manager

Server Manager is the core of the whole OJ. It deals with data and requests. Most of the other components connect to it by socket.

## Tomcat

Tomcat is the display core of the whole OJ. It should be run on the same server as server manager in order to fetch data quickly. It hosts the frontend.


---

# Agent Instructions: 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://xgn.gitbook.io/hhsoj-essential-doc/structure/oj-structure.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.
