# Workspace

The workspace is often the root directory in a Polylith codebase, and it's where we work with all our building blocks and projects. A workspace is version controlled in a [monorepo](https://en.wikipedia.org/wiki/Monorepo), and its subdirectories look like this:

```
▾ workspace
  ▸ bases
  ▸ components
  ▸ development
  ▸ projects
```

An alternative is to let the monorepo host more than one workspace, e.g.:

```
▾ workspace1
  ▸ bases
  ▸ components
  ▸ development
  ▸ projects
▸ workspace2
▸ workspace3
```

We can summarise the main ideas like this. Components encapsulate functionality while the bases decide how the code should be exposed and executed, e.g. as a command line tool, a lambda function, or a REST API. This separation allows us to easily change how our code is executed by including an arbitrary set of bricks in each project, that can later be used to build the artifacts we need. Finally, the development project is used to improve the development experience.

If you want to see an example of a complete Polylith codebase, go to the [RealWorld example app](https://github.com/furkan3ayraktar/clojure-polylith-realworld-example-app) or the [usermanager-example app](https://github.com/seancorfield/usermanager-example/tree/polylith).


---

# 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://polylith.gitbook.io/polylith/architecture/2.1.-workspace.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.
