Getting Started with Redwood for Beginners
Published:
Video Link: Getting Started with Redwood for Beginners
Anthony Campolo introduces Kelvin Omereshone to RedwoodJS, a full-stack JavaScript framework that simplifies app development by providing integrated tools and conventions.
Episode Summary
In this episode, Anthony Campolo guides Kelvin Omereshone through an introduction to RedwoodJS, a full-stack JavaScript framework. They explore Redwood’s key features, including its CLI for generating project components, built-in routing system, and integration with Prisma ORM for database management. Anthony demonstrates how to create pages, set up database models, and use Redwood’s unique “cell” concept for data fetching. They discuss Redwood’s built-in testing capabilities with Jest and React Testing Library, as well as its Storybook integration for component development. The episode covers deploying a Redwood application to Vercel and touches on topics like authentication options and the framework’s community. Throughout, Anthony emphasizes Redwood’s focus on developer experience and its goal of simplifying full-stack JavaScript development by providing conventions and integrated tools.
Chapters
00:00 - Introduction to RedwoodJS
Anthony introduces himself and provides background on RedwoodJS, explaining its origins and his involvement with the framework. He highlights Redwood’s goal of being a full-stack JavaScript framework for startups and production workloads. Anthony discusses how Redwood simplifies the process of building full-stack applications by providing integrated tools and conventions, addressing common pain points in JavaScript development. He also touches on the framework’s relationship with GraphQL and how it aims to make GraphQL development more accessible.
02:56 - Project Setup and File Structure
Anthony guides Kelvin through setting up a new Redwood project and explains its file structure. He demonstrates how to use Redwood’s CLI to generate pages and components, showcasing the framework’s convention-over-configuration approach. Anthony explains the concept of “sides” in Redwood, with separate web and API directories, and shows how to create and link pages using Redwood’s routing system. He highlights how Redwood’s conventions provide guardrails for developers, making it easier to organize and maintain projects as they grow.
10:41 - Database Setup and ORM Integration
This chapter focuses on setting up a database and integrating it with the Redwood application. Anthony introduces Prisma, the ORM used by Redwood, and explains its benefits. He demonstrates how to define a database schema using Prisma’s schema language and shows how Redwood’s CLI can generate migrations. Anthony also covers the process of connecting to a PostgreSQL database using Railway, a backend-as-a-service platform. He explains how Prisma abstracts away database differences, allowing developers to switch between different SQL flavors easily.
24:00 - Scaffolding and CRUD Operations
Anthony demonstrates Redwood’s scaffolding capabilities, showing how to quickly generate a full CRUD (Create, Read, Update, Delete) interface for the blog post model they created earlier. He explains the concept of “cells” in Redwood, which encapsulate data fetching logic and provide a declarative way to handle loading, empty, and error states. Anthony walks through the generated code, explaining how it integrates with GraphQL and Prisma to provide a complete data management solution out of the box.
32:28 - Testing and Storybook Integration
This chapter covers Redwood’s built-in testing capabilities and integration with Storybook for component development. Anthony explains how Redwood automatically generates test files for pages and cells, using Jest and React Testing Library under the hood. He demonstrates how to run tests and explains the importance of having a separate test database. Anthony then introduces Storybook integration, showing how Redwood automatically generates story files for components and cells, making it easier to develop and test UI components in isolation.
46:54 - Deployment and Community Resources
In the final chapter, Anthony walks through the process of deploying a Redwood application to Vercel. He discusses the various deployment options available for Redwood apps and demonstrates how to set up environment variables for the database connection. Despite encountering some initial issues, Anthony successfully deploys the application. He then provides an overview of Redwood’s community resources, including the Discord server, forum, and monthly town halls. Anthony also mentions the Redwood Startup Fund and highlights some real-world applications built with Redwood, encouraging viewers to explore and engage with the Redwood community.