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

# Architecture (start here)

KlassApp is a **multi-tenant** Laravel 12 school platform: every school’s data is scoped by `school_id`. Staff work in role portals (admin, teacher, …); parents use **WhatsApp** (Meta Cloud API). **Toshi** is the in-product AI agent (Livewire + Laravel AI) for guided setup and day-to-day help.

This page is a **short bridge**, not a second wiki. Depth lives on DeepWiki (auto-generated from the current codebase).

## Read next on DeepWiki

| Topic                | DeepWiki                                                                                                         |
| -------------------- | ---------------------------------------------------------------------------------------------------------------- |
| Platform shape       | [Core Platform Architecture](https://deepwiki.com/KlassApp-Foundation/KlassApp/2-core-platform-architecture)     |
| Tenancy & data model | [Data Model & Multi-Tenancy](https://deepwiki.com/KlassApp-Foundation/KlassApp/2.2-data-model-and-multi-tenancy) |
| Toshi                | [Toshi AI Assistant](https://deepwiki.com/KlassApp-Foundation/KlassApp/3-toshi-ai-assistant)                     |
| Wizard / engine      | [School Onboarding](https://deepwiki.com/KlassApp-Foundation/KlassApp/4-school-onboarding)                       |
| Tests                | [Testing Strategy](https://deepwiki.com/KlassApp-Foundation/KlassApp/9.3-testing-strategy)                       |
| Hosting / ops        | [Deployment & Operations](https://deepwiki.com/KlassApp-Foundation/KlassApp/9.4-deployment-and-operations)       |

Overview hub: [DeepWiki — KlassApp](https://deepwiki.com/KlassApp-Foundation/KlassApp).

## Also in this repo

* **Toshi end-to-end shape (code audit):** [`architecture/toshi-shape-2026-09.md`](/klassapp-documentation/docs/architecture-1/toshi-shape-2026-09.md)
* Contribute / run tests: [`CONTRIBUTING.md`](/klassapp-documentation/contributing.md)
* Agent rules (AI maintainers): [`AGENTS.md`](/klassapp-documentation/agents.md)
* Fork history: [`project-provenance.md`](/klassapp-documentation/docs/project-provenance.md)
* Public direction: [`roadmap.md`](/klassapp-documentation/docs/roadmap.md)

## Do not use for current architecture

[`docs/dev/`](/klassapp-documentation/docs/dev.md) is **archived historical** material (Evolution API + DigitalOcean era). Production today is **Laravel Cloud** + **Meta WhatsApp Cloud API**. Ignore `docs/dev/` when learning how the system works now.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://klassdocs.gitbook.io/klassapp-documentation/docs/architecture.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
