> 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-site/community/getting-started.md).

# Local setup

Run KlassApp on your own computer. This matches the repository `README.md`. There is no one-line installer.

## You need

| Tool            | Version                                   |
| --------------- | ----------------------------------------- |
| PHP             | 8.4+                                      |
| Composer        | 2                                         |
| Node.js         | 20+ (or current LTS)                      |
| MySQL and Redis | 8 and 7, or Docker Compose from this repo |
| Git             | any current release                       |

Composer allows PHP 8.2 and newer. CI and the Docker image use 8.4. Use 8.4 if you can.

## 1. Clone and install

```bash
git clone https://github.com/KlassApp-Foundation/KlassApp.git
cd KlassApp
composer install
cp .env.example .env
php artisan key:generate
npm ci
```

If `npm ci` fails on peer dependencies, keep the repo `.npmrc`. It sets `legacy-peer-deps=true` for old Vue peer declarations.

## 2. Configure `.env`

Minimum to boot:

```ini
APP_URL=http://localhost:8000
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=klassapp_local
DB_USERNAME=root
DB_PASSWORD=

CACHE_STORE=file
SESSION_DRIVER=file
QUEUE_CONNECTION=database
```

Leave Toshi's model key empty for a plain UI check. `TOSHI_LLM_ENABLED=false` keeps the assistant off. New schools already start with the assistant off.

WhatsApp keys stay empty unless you are on the [local simulator](https://github.com/KlassApp-Foundation/KlassApp/tree/main/community/whatsapp/README.md).

## 3. Database

Docker Compose (app, MySQL, Redis, nginx; the README uses port 8080):

```bash
docker compose up -d
```

Point `DB_HOST` at the compose services when PHP runs inside the app container. Use `127.0.0.1` when PHP runs on the host and the ports are published.

Or use MySQL and Redis you already have, matching the `.env` values above.

Then:

```bash
php artisan migrate
php artisan storage:link
```

Use factories, tests, and the demo school seeders. Never load real student or parent records.

## 4. Run

```bash
# Terminal 1 — Vite (writes public/hot while it runs)
npm run dev

# Terminal 2
php artisan serve
```

Open `http://127.0.0.1:8000`.

For a production-like asset build, stop `npm run dev`, delete `public/hot` if it is still there, then:

```bash
npm run build
php artisan serve
```

`npm run build` also builds these docs. If `public/hot` is left behind, Laravel tries to load assets from a Vite server that is not running.

## Next

[Tests](https://github.com/KlassApp-Foundation/KlassApp/tree/main/community/tests/README.md). Messaging without Meta: [WhatsApp simulator](https://github.com/KlassApp-Foundation/KlassApp/tree/main/community/whatsapp/README.md).


---

# 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-site/community/getting-started.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.
