RedwoodJS is an opinionated, full-stack, serverless web application framework for the Jamstack. It is designed to enable the dream of a Universal Deployment Machine.
There has recently been an influx of different projects aiming to build a Full Stack React framework. What are people talking about when they say Full Stack React and why is it suddenly such a hot topic?
The Jamstack is a departure from traditional server-rendered stacks like LAMP and MEAN. Jamstack applications serve static files from globally distributed CDN’s, removing the server and the database from the stack entirely and replacing them with APIs that provide dynamic functionality.
Serverless is a buzz word commonly used to refer to Function-as-a-Service cloud products like AWS Lambda. Instead of paying for a server to always be running and ready to accept requests, you pay based on the specific number of function calls your app invokes.
Install and create our first Redwood application
This series will start at the very beginning and assume no prior knowledge of Redwood. We’ll install the Redwood CLI and learn how to use Redwood’s custom generators to create pages.
Explore Redwood’s router and create links for our pages
Redwood has its own built-in router inspired by Ruby on Rails, React Router, and Reach Router. Redwood Router is designed to list all routes in a single file, without any nesting.
Get our database up and running and learn to create, retrieve, update, and destroy blog posts
Explain all the generated code for performing CRUD operations and set up our frontend to render a list of our blog posts by querying data from our backend
This part goes deep into the code that Redwood writes for you. How is Redwood handling form data? What is the CLI spitting out when we generate pages or cells? What is a GraphQL schema definition language? What does all this have to do with services? Finally we’ll generate a cell that queries our backend and renders all our blog posts to the front page of our site.
Combine everything we’ve learned up to this point to generate a contact page and take input from a user
We’ll explore further into Redwood forms and all the corresponding helpers that make our lives easier when working with forms. Redwood uses react-hook-form by default but it can also use other React form builders.
Connect our contact form to the database to persist data entered into the form
After creating our contact form we need to create a new contact schema and migrate our database. We’ll use another Redwood generator to create our schema definition language and our GraphQL resolvers for our services.
Deploy our frontend to Netlify and our backend to Heroku
A website isn’t very useful unless it’s on the web. In this part we’ll deploy our React frontend to Netlify with their Serverless functions. Netlify will give us a free domain that we can share with the world. For our backend we’ll use Heroku to host our database with Postgres.
Implement role-based authentication with Netlify Identity
In the final part of our series we’ll use Netlify Identity to implement role-based authentication on our blog. We’ll use one more Redwood generator for authentication. We’ll be able to use Netlify’s login functionality so we don’t have to make our own login form.
Here’s a slightly more detailed outline for the tutorial that’s currently a work in progress. I don’t want to make things too complicated with the nesting, but I’ll likely end up going one more level deep and grouping some of these sections into sub-sections:
Part 1 - Setup
yarn create redwood-app
yarn redwood dev
redwood generate page
Part 2 - Routes
redwood generate layout
Part 3 - Prisma
redwood db save
redwood db up
redwood generate scaffold
Part 4 - CRUD
redwood generate cell
Part 5 - Contact
redwood generate page contact
Part 6 - GraphQL
redwood generate sdl
Part 7 - Deploy
7.1 - GitHub Repo
7.2 - Netlify
7.3 - Heroku
7.4 - Config/Environment Variables
Part 8 - Auth
8.1 - Netlify Identity
redwood generate auth