papadopan / nextjs-contentful-app

An example of creating blog application using NextJS and Contentful API

Home Page:https://nextjs-contentful-app.martindavid.now.sh

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Blog application with NextJS and Contentful

This is a codebase for blog application that I build using NextJS with Contentful API

Live Demo: https://nextjs-contentful-app.martindavid.now.sh

Getting Started

Clone this repo to your machine

$ git clone git@github.com:martindavid/nextjs-contentful-app.git nextjs-app

Run Without Docker

Install dependencies

$ yarn install

Run it locally from http://localhost:3000:

$ CONTENTFUL_SPACE_ID=<space_id> CONTENTFUL_ACCESS_TOKEN=<access_token> yarn run dev

Deployment

Deploy it to the cloud with now (download)

$ now -e CONTENTFUL_SPACE_ID=<space_id> -e CONTENTFUL_ACCESS_TOKEN=<access_token>

Run With Docker

Build it with docker:

# build
$ docker build -t nextjs-app .

# or, use multi-stage builds to build a smaller docker image (for deployment to production)
$ docker build -t nextjs-app -f ./Dockerfile.multistage .

Run it locally from http://localhost:3000:

$ docker run --rm -it \
    -p 3000:3000 \
    -e "CONTENTFUL_SPACE_ID=<contentful_space_id>" \
    -e "CONTENTFUL_ACCESS_TOKEN=<contentful_access_token>" \
  next-app

Deployment

Deploy it to the cloud with now (download)

# Deploy with docker image
$ now --docker -e CONTENTFUL_SPACE_ID=<contentful_space_id> -e CONTENTFUL_ACCESS_TOKEN=<contentful_access_token>

About

An example of creating blog application using NextJS and Contentful API

https://nextjs-contentful-app.martindavid.now.sh


Languages

Language:TypeScript 76.3%Language:CSS 20.6%Language:JavaScript 2.5%Language:Dockerfile 0.6%