## 1. Project Overview & Quickstart (mvanhorn/README.de)

# README.de

Open-source repository mvanhorn/README.de

### Repository Details
- **Repository:** [mvanhorn/README.de](https://github.com/mvanhorn/README.de)
- **Primary Language:** Code

*Note: High-volume repository documentation is actively indexed and synchronized by YakaAI.*

## 2. Official Technical Reference & Guides (mvanhorn/docs)

## File: README.md

# Documentation

Read the docs at [docs.vapor.codes](https://docs.vapor.codes)

# Start with Docker 
* Prerequisite for this setup, you must have docker and docker compose installed on the system 

1. first clone the repo 

2. then run 
```
docker compose up 
```
3. then open from the browser on the port 8000 
e.g.  
```
http://127.0.1.1:8000
```

## Contributing

If you want to add information to the docs or have found any mistakes you wish to fix, feel free to create a PR  for the change.

### *Translating*
---

Localised docs are incredibly useful for allowing people to learn Vapor in their native language. If you wish to contribute to the Vapor documentation by translating, follow the steps below.

You'll need Python3 to build the docs. You can download this from the [Python Website](https://www.python.org/download/releases/3.0/) or install via Homebrew. Once installed, run `pip install -r requirements.txt` in the root directory of this repository. This will install all the needed dependencies in order to be able to build the documentation.  

Following the installation of the dependencies, check if your language you want to translate to is already included in the `mkdocs.yml` file. If it is not, then you can add it like this:
```yaml
languages:
  # Structure
  <language iso code>:
    name: 
    site_name: 
    build: true # Whether the documentation gets build or not. You can disable this if you don't want to build your language or want to temporarily disable other languages

  # Example
  nl:
    name: Nederlands
    site_name: Vapor Documentatie
    build: true
```
> NOTE: The language code you have to add must conform to the ISO 639-1 Standard. More information can be found [here](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).

If there are navigation components that have to be translated, then you can add them under `nav_translations` in the mkdocs file. This is done by specifying a keyword defined in the `nav:` section of the `mkdocs.yml` file and then adding the translation. An example can be found below of how to add those:
```yaml
nav_translations:
  # Structure
  <language code>:
    <keyword>: 

  # Example
  nl:
    Welcome: Welkom
    Install: Installeren
```

Copy the markdown file you would like to translate and name it `<original name file>.<language code>.md`. 
For example:
```
- index.md <- the original english documentation
- index.nl.md <- the dutch translation of the english documentation file
```

You can check it out by running `mkdocs serve` in the terminal. Once you are satisfied with your translations, feel free to create a PR. Don't forget to turn the `build` flag to true for all languages!

> NOTE: If a file isn't translated, it will just default to the default language file. So you don't have to translate everything all at once.

Finally, you should add the new language to the [issue template](https://github.com/vapor/docs/blob/main/.github/translation_needed.description.leaf) to ensure that any future changes are applied to the new translation and to the [search index script](https://github.com/vapor/docs/blob/main/fixSearchIndex.swift) to ensure search works correctly.

## Licensing


Except where otherwise noted, <a property="dct:title" rel="cc:attributionURL" href="https://github.com/vapor/docs">Vapor Documentation</a> by <a rel="cc:attributionURL dct:creator" property="cc:attributionName" href="https://vapor.codes">Vapor</a> is licensed under [CC BY-NC-SA 4.0    ](http://creativecommons.org/licenses/by-nc-sa/4.0/)

---

## File: docs/getting-started/folder-structure.de.md

# Ordnerstruktur

Lass uns einen Blick auf die Ordnerstruktur von Vapor werfen. Die Ordnerstruktur von Vapor orientiert sich an den Vorgaben des [Swift Package Managers](spm.md). Falls du schon mal mit dem SPM gearbeitet hast, sollte sie dir bekannt vorkommen.

```
.
├── Public
├── Sources
│   ├── App
│   │   ├── Controllers
│   │   ├── Migrations
│   │   ├── Models
│   │   ├── configure.swift 
│   │   ├── entrypoint.swift
│   │   └── routes.swift
│       
├── Tests
│   └── AppTests
└── Package.swift
```

## Public

Der Ordner _Public_ beinhaltet Dateien, die sozusagen mitveröffentlicht werden. Das können Dateien für die Seitendarstellung sein, wie z. B. Bilder, CSS/JS-Dateien sein. Damit Vapor während der Ausführung auf den Ordner zugreifen kann muss eine _FileMiddleware_ in der Datei `configure.swift` mitangegeben werden.

```swift
// Serves files from `Public/` directory
let fileMiddleware = FileMiddleware(
    publicDirectory: app.directory.publicDirectory
)
app.middleware.use(fileMiddleware)
```

## Sources

Im Ordner _Sources_ befinden sich die eigentlichen Anwendungsdateien deines Projektes.

### App

Der Ordner _App_ beinhaltet die Anwendungslogik und stellt zudem, wie in der [Paketbeschreibung](../getting-started/spm.md) angegeben, das Modul des Paketes dar.

#### Controllers

Der Ordner _Controllers_ beinhaltet die Definitionen der Endpunkte der Anwendung. Mehr dazu findest du im Abschnitt [Controllers](../basics/controllers.md).

#### Migrations

Der Ordner _Migrations_ beinhaltet die Definitionen zu Tabellen der Datebank.

#### Models

Der Ordner _Models_ beinhaltet die Klassendefinitionen für die Entitäten.

#### configure.swift

Die Datei _configure.swift_ umfasst die Methode `configure(_:)`. Sie wird vom Einstiegspunkt aufgerufen um die Anwendung mit entsprechenden Angaben zu Endpunkten, zur Datenbank oder zu Providern zu konfigurieren.

#### entrypoint.swift

In der Datei _entrypoint.swift_ befindet sich der Einstiegspunkt (`@main`) für die Anwendung, von dem aus die Anwendung eingerichtet, konfiguriert und gestartet wird.

#### routes.swift

Die Datei _routes.swift_ beinhaltet die Methode `routes(_:)`. Sie wird am Ende von der `configure(_:)`-Methode aufgerufen um die Endpunkte zu registrieren. 

## Tests

Für jedes Paketmodul kann ein entsprechender Ordner unter _Tests_ angelegt werden.

### AppTests

Der Ornder _AppTests_ beinhaltet alle möglichen Tests für Komponenten der Anwendung.

## Package.swift

Die Datei _Package.swift_ ist die Paketbeschreibung.

---

## File: docs/getting-started/folder-structure.es.md

# Estructura de Carpetas

Una vez has creado, compilado y ejecutado tu primera app de Vapor, vamos a familiarizarte con la estructura de carpetas de Vapor. La estructura está basada en la utilizada por [SPM](spm.md), así que si has trabajado anteriormente con SPM debería ser algo conocido. 

```
.
├── Public
├── Sources
│   ├── App
│   │   ├── Controllers
│   │   ├── Migrations
│   │   ├── Models
│   │   ├── configure.swift 
│   │   ├── entrypoint.swift
│   │   └── routes.swift
│       
├── Tests
│   └── AppTests
└── Package.swift
```

Las secciones siguientes explican de manera más detallada cada parte de la estructura de carpetas.

## Public

Esta carpeta contiene los ficheros públicos que serán servidos por tu app si `FileMiddleware` está activado. Suelen ser imágenes, hojas de estilo o scripts de navegador. Por ejemplo, una petición a `localhost:8080/favicon.ico` comprobará si `Public/favicon.ico` existe y lo devolverá.

Necesitarás habilitar `FileMiddleware` en tu fichero `configure.swift` para que Vapor pueda servir ficheros públicos.

```swift
// Serves files from `Public/` directory
let fileMiddleware = FileMiddleware(
    publicDirectory: app.directory.publicDirectory
)
app.middleware.use(fileMiddleware)
```

## Sources

Esta carpeta contiene todos los ficheros Swift de código fuente para tu proyecto. 
La carpeta `App`, de nivel superior, corresponde al módulo de tu package, 
tal y como está declarado en el manifiesto de [SwiftPM](spm.md).

### App

Aquí es donde se aloja toda la lógica de tu app. 

#### Controllers

Los controladores son una buena manera de agrupar lógica de aplicación. La mayoría de controladores tienen muchas funciones que aceptan una petición y devuelven algún tipo de respuesta.

#### Migrations

En esta carpeta es donde se ubican las migraciones de tu base de datos si estás usando Fluent.

#### Models

La carpeta **models** es un buen lugar en el que guardar los structs `Content` o los `Model` de Fluent.

#### configure.swift

Este fichero contiene la función `configure(_:)`. Este método es llamado por `entrypoint.swift` para configurar la `Application` recién creada. Aquí es donde deberías registrar servicios como rutas, bases de datos, proveedores y otros. 

#### entrypoint.swift

Este fichero contiene el punto de entrada `@main` para la aplicación, que crea, configura y ejecuta tu aplicación Vapor.

#### routes.swift

Este fichero contiene la función `routes(_:)`. Este método es llamado casi al final de `configure(_:)` para registrar rutas en tu `Application`. 

## Tests

Cada módulo no ejecutable en tu carpeta `Sources` puede tener una carpeta correspondiente en `Tests`. Contiene código del módulo `XCTest` para hacer testing a tu package. Los tests pueden ser ejecutados usando `swift test` en la línea de comandos o pulsando ⌘+U en Xcode. 

### AppTests

Esta carpeta contiene los tests unitarios para el código en tu módulo `App`.

## Package.swift

Finalmente está el manifiesto del package [SPM](spm.md).

---

## File: docs/getting-started/folder-structure.it.md

# Struttura della Cartella

Dopo aver creato, compilato ed eseguito la tua prima applicazione, è il momento di dare un'occhiata a come Vapor struttura le cartelle del progetto. La struttura si basa su [SwiftPM](spm.md), quindi se hai già familiarità con SwiftPM ti sentirai a casa.

```
.
├── Public
├── Sources
│   ├── App
│   │   ├── Controllers
│   │   ├── Migrations
│   │   ├── Models
│   │   ├── configure.swift 
│   │   ├── entrypoint.swift
│   │   └── routes.swift
│       
├── Tests
│   └── AppTests
└── Package.swift
```

Le seguenti sezioni spiegano in maggior dettaglio la struttura della cartella.

## Public

Questa cartella contiene tutti i file pubblici che saranno messi a disposizione dall'applicazione se `FileMiddleware` è abilitato. In genere si tratta di immagini, style sheet e script del browser. Ad esempio, una richiesta a `localhost:8080/favicon.ico` controlla se `Public/favicon.ico` esiste e lo restituisce.

Affinché Vapor possa servire i file pubblici, bisognerà abilitare `FileMiddleware` nel file `configure.swift`.

```swift
// Fornisce i file dalla cartella `Public/`
let fileMiddleware = FileMiddleware(
    publicDirectory: app.directory.publicDirectory
)
app.middleware.use(fileMiddleware)
```

## Sources

Questa cartella contiene tutti i file sorgente Swift che verranno utilizzati dal progetto.
La cartella di primo livello, `App`, riflette il modulo del tuo pacchetto, come dichiarato nel manifesto [SwiftPM](spm.md).

### App

La cartella `App` contiene tutta la logica dell'applicazione.

#### Controllers

I controller sono un ottimo modo per raggruppare la logica dell'applicazione. La maggior parte dei controller ha diverse funzioni che accettano una richiesta e restituiscono qualche tipo di risposta.

#### Migrations

Se si utilizza Fluent, questa cartella contiene le migrazioni del database.

#### Models

La cartella dei modelli è un ottimo posto per memorizzare le strutture `Content` e i modelli di Fluent.

#### configure.swift

Questo file contiene la funzione `configure(_:)`. Questo metodo viene chiamato da `entrypoint.swift` per configurare la nuova `Application` creata. Qui vengono registrati gli endpoints, i database, i providers e altro ancora.

#### entrypoint.swift

Questo file contiene la funzione `main(_:)`. Questo metodo viene chiamato dal sistema operativo per avviare l'applicazione. In genere non è necessario modificarlo.

#### routes.swift

Questo file contiene la funzione `routes(_:)`. Questo metodo viene chiamato da `configure(_:)` per registrare gli endpoint dell'applicazione.

## Tests

Per ogni modulo non eseguibile nella cartella `Sources` si può avere una cartella corrispondente in `Tests`. Essa conterrà i test per quel modulo scritti sulla base del modulo di testing `XCTest`. I test possono essere eseguiti utilizzando `swift test` da riga di comando o premendo ⌘+U in Xcode.

### AppTests

Questa cartella contiene gli unit test per il codice del modulo `App`.

## Package.swift

Infine, abbiamo il manifesto del pacchetto [SPM](spm.md).

---

## File: docs/getting-started/folder-structure.ja.md

# フォルダ構造 {#folder-structure}

あなたの初めての Vapor アプリを作成し、ビルドし、実行したので、Vapor のフォルダ構造に慣れるための時間を取りましょう。この構造は、[SPM](spm.ja.md) のフォルダ構造に基づいていますので、以前に SPM を使ったことがあれば、見慣れているはずです。

```
.
├── Public
├── Sources
│   ├── App
│   │   ├── Controllers
│   │   ├── Migrations
│   │   ├── Models
│   │   ├── configure.swift
│   │   ├── entrypoint.swift
│   │   └── routes.swift
│
├── Tests
│   └── AppTests
└── Package.swift
```

以下のセクションでは、フォルダ構造の各部分について詳しく説明します。

## Public

このフォルダには、`FileMiddleware` が有効になっている場合にアプリによって提供される公開ファイルが含まれます。これは通常、画像やスタイルシート、ブラウザスクリプトです。例えば、`localhost:8080/favicon.ico` へのリクエストは、`Public/favicon.ico` が存在するかどうかを確認し、それを返します。

Vapor が公開ファイルを提供できるようにする前に、`configure.swift` ファイルで `FileMiddleware` を有効にする必要があります。

```swift
// Serves files from `Public/` directory
let fileMiddleware = FileMiddleware(
    publicDirectory: app.directory.publicDirectory
)
app.middleware.use(fileMiddleware)
```

## Sources

このフォルダには、プロジェクトのすべての Swift ソースファイルが含まれています。
トップレベルのフォルダ、`App` は、[SwiftPM](spm.ja.md) のマニフェストで宣言されたパッケージのモジュールを反映しています。

### App

ここには、アプリケーションの全てのロジックが入ります。

#### Controllers

Controllers は、アプリケーションのロジックをまとめるのに適しています。ほとんどのコントローラには、リクエストを受け取り、何らかの形でレスポンスを返す多くの関数があります。

#### Migrations

Migrations フォルダは、Fluent を使用している場合、データベースの移行を格納する場所です。

#### Models

Models フォルダは、`Content` 構造体や Fluent の `Model` を保存するのに適しています。

#### configure.swift {#configureswift}

このファイルには、`configure(_:)` 関数が含まれています。このメソッドは、新しく作成された `Application` を設定するために `entrypoint.swift` から呼び出されます。ここで、ルート、データベース、プロバイダなどのサービスの登録をする必要があります。

#### entrypoint.swift {#entrypointswift}

このファイルには、Vapor アプリケーションの設定と実行を行うアプリケーションの `@main` エントリーポイントが含まれています。

#### routes.swift {#routesswift}

このファイルには、`routes(_:)` 関数が含まれています。このメソッドは、`Application` へのルートを登録するために、`configure(_:)` の終わり近くで呼び出されます。

## Tests

`Sources` フォルダ内の各非実行可能モジュールには、`Tests` の対応するフォルダがあります。これには、パッケージのテストのために `XCTest` モジュールに基づいてビルドされたコードが含まれています。テストは、コマンドラインで `swift test` を使用するか、Xcode で ⌘+U を押すと実行できます。

### AppTests

このフォルダには、`App` モジュールのコードの単体テストが含まれています。

## Package.swift {#packageswift}

最後に、[SPM](spm.ja.md) のパッケージマニフェストがあります。

---

## File: docs/getting-started/folder-structure.ko.md

# 폴더 구조

이제 첫 번째 Vapor 앱을 만들고 빌드하고 실행했으니, Vapor의 폴더 구조에 익숙해지는 시간을 가져보겠습니다. 이 구조는 SPM의 폴더 구조를 기반으로 하기 때문에, 이전에 [SPM](spm.ko.md)을 사용한 적이 있다면 익숙할 것입니다.

```
.
├── Public
├── Sources
│   ├── App
│   │   ├── Controllers
│   │   ├── Migrations
│   │   ├── Models
│   │   ├── configure.swift 
│   │   ├── entrypoint.swift
│   │   └── routes.swift
│       
├── Tests
│   └── AppTests
└── Package.swift
```

아래의 섹션에서는 폴더 구조의 각 부분을 자세히 설명합니다.

## Public

이 폴더에는 `FileMiddleware`가 활성화된 경우 앱에서 제공되는 공개 파일이 포함됩니다. 일반적으로 이미지, 스타일 시트 및 브라우저 스크립트가 여기에 포함됩니다. 예를 들어, `localhost:8080/favicon.ico`로의 요청은 `Public/favicon.ico` 파일의 존재 여부를 확인하고 해당 파일을 반환합니다. 
해당 [https://design.vapor.codes/favicons/favicon.ico](https://design.vapor.codes/favicons/favicon.ico)에 접속하면 Vapor로고 이미지를 확인할 수 있습니다. 

Vapor가 공개 파일을 제공하기 위해선 `configure.swift` 파일에서 `FileMiddleware`를 활성화해야 합니다.


```swift
// Serves files from `Public/` directory
let fileMiddleware = FileMiddleware(
    publicDirectory: app.directory.publicDirectory
)
app.middleware.use(fileMiddleware)
```

## Sources

이 폴더에는 프로젝트의 모든 Swift 소스 파일이 포함됩니다.
최상위 폴더인 `App`은 [SwiftPM](spm.ko.md) 매니페스트에서 선언된 패키지 모듈을 반영합니다.

### App

이 폴더는 애플리케이션 로직이 모두 들어가는 곳입니다.

#### Controllers

컨트롤러는 애플리케이션 로직을 그룹화하는 좋은 방법입니다. 대부분의 컨트롤러에는 요청을 받아들이고 어떤 형태의 응답을 반환하는 많은 함수가 있습니다.

#### Migrations

마이그레이션 폴더는 Fluent를 사용하는 경우 데이터베이스 마이그레이션을 위한 곳입니다.

#### Models

모델 폴더는 `Content` 구조체나 Fluent `Model`을 저장하기 좋은 장소입니다.

#### configure.swift

이 파일에는 `configure(_:)` 함수가 포함되어 있습니다. 이 메서드는 `entrypoint.swift`에 의해 호출되어 새로 생성된 `Application`을 구성합니다. 여기에서 라우트, 데이터베이스, 프로바이더 등과 같은 서비스를 등록해야 합니다.

#### entrypoint.swift

이 파일에는 Vapor 애플리케이션을 설정, 구성 및 실행하는 `@main` 진입점이 포함되어 있습니다.

#### routes.swift

이 파일에는 `routes(_:)` 함수가 포함되어 있습니다. 이 메서드는 `configure(_:)`의 마지막 부분에서 `Application`에 라우트를 등록하는 데 사용됩니다.

## Tests

`Sources` 폴더의 각 비실행(non-executable) 모듈은 `Tests`에 해당하는 폴더를 가질 수 있습니다. 이 폴더에는 패키지를 테스트하기 위해 `XCTest` 모듈을 기반으로 작성된 코드가 포함됩니다. 테스트는 명령줄에서 `swift test`를 사용하거나 Xcode에서 ⌘+U를 눌러 실행할 수 있습니다. 

### AppTests

이 폴더에는 `App` 모듈의 코드를 위한 단위 테스트가 포함되어 있습니다.

## Package.swift

마지막으로 [SPM](spm.ko.md)의 패키지 매니페스트가 있습니다.

---

## File: docs/getting-started/folder-structure.md

# Folder Structure

Now that you've created, built, and run your first Vapor app, let's take a moment to familiarize you with Vapor's folder structure. The structure is based on [SPM](spm.md)'s folder structure, so if you've worked with SPM before it should be familiar. 

```
.
├── Public
├── Sources
│   ├── App
│   │   ├── Controllers
│   │   ├── Migrations
│   │   ├── Models
│   │   ├── configure.swift 
│   │   ├── entrypoint.swift
│   │   └── routes.swift
│       
├── Tests
│   └── AppTests
└── Package.swift
```

The sections below explain each part of the folder structure in more detail.

## Public

This folder contains any public files that will be served by your app if `FileMiddleware` is enabled. This is usually images, style sheets, and browser scripts. For example, a request to `localhost:8080/favicon.ico` will check to see if `Public/favicon.ico` exists and return it.

You will need to enable `FileMiddleware` in your `configure.swift` file before Vapor can serve public files.

```swift
// Serves files from `Public/` directory
let fileMiddleware = FileMiddleware(
    publicDirectory: app.directory.publicDirectory
)
app.middleware.use(fileMiddleware)
```

## Sources

This folder contains all of the Swift source files for your project. 
The top level folder, `App`, reflect your package's module, 
as declared in the [SwiftPM](spm.md) manifest.

### App

This is where all of your application logic goes. 

#### Controllers

Controllers are a great way of grouping together application logic. Most controllers have many functions that accept a request and return some sort of response.

#### Migrations

The migrations folder is where your database migrations go if you are using Fluent.

#### Models

The models folder is a great place to store your `Content` structs or Fluent `Model`s.

#### configure.swift

This file contains the `configure(_:)` function. This method is called by `entrypoint.swift` to configure the newly created `Application`. This is where you should register services like routes, databases, providers, and more. 

#### entrypoint.swift

This file contains the `@main` entry point for the application that sets up, configures and runs your Vapor application.

#### routes.swift

This file contains the `routes(_:)` function. This method is called near the end of `configure(_:)` to register routes to your `Application`. 

## Tests

Each non-executable module in your `Sources` folder can have a corresponding folder in `Tests`. This contains code built on the `XCTest` module for testing your package. Tests can be run using `swift test` on the command line or pressing ⌘+U in Xcode. 

### AppTests

This folder contains the unit tests for code in your `App` module.

## Package.swift

Finally is [SPM](spm.md)'s package manifest.

---

## File: docs/getting-started/folder-structure.nl.md

# Folder Structuur

Nu dat je je eerste Vapor app hebt gemaakt, gebouwd en uitgevoerd, laten we een moment nemen om jezelf vertrouwd te maken met Vapor's folder structuur. De structuur is gebaseerd op [SPM](spm.md)'s folder structuur, dus als je al met SPM hebt gewerkt zou deze je bekend voor moeten komen. 

```
.
├── Public
├── Sources
│   ├── App
│   │   ├── Controllers
│   │   ├── Migrations
│   │   ├── Models
│   │   ├── configure.swift 
│   │   ├── entrypoint.swift
│   │   └── routes.swift
│       
├── Tests
│   └── AppTests
└── Package.swift
```

The secties hieronder leggen elk deel van de folder structuur uit in meer detail.

## Public

Deze map bevat alle publieke bestanden die door uw app geserveerd zullen worden als `FileMiddleware` is ingeschakeld. Dit zijn meestal afbeeldingen, stylesheets en browserscripts. Bijvoorbeeld, een verzoek aan `localhost:8080/favicon.ico` zal controleren of `Public/favicon.ico` bestaat en deze terugsturen.

U moet `FileMiddleware` aanzetten in uw `configure.swift` bestand voordat Vapor publieke bestanden kan serveren.

```swift
// Dient bestanden op uit `Public/` directory
let fileMiddleware = FileMiddleware(
    publicDirectory: app.directory.publicDirectory
)
app.middleware.use(fileMiddleware)
```

## Sources

Deze map bevat alle Swift bronbestanden voor je project. 
De mappen op het hoogste niveau, `App` en `Run`, geven de modules van uw pakket weer, 
zoals aangegeven in het [SPM](spm.md) manifest.

### App

Dit is waar al je applicatie logica naartoe gaat. 

#### Controllers

Controllers zijn een goede manier om applicatie logica te groeperen. De meeste controllers hebben veel functies die een verzoek aannemen en een soort antwoord teruggeven.

#### Migrations

De migraties map is waar uw database migraties naar toe gaan als u Fluent gebruikt.

#### Models

De models map is een goede plaats om uw `Content` structs of Fluent `Model`s op te slaan.

#### configure.swift

Dit bestand bevat de `configure(_:)` functie. Deze methode wordt aangeroepen door `entrypoint.swift` om de nieuw aangemaakte `Application` te configureren. Dit is waar je services zoals routes, databases, providers, en meer moet registreren.

#### entrypoint.swift

Dit bestand bevat het `@main`-toegangspunt voor de toepassing die uw Vapor-toepassing instelt, configureert en uitvoert.

#### routes.swift

Dit bestand bevat de `routes(_:)` functie. Deze methode wordt aangeroepen aan het einde van `configure(_:)` om routes te registreren voor je `Application`. 

## Tests

Elke niet-uitvoerbare module in je `Sources` folder kan een overeenkomstige folder hebben in `Tests`. Deze bevalt code gebouwd op de `XCTest` module om je pakket te testen. Testen kunnen uitgevoerd worden door `swift test` te gebruiken op de command line of door ⌘+U in te drukken in Xcode.

### AppTests

Deze folder bevat de unit tests voor code in je `App` module.

## Package.swift

Tenslotte is er [SPM](spm.md)'s pakket manifest.

---

## File: docs/getting-started/folder-structure.pl.md

# Struktura folderów

Udało Ci się stworzyć, zbudować oraz uruchomić swoją pierwszą aplikacje Vapor, użyjmy tego momentu aby zapoznać Cię z strukturą folderów w projekcie. Struktura jest bazowana na strukturze [SPM](spm.md)a, więc jeśli wcześniej pracowałeś/aś z jego pomocą powinna być dla Ciebie znana.  

```
.
├── Public
├── Sources
│   ├── App
│   │   ├── Controllers
│   │   ├── Migrations
│   │   ├── Models
│   │   ├── configure.swift 
│   │   ├── entrypoint.swift
│   │   └── routes.swift
│       
├── Tests
│   └── AppTests
└── Package.swift
```

Sekcja poniżej wyjaśnia każdą część struktury folderów w detalach.

## Public

Then folder zawiera wszystkie publiczne pliki, które będą serwowane przez aplikacje jeśli `FileMiddleware` jest włączony. To zazwyczaj są obrazy, arkusze stylów i skrypty przeglądarki. Dla przykładu, zapytanie do `localhost:8080/favicon.ico` będzie sprawdzać czy `Public/favicon.ico` istnieje i zwracać je. 

Musisz aktywować `FileMiddleware` w pliku `configure.swift` twojego projektu, zanim Vapor będzie potrafił serwować pliki publiczne.

```swift
// Serwuje pliki folderu `Public/`
let fileMiddleware = FileMiddleware(
    publicDirectory: app.directory.publicDirectory
)
app.middleware.use(fileMiddleware)
```

## Sources

Ten folder zawiera wszystkie pliki źródłowe twojego projektu.
Folder o na górze zagnieżdżenia, `App`, odzwierciedla moduł pakietu,
zadeklarowany w manifeście [SwiftPM](spm.md).

### App

To miejsce na cała logikę twojej aplikacji.

#### Controllers

Kontrolery to świetny sposób na grupowania razem logiki aplikacji. Większość kontrolerów posiada wiele funkcji które przyjmują jakąś formę zapytania i zwracają dla niej odpowiedź.

#### Migrations

W tym folderze znajdują się wszystkie migracje bazy danych jeśli używać Fluenta.

#### Models

To świetne miejsce do trzymania `Content` struct lub `Model` z Fluenta. 

#### configure.swift

Ten plik zawiera funkcję `configure(_:)`. Metoda ta jest wywoływana przez `entrypoint.swift` w celu skonfigurowania nowo utworzonej `Aplikacji`. W tym miejscu należy zarejestrować usługi, takie jak trasy, bazy danych, dostawców i inne.

#### entrypoint.swift

Ten plik zawiera punkt wejścia `@main` dla aplikacji, która ustawia, konfiguruje i uruchamia aplikację Vapor.

#### routes.swift

Ten plik zawiera funkcję `routes(_:)`. Metoda ta jest wywoływana pod koniec `configure(_:)` w celu zarejestrowania ścieżek czy inaczej końcówek w `Application`.

## Tests

Każdy niewykonywalny moduł w folderze `Sources` może mieć odpowiadający mu folder w `Tests`. Zawiera on kod zbudowany na module `XCTest` do testowania aplikacji. Testy można uruchomić za pomocą `swift test` w wierszu poleceń lub naciskając ⌘+U w Xcode.

### AppTests

Ten folder zawiera testy jednostkowe dla kodu w module `App`.

## Package.swift

Na końcu znajduje się manifest pakietu [SPM](spm.md).

---

## File: docs/getting-started/folder-structure.zh.md

# 项目结构

现在，你已经创建并运行了第一个 Vapor 应用程序，让我们稍微花点时间熟悉一下 Vapor 的项目结构。该结构是在 [SPM](spm.zh.md) 的基础上演化而来；因此，如果你曾经使用过 SPM，应该会很熟悉。


```
.
├── Public
├── Sources
│   ├── App
│   │   ├── Controllers
│   │   ├── Migrations
│   │   ├── Models
│   │   ├── configure.swift 
│   │   ├── entrypoint.swift
│   │   └── routes.swift
│       
├── Tests
│   └── AppTests
└── Package.swift
```

下面将详细地解释每个文件夹的作用。

## Public

如果你使用了 `FileMiddleware` 中间件，那么此文件夹包含你的应用程序提供的所有公共文件，通常是图片、`.css` 样式和浏览器脚本等。 例如，对 `localhost:8080/favicon.ico` 发起的请求将检查是否存在 `Public/favicon.ico` 图片并回应。

在 Vapor 可以提供公共文件之前，你需要在 `configure.swift` 文件中启用`FileMiddleware`，参考如下所示：

```swift
// 从 'Public/' 目录提供文件
let fileMiddleware = FileMiddleware(
    publicDirectory: app.directory.publicDirectory
)
app.middleware.use(fileMiddleware)
```

## Sources

此文件夹包含项目的所有 Swift 源文件。 顶级文件夹 `App` 反映了你的包的模块，如 [SwiftPM](spm.md) 清单中声明的那样。

### App

应用程序的所有核心代码都包含在这里。

#### Controllers

控制器是将应用程序的不同逻辑进行分组的优秀方案，大多数控制器都具备接受多种请求的功能，并根据需要进行响应。

#### Migrations

如果你使用 Fluent，则可以在 Migrations 文件夹中进行数据库迁移。

#### Models

models 文件夹常用于存放 `Content` 和 Fluent `Model` 的类或结构体。

#### configure.swift

这个文件包含 `configure(_:)` 函数，`entrypoint.swift` 调用这个方法用以配置新创建的 `Application` 实例。你可以在这里注册诸如路由、数据库、providers 等服务。

#### entrypoint.swift

该文件包含应用程序的 `@main` 入口点，用于设置、配置和运行 Vapor 应用程序。

#### routes.swift

这个文件包含 `routes(_:)` 方法，它会在 `configure(_:)` 结尾处被调用，用以将路由注册到你的 `Application`。

## Tests

`Sources` 文件夹中的每个不可运行的模块在 `Tests` 中都可以创建一个对应的文件夹，包含 `XCTest` 模块上构建的用例，用来测试你的代码。可以在命令行使用 `swift test`或在 Xcode 中按 `⌘+U` 来进行测试。

### AppTests

此文件夹包含 `App` 模块中代码的单元测试。

## Package.swift

最后是 [SPM](spm.zh.md) 文件，是这个项目运行所依赖的第三方库配置。