cho.sh
Redwood.js

Redwood.js

Warning

Over a year old. May be outdated

RedwoodJS is a full-stack, open-source JavaScript framework for web apps. Tom Preston-Werner, a GitHub co-founder, launched it in 2020. Redwood glues together a set of well-known tools.

  • The front-end is React.
  • The back-end is GraphQL, a query language for APIs that lets you ask for exactly the data you need and combine responses from multiple sources.
  • is the ORM for the database layer, for fast and safe database access.
  • React Router. Redwood's router is declarative, built on the idea of "routes as a first-class concept."
  • TypeScript
  • Jest
  • Storybook

At a high level, RedwoodJS has two parts.

  1. The Back-End. This is a GraphQL API built with Prisma and Apollo () Server. Prisma is used for database access, and Apollo Server is used to create the GraphQL server.
  2. The Front-End. This is a React application that's built with several libraries like Apollo Client (for fetching data from the GraphQL API), React Router (for routing), and Jest (for testing).

Some Discoveries

While I prefer PNPM over Yarn, due to the workspace support, I like to use Yarn for this.

Getting Started

text
yarn create redwood-app --ts ./redwoodblog
text
yarn redwood dev
text
yarn redwood generate page home /
text
yarn redwood generate page about

Generating Layouts

text
yarn redwood g layout blog

Using Prisma

Opening Prisma Studio

text
yarn rw prisma studio

Scaffolding Prisma Simple CRUD

text
yarn rw g scaffold post

Components

text
yarn rw g cell Articles

When having type errors

text
yarn rw g types

Setting up Auth

text
rw setup auth supabase
text
The table `...` does not exist in the current database.

You need to yarn rw prisma migrate dev

Set up Storybook

text
yarn rw storybook

Set up Jest

text
yarn rw test
Backlinks7