Git Product home page Git Product logo

nextjs-graphcms-podcast-starter's Introduction

GraphCMS Podcast Demo

Minimalist podcast website built with GraphCMS, Next.js, Vercel, and Twillio Sendgrid.

Read more

The stack

Podcasts are a great way to get start an indie movement, build a loyal user base or simply get your message out. But many times, the "off the shelf" solutions are slightly overly simplistic, are difficult to customize or suffer from being drowned out on centralized platforms. Using a headless CMS, you can create a completely unique experience, tailored to your exact needs.

  • GraphCMS: Manages the shows, subscribers and newsletters.
  • Next.js: Acts as a powerful framework that lets us query for live data and use serverless functions in Now.
  • Vercel: A static host that also supports Lambda functions where we handle our subscriptions, unsubscribes and new RSS generation.
  • Sendgrid: Sending notification emails for confirmation.

How it works

  1. GraphCMS will house our entire content architecture. We will discuss the architecture in further detail at the connected blog post. The rough structure (though not hierarchial) looks like this: Episodes -> (Sponsors | Audio | Hosts | Guests) | Subscribers | Feeds | Sponsors

  2. Next.js will power our application where we fetch content from GraphCMS (through a GraphQL proxy that authenticates our GraphCMS endpoint, hosted locally in a lambda function).

  3. The "Subscribe/Unsubscribe" function is handled server-side in a lambda, executed by now. This will sign a user up to be notified of new episodes.

  4. GraphCMS will kick off a Webhook on subscriber creation to another Now hosted endpoint that will send a confirmation email through Sendgrid to the subscriber.

  5. In the email to the subscriber, a link will be exposed where they can confirm their subscription, again through a function hosted in Now, for the "double opt-in" that's become an industry standard.

⚠️ You need to have an account and API keys for Sendgrid for this to work.

How to use

If you wish to extend and work with this example locally, follow the instructions below.

If you'd rather check out a demo or deploy to your own Now account, you can do that too.

First, you will need accounts at GraphCMS, Sendgrid and Now.

1. Download and install dependencies

git clone [email protected]:github.com/GraphCMS/nextjs-graphcms-podcast-starter.git
cd nextjs-graphcms-podcast-starter
yarn # npm install
cp .env.buld.sample .env.build
cp .env.sample .env

Install the Vercel-CLI

2. Create your project on GraphCMS

You will need to create a project from template inside GraphCMS to carefully match what is expected from GraphCMS.

You'll need an account with GraphCMS. It's recommended you use separate API keys for development and production.

3. Setup development environment variables

Env Vars Add the necessary variables to .env and .env.build files.

Deployment URLS Add your own domain for the production version of your application in the now.config.js file at line 17. ⚠️ You'll need to add your own domain for this step, and you will need to deploy to Vercel first to do that.

Secrets Vercel keeps a strict wall of separation between your project env an your lambda env - called a secret. You can read more about them and the philosophy of separation as well as how to add them here

You'll need to add the following secrets, which you should already have filled out in your envs.

demo-graphcms-podcast-token
demo-graphcms-podcast-mutation-token
demo-graphcms-podcast-endpoint
demo-graphcms-podcast-sendgrid-api-key
demo-graphcms-podcast-sender-address

4. Add Webhooks to your GraphCMS project

Webhooks Image

⚠️ You'll need to add your own domain before the api path, and you will need to deploy to Vercel first to do that.

5. Run locally

Once all dependencies and environment variables are satisfied, you can run Next.js locally to build in development, including the API endpoints with Vercel:

Vercel dev

nextjs-graphcms-podcast-starter's People

Contributors

motleydev avatar ronakganatra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nextjs-graphcms-podcast-starter's Issues

404 in README

You will need to create a project from template inside GraphCMS to carefully match what is expected from GraphCMS.

Seems that your docs are moving but this hasn't been updated to wherever it should point to.

Subscription doesn't work

Trying to make an account gives this error after clicking the "confirm" link in email:

{"status":500,"message":"No Node for the model People with value undefined for id found. (3039): {\"response\":{\"errors\":[{\"message\":\"No Node for the model People with value undefined for id found. (3039)\",\"locations\":[],\"path\":[\"updatePeople\"]}],\"data\":{\"updatePeople\":null},\"status\":200},\"request\":{\"query\":\"\\nmutation ConfirmSubscription($id:ID) {\\n    updatePeople(where:{\\n      id: $id\\n    }, data:{\\n      confirmed:true\\n    }) {\\n      id\\n      confirmed\\n      email\\n    }\\n  }\\n\",\"variables\":{\"id\":\"undefined\"}}}"}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.