# Directory Structure

## Introduction

The default Laravel Bash application structure will look very familiar, because it was copied. The difference is that every file ends in `.sh`.

## The Root Directory

| Directory | What's in it |
|---|---|
| `app/` | Your controllers, form requests, models, jobs, events and listeners. Every `.sh` file in here is sourced when the framework boots. |
| `bootstrap/` | `app.sh` boots the framework. `handle` is the program socat runs for each request. |
| `database/` | Migrations (plain `.sql` files), seeders and the SQLite database file. |
| `docs/` | These pages, as Markdown. |
| `framework/` | What would be `vendor/laravel/framework`: routing, Eloquent, Blade, queues and the rest, plus `markdown.awk`. |
| `resources/views/` | Blade templates, which are Bash files that print HTML. |
| `routes/` | `web.sh` for routes, `console.sh` for the schedule. |
| `storage/` | Logs, the queue folders, the event log and the broadcast log. |
| `tests/` | The bats test suite. |

## The Root Files

- `artisan` is the command line. It's a Bash script, like it always secretly wanted to be.
- `sail` wraps `docker compose`. Laravel Sail was always a Bash script, so this one is the real thing.
- `compose.yaml` and `Dockerfile` describe the `app` and `pgsql` containers.

## The Storage Directory

| Path | Used by |
|---|---|
| `storage/logs/laravel.log` | `Log::info` and friends |
| `storage/queue/pending/` | Jobs waiting to run |
| `storage/queue/processing/` | Jobs a worker has claimed |
| `storage/queue/failed/` | Jobs that failed or timed out |
| `storage/events/events.log` | Event payloads, for the listener to read |
| `storage/broadcasts/broadcasts.log` | Everything broadcast, followed by `tail -F` |
| `storage/framework/*.lock` | `flock` locks for the scheduler |

> [!NOTE]
> Everything in `storage/` is a plain text file. If you want to know what the framework is doing, `cat` it.
