All Projects → contentful → The Example App.nodejs

contentful / The Example App.nodejs

Licence: mit
Example app for Contentful in node.js

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to The Example App.nodejs

Node Express Mongoose Demo
A simple demo app using node and mongodb for beginners
Stars: ✭ 4,976 (+1683.51%)
Mutual labels:  heroku, express
Cmms
Computerized Maintenance Management System
Stars: ✭ 31 (-88.89%)
Mutual labels:  heroku, express
Express Babel
Express starter kit with ES2017+ support, testing, linting, and code coverage
Stars: ✭ 621 (+122.58%)
Mutual labels:  heroku, express
Express Starter
🚚 A boilerplate for Node.js, Express, Mongoose, Heroku, Atlas, Nodemon, PM2, and Babel. REST / GraphQL API Server | PaaS | SaaS | CI/CD | Jest | Supertest | Docker | MongoDB | PostgreSQL | Sequelize | Lodash | RxJS | JWT | Passport | WebSocket | Redis | CircleCI | Apollo | DevSecOps | Microservices | Backend Starter Kit | ES6
Stars: ✭ 353 (+26.52%)
Mutual labels:  heroku, express
Reactly Starter Kit
Deployable React + Webpack 2 starter kit
Stars: ✭ 122 (-56.27%)
Mutual labels:  heroku, express
Webpack2 Express Heroku Starter
Starter app using Webpack 2, Express, setup to deploy to Heroku.
Stars: ✭ 12 (-95.7%)
Mutual labels:  heroku, express
Node Js Getting Started
Getting Started with Node on Heroku
Stars: ✭ 872 (+212.54%)
Mutual labels:  heroku, express
Push Starter
React Redux Starter with SSR 🤖
Stars: ✭ 43 (-84.59%)
Mutual labels:  heroku, express
Ecommerce Nodejs
Ecommerce application back-end codes
Stars: ✭ 97 (-65.23%)
Mutual labels:  heroku, express
Gitwar
🚀 Gitwar - Compete with Github
Stars: ✭ 44 (-84.23%)
Mutual labels:  heroku, express
Express Webpack React Redux Typescript Boilerplate
🎉 A full-stack boilerplate that using express with webpack, react and typescirpt!
Stars: ✭ 156 (-44.09%)
Mutual labels:  heroku, express
Bandwidth Hero Proxy
⚡️ Proxy that compresses images to low-resolution
Stars: ✭ 130 (-53.41%)
Mutual labels:  heroku, express
Giraffql
Interactive GraphQL exploration tool built with React - still working on the website
Stars: ✭ 176 (-36.92%)
Mutual labels:  heroku, express
Spotify Profile
A web app for visualizing personalized Spotify data built with React, Express, and the Spotify API
Stars: ✭ 254 (-8.96%)
Mutual labels:  express
Line Bot Tutorial
line-bot-tutorial use python flask
Stars: ✭ 267 (-4.3%)
Mutual labels:  heroku
Nextjs Redux Starter
Next.js + Redux + styled-components + Express = 😇
Stars: ✭ 257 (-7.89%)
Mutual labels:  express
Kamifaka
一款基于VUE3.0的开源免费的卡密发卡系统,高效、稳定可靠。
Stars: ✭ 253 (-9.32%)
Mutual labels:  heroku
Home Cloud
The "cloud" at home
Stars: ✭ 269 (-3.58%)
Mutual labels:  express
Create React App Buildpack
⚛️ Heroku Buildpack for create-react-app: static hosting for React.js web apps
Stars: ✭ 3,161 (+1032.97%)
Mutual labels:  heroku
Heroku Buildpack R
Heroku buildpack for R - Makes deploying R on Heroku easy
Stars: ✭ 258 (-7.53%)
Mutual labels:  heroku

The node.js example app

CircleCI

The node.js example app teaches the very basics of how to work with Contentful:

  • consume content from the Contentful Delivery and Preview APIs
  • model content
  • edit content through the Contentful web app

The app demonstrates how decoupling content from its presentation enables greater flexibility and facilitates shipping higher quality software more quickly.

Screenshot of the example app

You can see a hosted version of The node.js example app on Heroku.

What is Contentful?

Contentful provides a content infrastructure for digital teams to power content in websites, apps, and devices. Unlike a CMS, Contentful was built to integrate with the modern software stack. It offers a central hub for structured content, powerful management and delivery APIs, and a customizable web app that enable developers and content creators to ship digital products faster.

Requirements

  • Node 8
  • Git
  • Contentful CLI (only for write access)

Without any changes, this app is connected to a Contentful space with read-only access. To experience the full end-to-end Contentful experience, you need to connect the app to a Contentful space with read and write access. This enables you to see how content editing in the Contentful web app works and how content changes propagate to this app.

Common setup

Clone the repo and install the dependencies.

git clone https://github.com/contentful/the-example-app.nodejs.git
cd the-example-app.nodejs
npm install

Steps for read-only access

To start the express server, run the following

npm run start:dev

Open http://localhost:3000 and take a look around.

Steps for read and write access (recommended)

Step 1: Install the Contentful CLI

Step 2: Login to Contentful through the CLI. It will help you to create a free account if you don't have one already.

contentful login

Step 3: Create a new space

contentful space create --name 'My space for the example app'

Step 4: Seed the new space with the example content model the-example-app. Replace the SPACE_ID with the id returned from the create command executed in step 3

contentful space seed -s '<SPACE_ID>' -t the-example-app

Step 5: Head to the Contentful web app's API section and grab SPACE_ID, DELIVERY_ACCESS_TOKEN, PREVIEW_ACCESS_TOKEN.

Step 6: Open variables.env and inject your credentials so it looks like this

NODE_ENV=development
CONTENTFUL_SPACE_ID=<SPACE_ID>
CONTENTFUL_DELIVERY_TOKEN=<DELIVERY_ACCESS_TOKEN>
CONTENTFUL_PREVIEW_TOKEN=<PREVIEW_ACCESS_TOKEN>
PORT=3000

Step 7: To start the express server, run the following

npm run start:dev

Final Step:

Open http://localhost:3000?editorial_features=enabled and take a look around. This URL flag adds an “Edit” button in the app on every editable piece of content which will take you back to Contentful web app where you can make changes. It also adds “Draft” and “Pending Changes” status indicators to all content if relevant.

Deploy to Heroku

You can also deploy this app to Heroku:

Deploy

Use Docker

You can also run this app as a Docker container:

Step 1: Clone the repo

git clone https://github.com/contentful/the-example-app.nodejs.git

Step 2: Build the Docker image

docker build -t the-example-app.nodejs .

Step 3: Run the Docker container locally:

docker run -p 3000:3000 -d the-example-app.nodejs

If you created your own Contentful space, you can use it by overriding the following environment variables:

docker run -p 3000:3000 \
  -e CONTENTFUL_SPACE_ID=<SPACE_ID> \
  -e CONTENTFUL_DELIVERY_TOKEN=<DELIVERY_ACCESS_TOKEN> \
  -e CONTENTFUL_PREVIEW_TOKEN=<PREVIEW_ACCESS_TOKEN> \
  -d the-example-app.nodejs
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].