# Kinds of projects

BitHut runs three kinds of projects, and each runs in its own way. This page explains the difference, how BitHut works out the kind, and how to set it when it cannot.

## The three kinds

| Kind | In the cabinet | How it runs | Examples |
|---|---|---|---|
| Site | Site | Answers requests at its address, with HTTPS | A landing page, a dashboard, a form, an API, a webhook |
| Background process | Always on | Runs all the time and has no address | A Telegram or Discord bot, a queue worker |
| Scheduled script | On a schedule | Starts at set times, does its job and stops | A morning report, a price check every hour |

For your AI, the same kinds are called `web`, `worker` and `cron`.

## Sites

A site gets an address like `my-site-anna.up.bithut.app`. BitHut sends visitors to the port in the `PORT` variable, so the code should listen on `0.0.0.0` and that port. A new site opens only with a password until you decide who can open it. See [Sites and domains](/docs/sites).

## Background processes

A background process starts once and keeps running. If it stops, it is not working. Before a new version starts, the old copy stops first, so two copies of a bot never run at the same time.

## Scheduled scripts

A scheduled script runs, finishes and exits. It needs a schedule, written as a cron expression in **UTC** time. For example, `0 9 * * *` means every day at 09:00 UTC. Your AI writes the schedule for you when it deploys; tell it the times in your own words. The schedule shows on the project's Overview, under Details.

A script that never exits is a problem here: BitHut starts it again at every time of the schedule.

## How BitHut works out the kind

Before the build, BitHut reads the code:

1. If the code answers web requests (a web framework, a server that listens on a port, or an `index.html` at the top of the folder), it is a site.
2. If it runs all the time without an address (for example a bot that polls Telegram), it is a background process.
3. Other code is treated as a scheduled script, which then needs a schedule.

When the code gives no clear sign, the deploy stops with a finding that says so, and your AI sends the kind on the next try. When the code looks like a different kind than the one set, BitHut adds a warning.

## Setting the kind

You do not pick the kind in the cabinet. Your AI sets it: when it creates the project or with a deploy (`kind` and, for a scheduled script, `schedule`). If you want a different kind, tell your AI, for example "this should run every hour, not all the time".

A project made from a [template](/docs/templates) already has its kind.
