> For the complete documentation index, see [llms.txt](https://nodeboot.gitbook.io/node-boot-framework/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nodeboot.gitbook.io/node-boot-framework/getting-started.md).

# Getting Started

{% hint style="success" %}
Before getting started, we encourage you to unfold our Letters to Developers to gain a better understanding of our motivation.
{% endhint %}

To embark on your Node-Boot journey, the optimal starting point is to browse our marketplace and select a *Software Template* that aligns with your project needs.&#x20;

Once chosen, you can then specify your *preferred application server*, enabling you to swiftly initiate your development journey with a fully functional sample application. By building and running this selected template, you'll seamlessly immerse yourself in exploring the comprehensive features offered by Node-Boot.&#x20;

We firmly advocate for this approach as it establishes a standardised foundation from the outset, ensuring consistency and efficiency throughout your development process.

## Highlight

Our Software Templates are crafted to swiftly generate sample applications equipped with all the essentials for a seamless start. However, we value transparency and encourage you to comprehend the underlying steps, as we firmly believe that knowledge forms the bedrock of success.

{% hint style="info" %}
Let's assume you have a penchant for fast applications, and you've opted for **Fastify** as your chosen application server framework.
{% endhint %}

Alright, first things first: it's dependency installation time! Get ready to play "*Fetch the Dependencies*" - it's like a scavenger hunt, but for code!

1. Install Node-Boot core dependencies

{% tabs %}
{% tab title="NPM" %}

```bash
npm install @node-boot/core @node-boot/config @node-boot/context reflect-metadata winston 
```

{% endtab %}

{% tab title="PNPM" %}

```bash
pnpm add @node-boot/core @node-boot/config @node-boot/context reflect-metadata winston
```

{% endtab %}

{% tab title="YARN" %}

```bash
yarn add @node-boot/core @node-boot/config @node-boot/context reflect-metadata winston
```

{% endtab %}
{% endtabs %}

2. Install Server Layer: Fastify&#x20;

{% tabs %}
{% tab title="NPM" %}

```bash
npm install @node-boot/fastify-server fastify
```

{% endtab %}

{% tab title="PNPM" %}

```bash
pnpm add @node-boot/fastify-server fastify
```

{% endtab %}

{% tab title="YARN" %}

```bash
yarn add @node-boot/fastify-server fastify
```

{% endtab %}
{% endtabs %}

2. Setup Node-Boot Application

{% code title="app.ts" %}

```typescript
import "reflect-metadata";
import {NodeBoot, NodeBootApp, NodeBootApplication, NodeBootAppView} from "@node-boot/core";
import {FastifyServer} from "@node-boot/fastify-server";

@NodeBootApplication()
export class SampleApp implements NodeBootApp {

    start(port?: number): Promise<NodeBootAppView> {
        return NodeBoot.run(FastifyServer, port);
    }
}
```

{% endcode %}

{% code title="server.ts" %}

```typescript
import {SampleApp} from "./app";

// Starts the Node-Boot server with the application deployed
new SampleApp()
    .start()
    .then(app => {
        console.debug(`SampleApp started successfully at port ${app.appOptions.port}`);
    })
    .catch(reason => {
        console.error(`Error starting SampleApp: ${reason}`);
    });
```

{% endcode %}

3. Add Application Configuration File

{% code title="app-config.yaml" lineNumbers="true" %}

```yaml
node-boot:
    # App configurations
    app:
        name: "sample-service"
        platform: "sample"
        environment: "development"
        defaultErrorHandler: false
        port: 3000
```

{% endcode %}

## Application structure

A typical Node-Boot project has the following structure:

<figure><img src="/files/lB78bctWtvZk16D3i1Fv" alt=""><figcaption></figcaption></figure>
