All Projects → cosmicjs → simple-react-blog

cosmicjs / simple-react-blog

Licence: other
A simple blog website powered by Next.js and the Cosmic GraphQL API

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects
shell
77523 projects

Projects that are alternatives of or similar to simple-react-blog

gatsby-starter
Install a Cosmic-powered Gatsby app in seconds 🔥
Stars: ✭ 15 (-84.85%)
Mutual labels:  cosmicjs
nuxt.js-website
Nuxt.js website example using Cosmic JS
Stars: ✭ 56 (-43.43%)
Mutual labels:  cosmicjs
vue-starter
Install a Cosmic-powered Vue.js app in seconds 🔥
Stars: ✭ 14 (-85.86%)
Mutual labels:  cosmicjs
ecommerce-app
An Angular JS Ecommerce App Powered by Cosmic JS
Stars: ✭ 47 (-52.53%)
Mutual labels:  cosmicjs
facebook-bot
A Facebook Bot Reminder App
Stars: ✭ 36 (-63.64%)
Mutual labels:  cosmicjs
vue-blog-netlify-template
A Vue.js blog powered by Cosmic. Deploy to Netlify in one click.
Stars: ✭ 34 (-65.66%)
Mutual labels:  cosmicjs
vue-garage-sale
PWA application for online sell/buy marketplace using Vue.js and Cosmic JS
Stars: ✭ 26 (-73.74%)
Mutual labels:  cosmicjs

Simple React Blog

Simple React Blog

View Demo

React + Next.js + Cosmic GraphQL

This blog uses Next.js to create a React blog. It connects to the Cosmic API via GraphQL. Manage your content from your Cosmic Bucket Dashboard. Simple.

Getting Started

  1. Log in to Cosmic and install the Simple React Blog template.
  2. Run the following commands to install the code locally.
git clone https://github.com/cosmicjs/simple-react-blog
cd simple-react-blog

Environment Variables

  1. Create an .env.local file to gain API access to your Cosmic Bucket. To do this, run:
cp .env.example .env.local
  1. Find your API access keys at Bucket Settings > API Access and add them to the .env.local file. It should look something like this:
NEXT_PUBLIC_COSMIC_BUCKET_SLUG=your-bucket-slug
NEXT_PUBLIC_COSMIC_READ_KEY=your-bucket-read-key

Run in development

Install all dependencies and run in development mode.

yarn
yarn dev

Open http://localhost:3000.

Deploy to Vercel

Use the following button to deploy to Vercel. You will need to add API accesss keys as environment variables. Find these in Bucket Settings > API Access.

Revision Preview

Follow these steps to add revision preview to your Bucket:

  1. Log in to Cosmic.
  2. Go to Your Bucket > Posts > Object Type Settings.
  3. Scroll down to the Preview Link section and add the following link:
http://localhost:3000/posts/[object_slug]?revision=[revision_id]
  1. For production, replace http://localhost:3000 with your URL. Now when you "Save as Draft" on any Post, you can preview your changes by clicking the "Preview" link.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].