Installation

Harpia is designed to be flexible. You can either integrate the core library into an existing project or scaffold a complete, production-ready application using our CLI.

Bun Required

Harpia is built for the Bun runtime. Ensure you have Bun v1.2+ installed.

Choose your path

Depending on your project needs, you can start with just the essentials or the full powerhouse.

Core

Best for minimalists or adding Harpia to an existing Bun project.

bun add @harpiats/core

App

Best for new projects that need Auth, Database, and a solid structure.

bun create harpia-app my-api

CLI Flags

The create-harpia-app command supports flags for fully non-interactive setup — useful for CI pipelines and scripts.

Application Mode

FlagShorthandDescription
--api-aScaffold an API-only project
--fullstack-fScaffold a Fullstack project

Database

FlagShorthandDescription
--postgresql / --postgres-pUse PostgreSQL
--mysql-mUse MySQL / MariaDB
--sqlite-sUse SQLite (via LibSQL)

Fullstack Options

These flags are only applied when --fullstack is used.

FlagShorthandDescription
--tailwind-tInclude Tailwind CSS
--alpine-lInclude Alpine.js
--htmx-hInclude HTMX

Non-Interactive Example

# Scaffold an API project with SQLite in one shot
bun create harpia-app my-project --api --sqlite

# Scaffold a Fullstack project with PostgreSQL, Tailwind and HTMX
bun create harpia-app my-app --fullstack --postgresql --tailwind --htmx

Manual Setup (Core)

If you chose the Core path, you’ll need to initialize your server manually. Harpia Core is lightweight and gives you full control over the entry point.

Start the server

Create an index.ts file and add the following code to spin up your first Harpia instance:

import harpia from "@harpiats/core";

const app = harpia();

app.listen(
  {
    port: 3000,
    development: true,
    reusePort: true,
    hostname: "localhost",
  },
  () => console.log("Server is running at http://localhost:3000/"),
);