---
title: Hello world in TypeScript
description: Create your first application using TypeScript
language: typescript
---

## Creating your first TypeScript application

This guide will walk you through creating your first WendyOS application using TypeScript. The Wendy template scaffolds a small long-running [Express](https://expressjs.com/) server that responds with `{"message":"hello-world"}`. It's a great way to prove that you can send your first app to your device and verify your development environment is set up correctly.

### Prerequisites

- [Wendy CLI installed](../../../../installation/cli/) on your development computer.
- Docker running with Buildx. Check with `docker info` and `docker buildx version`.
- A [Linux device or WendyOS VM](../../../../installation/) ready to run your app.

The Dockerfile installs the language toolchain inside the builder. You only need
a local language installation if you choose to run the source outside Docker.

<Callout type="info">
  **Containerized Deployment**: TypeScript applications run inside containers on your WendyOS device. This guide shows you how to package the Node.js runtime for deployment with the Wendy CLI.
</Callout>

## Creating the project

<Steps>
  <Step>
    ### Initialize the project

    Start from the Wendy TypeScript template:

    ```bash
    wendy init hello-world --target wendyos --language node --template simple-api --var APP_ID=hello-world --var PORT=5001 --assistant skip --git-init no
    cd hello-world
    ```

    <CliShot flow="init" step="wizard" alt="wendy init scaffolding the hello-world TypeScript project from the simple-api template" />

    The template creates `package.json`, `tsconfig.json`, `src/index.ts`, `Dockerfile`, and `wendy.json`. [Understand the generated web server](../../../../guides/tutorials/typescript/generated-server/) explains each file.
  </Step>

  <Step>
    ### Run on WendyOS

    ```bash
    wendy run
    ```

    <CliShot flow="run" step="deploy" alt="wendy run building and deploying the hello-world TypeScript app to a WendyOS device" />

    <CliClip flow="run" alt="Animated walkthrough of wendy run building, deploying, and starting the hello-world app" />

    Wendy will build the app, ask you to select a device if one is not already configured, deploy the app, and show the run output. Because this is an HTTP server, the app keeps running and the generated `postStart` hook opens your browser to the device.
  </Step>
</Steps>

## Verifying deployment on your device

After deploying your application to a WendyOS device, you can verify it is running by listing the applications on your device:

```bash
wendy device apps list
✔︎ Searching for WendyOS devices [5.3s]
✔︎ Listing applications: True Probe [USB, Ethernet, LAN]
╭───────────────┬─────────┬─────────┬──────────╮
│ App           │ Version │ State   │ Failures │
├───────────────┼─────────┼─────────┼──────────┤
│ hello-world   │ 0.1.0   │ Running │ 0        │
╰───────────────┴─────────┴─────────┴──────────╯
```

<CliShot flow="apps-list" step="apps" alt="wendy device apps list showing the hello-world app in the Running state" />

<Callout type="info">
  **Expected State**: The app shows as "Running" because it's a long-running HTTP server that stays up to serve requests. The "Failures" column showing `0` confirms it started cleanly. The generated `postStart` hook opens your browser to `http://<device>:5001`, where the root route returns `{"message":"hello-world"}`.
</Callout>

<Accordions>
  <Accordion title="Testing the app on your own machine">
    There are times when you might not have a WendyOS device around. You can still test your application locally using Node.js or Docker.

    **Using Node.js directly**

    Install dependencies, build, and start the server:

    ```bash
    npm install
    npm run build
    npm start
    ```

    Or use the dev script with tsx for live-reload iteration:

    ```bash
    npm run dev
    ```

    Either way you should see:

    ```
    Server running on http://0.0.0.0:5001
    ```

    In another terminal, hit the root route:

    ```bash
    curl http://localhost:5001/
    # {"message":"hello-world"}
    ```

    **Using Docker locally**

    Build and run your application in a Docker container, mapping the port so you can reach it:

    ```bash
    docker build -t hello-world .
    docker run -p 5001:5001 hello-world
    ```
  </Accordion>
</Accordions>

## Next steps

- [Understand the generated web server](../../../../guides/tutorials/typescript/generated-server/) to see how the source, Dockerfile, and `wendy.json` work together.
- Build a [full-stack web app](../../../../guides/tutorials/typescript/web-app/) with a React frontend.
