Stop drowning in unnecessary meetings. Work on only what matters. Get Started.

Redwood.js Setup/Command Cheatsheet

Redwood.js Setup/Command Cheatsheet

Heya!

If you're reading this like at the start of the week (like I'm writing now), I hope you have an amazing week!

I recently started using Redwood.js, an opinionated JAMstack framework bringing fullstack to the JAMstack. With Redwood, you have the web (front-end) and API(backend) portions of your project in a mono-repo. Redwood comes with all the flavors of the JAMstack in one project.

Redwood is amazing and it's 'opinion' of how Jamstack software should be built is great so far. I'll create a follow-up post once I'm done with the side-project, scratch that, once I'm done with my review of Redwood. We know side-projects never make it out of side-project paradise.

In this post, I'll be sharing a cheatsheet of useful commands I've encountered during development and deployment. If you want a quick cheatsheet look, this is for you, and me. You can look in the docs for the full set of CLI commands.

Redwood commands take the form of

yarn redwood <command> 

The commands are shortened to

yarn rw <command>

Create a redwood app

yarn create redwood-app <app-name>

Run a development server

yarn rw dev

Create a production build

yarn rw build [folder..]

folder can either be the web or api portion of the project and the full command looks like:

yarn rw build web

Running the command without folder will build both projects in the mono-repo.

Generators

Generators are useful in creating boilerplate code to quickly scaffold a project or feature in the project.

Generate a page

yarn rw generate page <page-name>

This generator command is further shortened to

yarn rw g page <page-name>

Generate a cell

yarn rw g cell <cell-name>

Generate a scaffold

Scaffolds are simply beautiful and create boilerplate code to handle UI presentation, manage and store data in your database.

yarn rw g scaffold <scaffold-name>

Generate a component

yarn rw g component <component-name>

Generate a layout

Layouts are used to create consistent user interfaces on multiple pages.

yarn rw g layout <layout-name>

Generate SDL

This generates a graphQL schema file for your database.

yarn rw g sdl <sdl-name>

Generate deployment config

This generates deployment configuration files in the root directory of the project. For Netlify we have:

yarn rw g deploy netlify

Generate authentication config

This applies to multiple authentication providers, for Netlify we have:

yarn rw g auth netlify

Database commands

Create migration record

yarn rw db save create <migration name>

Update Database schema

yarn rw db up

See CLI options

yarn rw --help

I use these commands frequently, while I keep them in mind, you could peek in this cheatsheet if you need any of them quickly.

Regard,

William.


About the author

I love solving problems, which has led me from core engineering to developer advocacy and product management. This is me sharing everything I know.

Related Blogs

Practical Steps to Deploy a Node.js App with NGINX and SSL
Emeni Deborah

Emeni Deborah

Tue Sep 06 2022

Practical Steps to Deploy a Node.js App with NGINX and SSL

Read Blog

icon
Create a Crowdfunding Smart Contract using Solidity
Scofield Idehen

Scofield Idehen

Mon May 23 2022

Create a Crowdfunding Smart Contract using Solidity

Read Blog

icon
Deploy and Host an Appwrite Docker Application
Divine Odazie

Divine Odazie

Sat Apr 23 2022

Deploy and Host an Appwrite Docker Application

Read Blog

icon
image
image
icon

Join Our Technical Writing Community

Do you have an interest in technical writing?

image
image
icon

Have any feedback or questions?

We’d love to hear from you.

Building a great product is tough enough, let's handle your content.

Building a great product is tough enough, let's handle your content.

Create 5x faster, engage your audience, & never struggle with the blank page.