• This repository has been archived on 04/Apr/2022
  • Stars
    star
    103
  • Rank 333,046 (Top 7 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 5 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Example Blog app written with Redwood

RedwoodJS Example Blog [Pre 1.0 Release]

⚠️ This is an original example project created for the release of Redwood v0.1. It's in need of some TLC via a re-write. Until that time, we recommend checking out our other example projects.

RedwoodJS Example Blog Screenshot

You can view this app live at:

Note: The Authentication section of this walkthrough uses Netlify Identity, which will only work on Netlify. If you wish to use Vercel, you can simply replace the Netlify Identity provider with another provider supported by Redwood Auth. Or you can start the project from the vercel-deploy branch of this repository.

Table of Contents

Overview

Here is a full-featured blog engine written with RedwoodJS. It includes:

  • Listing all blog posts with first paragraph summaries and pagination (the homepage)
  • Reading a single, full blog post
  • Searching for blog posts by keyword
  • Displaying all posts with a given tag
  • Contact form
  • Fully responsive at various viewport sizes

The admin includes:

  • User authentication
  • Create a new blog post with:
    • Title
    • Slug (URL)
    • Author
    • Body
    • Tags
    • Splash image
  • Edit existing blog post
  • Delete a blog post
  • Mark a new post as a Draft and not display it live
  • Publish a post live
  • Unpublish a post (puts it back to DRAFT status)

On the tech side:

Getting Started

Installation

Clone the repo:

git clone https://github.com/redwoodjs/example-blog.git
cd example-blog

Install dependencies:

yarn install

Create a local SQLite database and seed it with a few blog posts:

yarn redwood prisma migrate dev
yarn redwood prisma db seed

Now you should be able to start a development server:

yarn redwood dev

Assuming everything worked, open a browser to http://localhost:8910 and you should be seeing the homepage (similar to the screenshot above).

Deployment

See the section on Deployment in the Redwood Tutorial.

Enabling Authentication

We're working on supporting the netlify dev command properly with Redwood, which is required to use Netlify Identity in a local dev environment. The following instructions will not work until this fix is complete.

Copy the .env.defaults file to a new file .env and edit it, setting the USE_AUTHENTICATION variable to true.

Enabling Identity on Netlify

You'll need to create a new site on Netlify so that you can enable Identity and give the Identity API Endpoint to your development instance of the blog.

If you don't have it already, install the Netlify CLI tools:

yarn global add netlify-cli

Log in with your Netlify credentials:

netlify login

Create a new site:

netlify init --manual

Now you have two paths:

  1. Find and link to the existing site you have deployed
  2. Choose Create & configure a new site, choose which team to associate this new site with (if you have more than one). You can enter a Site name or just hit ENTER to get a random one. You can enter n when asked if you want to continue.

Go to netlify.com and find your site. Click on the Identity link and the Enable Identity button:

Netlify Screenshot

Now copy and paste the API endpoint URL that's displayed once the screen refreshes:

Netlify Identity URL

Back to your local development machine, head to http://localhost:8910/admin and you'll be prompted with the login popup. Enter the URL that you just copied and click Set site's URL:

The popup should refresh and now you'll see a login box. But, we don't have any users yet. Back over to Netlify, click the Invite users button and send yourself an invite:

image

You'll get an email with a link to accept the invite. However, this link won't work: it's trying to go to the Netlify URL, which doesn't have a site on it yet. So after clicking the link and getting an error, change the URL to be http://localhost:8910 but make sure to keep the invite token at the end. For example, if you are sent to

https://nostalgic-dijkstra-23eaba.netlify.com/#invite_token=8-TFgNesyzhIn8LnXv3

Rewrite that URL to:

http://localhost:8910/#invite_token=8-TFgNesyzhIn8LnXv3

You should see the login popup with a password input to complete your account. Fill it in and submit and now you should get a message saying you are logged in. Head back to the admin http://localhost:8910/admin and you should have access (finally!)

Enabling Image Uploads

The blog uses an external service, Filestack to handle image uploads. If you want to be able to upload images in local development you'll need to create a free account at Filestack and copy the API key. You get 100 uploads per month on their free account which should be plenty to test with.

Once you have logged into Filestack copy the API key shown at the top right of the dashboard:

Filestack screenshot

If you haven't already, copy the .env.example file in the root of the blog to a new file named .env. Edit the FILESTACK_API_KEY variable to be equal to the one you just copied. Save .env and restart your yarn dev process. Now when creating a new blog post http://localhost:8910/admin/new you should see a filepicker towards the bottom of the form:

New post screenshot

TODO

  • Remove file picker if ENV var not set, with instructions for enabling
  • Add instructions for enabling Authentication
  • In public view don't include posts in Draft state

More Repositories

1

redwood

The App Framework for Startups
TypeScript
17,239
star
2

awesome-redwood

A community-driven collection of Redwood related plugins, config, themes, build scripts, tutorials, podcasts, and more.
219
star
3

redwoodjs-com-archive

Public website for RedwoodJS
HTML
129
star
4

example-todo

Example Todo app written with Redwood
JavaScript
95
star
5

example-invoice

Example Invoice app written with Redwood
JavaScript
59
star
6

learn.redwoodjs.com

Multilingual docs site for learning RedwoodJS
JavaScript
55
star
7

example-store-stripe

Redwood Example Store with Stripe Checkout Integration
JavaScript
41
star
8

redwood-tutorial

The end state after completing the RedwoodJS introduction tutorial
JavaScript
40
star
9

create-redwood-app

ARCHIVED: template codebase has been moved to redwoodjs/redwood/tree/main/packages/create-redwood-app/template
JavaScript
36
star
10

playground-auth

This repo demonstrates all the authentication providers that Redwood supports
HTML
34
star
11

docker

Repository to consolidate efforts on making sweet Docker implementations for RedwoodJS
Dockerfile
31
star
12

repeaterdev-js

Official Javascript library for Repeater.dev
JavaScript
29
star
13

redwoodjs.com

redwoodjs.com redesign for 1.0
TypeScript
21
star
14

example-storybook

Example application written using Redwood that leverages Redwood's Storybook integration to highlight Redwood's rich feature set. This includes features such as Layout, and Cells.
JavaScript
16
star
15

netlify-plugin-prisma-provider

netlify-plugin-prisma-provider
JavaScript
15
star
16

redwood-office-hours

Examples and demos for the Redwood Office Hour sessions held in our Discord community channel
TypeScript
12
star
17

cookbook-third-party-apis

Codebase for the Third Party APIs cookbook example app
JavaScript
10
star
18

redwoodjs-supabase-quickstart

Supabase Quickstart example app with RedwoodJS
JavaScript
8
star
19

redwoodjs-tremor-dashboard-demo

Demo dashboard using RedwoodJS and tremor ui components
TypeScript
8
star
20

ticket-badge-app

A site for delivering virtual tickets for our partners
TypeScript
7
star
21

docwood

TypeScript
7
star
22

deploy-target-ci

Testing supported RedwoodJS deploy targets using canary packages
TypeScript
6
star
23

gitpod-starter

Create a new Redwood project using Gitpod
TypeScript
6
star
24

payments

WIP
JavaScript
6
star
25

project-ci-action

GitHub Action for RedwoodJS Project CI
5
star
26

example-neon

Integration with https://neon.tech Serverless Postgres
JavaScript
5
star
27

container-working-group

TypeScript
5
star
28

bighorn-website

New Website Design for RedwoodJS, Bighorn Epoch
TypeScript
5
star
29

rw-shad

Generate components in your RedwoodJS project
TypeScript
5
star
30

studio

Developer Studio for RedwoodJS.
TypeScript
5
star
31

example-planetscale

TypeScript
4
star
32

der-spielplatz

JavaScript
4
star
33

setup-rw-shad

Command for setting up rwgc in a RedwoodJS project
TypeScript
4
star
34

discordjs-discourse-bot

Discord to Discourse Bot
JavaScript
3
star
35

contributors-thank-you

Sending a Thank You to all the RedwoodJS Contributors who helped us reach 1.0.0
3
star
36

github-bot

RedwoodJS-bot has gotta bot
TypeScript
3
star
37

repeater-issues

Report issues and feature requests for repeater.dev
2
star
38

starter

Starter Repo for working with Browser IDEs, like GitPod
Dockerfile
2
star
39

fr.redwoodjs.com

French translation of redwoodjs.com
HTML
2
star
40

bello

Bello project is the network that helps the community to build RedwoodJS.
TypeScript
2
star
41

design-projects

workspace for design initiatives across Redwood projects
2
star
42

rw-cli

Go
2
star
43

showcase-2023-05

TypeScript
1
star
44

build-competition-app

README template for registering for the Build Competition - https://build.redwoodjs.com
1
star
45

thing

The (thing) RW Example App
TypeScript
1
star
46

redwood-challenges

Help RedwoodJS redesign some framework pages and have your work seen by millions!
TypeScript
1
star
47

build-competition

TypeScript
1
star
48

redwood-starter

Template installation codebase (JS) of Redwood v1.0.0-rc.3
JavaScript
1
star
49

release-tooling

Scripts used when triaging and releasing new RW versions
TypeScript
1
star
50

auth-supabase

RedwoodJS Supabase Auth Integration
TypeScript
1
star