HomeDocsBlogGithub
Docs/Guides/Getting started

Getting started

Welcome to the Twofold documentation! This guide will help you setup your first application.

What's Twofold?

Twofold is a framework for building RSC applications. Every Twofold app comes with:

  • An RSC Router built on top of React's Suspense and Transition APIs.
  • Bundling and splitting support for Server Components and Client Components.
  • Secure Server Functions that automatically handle encryption and decryption of sensitive data.
  • Automatic configuration and setup for React Compiler, Tailwind, TypeScript, Prettier, HMR, and linting rules.

Before continuing it's recommended you read Don't use Twofold.

Prerequisites

You'll need to have Node.js (>=22.12.0) and PNPM (>=9.0.0) installed on your machine.

Installation

Run the following command to create a new Twofold application:

pnpm create twofold-app@latest

You'll be prompted to enter a name for your application.

For this guide we'll use the name: my-app.

pnpm create twofold-app@latest

  info      Welcome to the Twofold app generator!

  What is the name of your app?  my-app

  pending   Setting up a new Twofold app...
  complete  App created!
  pending   Installing dependencies. This may take a minute...
  complete  Dependencies installed!
  pending   Initializing git repository...
  complete  Git repository created!

  success   All set!

  info      App installed at: ./my-app/
  info      Run app: cd my-app && pnpm dev

Once the installer finishes it will create a new directory with the name of your application.

Move into the new directory:

cd my-app

And start the development server:

pnpm dev

That's it! Visit http://localhost:3000 to see your new application up and running!