Skip to main content

Getting Started

Overview

Welcome to the Farrow documentation!

Farrow(Functional and arrow, pronounced /ˈferō/) is a Type-Friendly Web Framework for Node.js. It consists of three major parts:

  • Type-Friendly HTTP Server.
  • Type-Friendly and End-to-end code generational RPC Server.
  • Full stack famework for a web project.

If you have questions about anything related to Farrow, you're always welcome to ask our community on GitHub Discussions.

System Requirements

  • Node.js 14.18.1 or later
  • TypeScript 4.3.0 or higher(Can be installed with scaffolding if farrow is not introduced in an existing project)
  • MacOS, Windows (including WSL), and Linux are supported

Setup

Init project by creating a empty Node.js project.

mkdir farrow-project
cd ./farrow-project
yarn init -y

Install Farrow libraries

yarn add farrow-http

Create src/index.ts as entry and add the following content

src/index.ts
import { Http, Response } from "farrow-http";

const http = Http();

http.use(() => {
return Response.text("Hello Farrow");
});

http.listen(3000, () => {
console.log("server started at http://localhost:3000");
});

Install development tools

yarn add -D farrow typescript

Add scripts in package.json

package.json
{
"scripts": {
"dev": "farrow dev",
"build": "farrow build",
"start": "farrow start"
}
}

Start server with:

yarn run dev

Open your browser and navigate to http://localhost:3000/.

Setup with Template

We also recommend creating a new Farrow app using create-farrow-app, which sets up everything automatically for you. To create a project, run:

yarn create farrow-app farrow-project

Select a template.

? Select a template:
❯ farrow-only
farrow-vite-react
farrow-next-react

After the initialization is complete, follow the instructions to start the development server.

cd farrow-project
yarn
yarn dev

Open Farrow Playground and connect to http://localhost:3000/api/todo.

info

For more information on how to use create-farrow-app, you can review the create-farrow-app documentation.