Code Monkey home page Code Monkey logo

the-learning-demo's Introduction

Contentful Learning Demo(CRA-Version)

Installation prerequisites

We recommend installing this demo app in an empty space - it will create 15 content types during installation. Node.js 12.18.1 or greater is recommended.

TLD

Get the source code and install dependencies.

$ git clone https://github.com/contentful/The-Learning-Demo.git .
$ npm install

Run the installation script

$ npm run setup

Important! Give your API key access to the new demo environment

API key

Run in the project locally

$ npm run start

View the app in a browser

http://localhost:3000/

Content model

Content model simple

Content model full

the-learning-demo's People

Contributors

chigokawa avatar dependabot[bot] avatar cf-allstar[bot] avatar

Stargazers

Alexander avatar  avatar Kelati avatar Brandon Goldman avatar LilPimpn86 avatar Amelia Winger-Bearskin avatar ali_robot avatar Ted Slesinski avatar PamD avatar  avatar Tiago Costa avatar Brian Schwartz avatar Lukas avatar Marco Link avatar Paul Cookie avatar Paul G avatar  avatar

Watchers

Sascha Konietzke avatar James Cloos avatar Jay Bodenhausen avatar Amelia Winger-Bearskin avatar  avatar  avatar

the-learning-demo's Issues

'npm run setup' gives 403 error

Hello,

I am new to Contentful and trying out the course. As part of the course 'Create a Landing page', I am setting up the space in local. When I run 'npm run setup', I endup with 403 error as below:

_`my-home> ~/Documents/Contentful/tld (master=) $ npm run setup

[email protected] setup /home//Documents/Contentful/tld
node setup.js

To set up this project you need to provide your Space ID
and the belonging API access tokens.

You can find all the needed information in your Contentful space under:

app.contentful.com -> Space Settings -> API keys

The Content Management API Token
will be used to import and write data to your space.

The Content Delivery API Token
will be used to ship published production-ready content in your Gatsby app.

Ready? Let's do it! ๐ŸŽ‰

? Your Space ID
? Your Content Management API access token
? Your Content Delivery API access token
Writing config file...
Config file /home//Documents/Contentful/tld/src/components/config.js written
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ The following entities are going to be imported: โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Content Types โ”‚ 15 โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Editor Interfaces โ”‚ 15 โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Entries โ”‚ 42 โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Assets โ”‚ 33 โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Locales โ”‚ 2 โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Webhooks โ”‚ 0 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โœ” Validating content-file
โœ” Initialize client (1s)
โœ” Checking if destination space already has any content and retrieving it (3s)
โœ” Apply transformations to source data (1s)
โœ” Push content to destination space
โœ” Connecting to space (1s)
โœ” Importing Locales (2s)
โœ” Importing Content Types (3s)
โœ” Publishing Content Types (10s)
โœ” Importing Editor Interfaces (14s)
โœ” Importing Assets (38s)
โœ” Publishing Assets (21s)
โœ” Archiving Assets (1s)
โœ” Importing Content Entries (22s)
โœ” Publishing Content Entries (28s)
โœ” Archiving Entries (1s)
โœ” Creating Web Hooks (1s)
Finished importing all data
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Imported entities โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”ค
โ”‚ Locales โ”‚ 2 โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”ค
โ”‚ Content Types โ”‚ 14 โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”ค
โ”‚ Editor Interfaces โ”‚ 14 โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”ค
โ”‚ Assets โ”‚ 33 โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”ค
โ”‚ Published Assets โ”‚ 33 โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”ค
โ”‚ Archived Assets โ”‚ 0 โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”ค
โ”‚ Entries โ”‚ 39 โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”ค
โ”‚ Published Entries โ”‚ 38 โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”ค
โ”‚ Archived Entries โ”‚ 0 โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”ค
โ”‚ Webhooks โ”‚ 0 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”˜
The import took 2 minutes (135s)

The following 7 errors and 7 warnings occurred:

18:05:04 - AccessDenied: Status: 403 - Forbidden - Message: Forbidden - Request ID: c80cb58760a09aad21ba1f185c5948a5
18:05:72 - Rate limit error occurred. Waiting for 1533 ms before retrying...
18:05:73 - Rate limit error occurred. Waiting for 1678 ms before retrying...
18:05:74 - Rate limit error occurred. Waiting for 1664 ms before retrying...
18:06:48 - Rate limit error occurred. Waiting for 1566 ms before retrying...
18:06:48 - Rate limit error occurred. Waiting for 1540 ms before retrying...
18:06:48 - Rate limit error occurred. Waiting for 1645 ms before retrying...
18:06:48 - Rate limit error occurred. Waiting for 1543 ms before retrying...
18:07:35 - BadRequest: Status: 400 - Bad Request - Message: The content type you sent could not be found or was not activated. - Request ID: 426f78896ed4af540950d6cc48236da2
18:07:59 - BadRequest: Status: 400 - Bad Request - Message: The content type you sent could not be found or was not activated. - Request ID: df713559f000ab0ccdfa55c1c10c0561
18:07:21 - BadRequest: Status: 400 - Bad Request - Message: The content type you sent could not be found or was not activated. - Request ID: 6ddf00757dd4772a7922c609b4e0d9c8
18:07:21 - UnresolvedLinks: Status: 422 - Unprocessable Entity - Message: Validation error - Details: notResolvable, notResolvable - Request ID: d930d448b8ad9d4fb4703a124a9371a2
18:07:49 - UnresolvedLinks: Status: 422 - Unprocessable Entity - Message: Validation error - Details: notResolvable, notResolvable - Request ID: 2a66d3b49b1b2be08ecad30b53648ed2
18:07:49 - Could not publish the following entities: Paradise Beach Ocean Resort (33ELpSwa3u0wIMooyCaa2w)

Stored the detailed error log file at:
/home//Documents/Contentful/tld/contentful-import-error-log-z03ztmbv2w5i-2020-06-26T18-05-56.json
(node:15436) UnhandledPromiseRejectionWarning: ContentfulMultiError: Errors occured
at then (/home//Documents/Contentful/tld/node_modules/contentful-import/dist/index.js:202:28)
at tryCatcher (/home//Documents/Contentful/tld/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/home//Documents/Contentful/tld/node_modules/bluebird/js/release/promise.js:547:31)
at Promise._settlePromise (/home//Documents/Contentful/tld/node_modules/bluebird/js/release/promise.js:604:18)
at Promise._settlePromise0 (/home//Documents/Contentful/tld/node_modules/bluebird/js/release/promise.js:649:10)
at Promise._settlePromises (/home//Documents/Contentful/tld/node_modules/bluebird/js/release/promise.js:729:18)
at _drainQueueStep (/home//Documents/Contentful/tld/node_modules/bluebird/js/release/async.js:93:12)
at _drainQueue (/home//Documents/Contentful/tld/node_modules/bluebird/js/release/async.js:86:9)
at Async._drainQueues (/home//Documents/Contentful/tld/node_modules/bluebird/js/release/async.js:102:5)
at Immediate.Async.drainQueues (/home//Documents/Contentful/tld/node_modules/bluebird/js/release/async.js:15:14)
at runCallback (timers.js:794:20)
at tryOnImmediate (timers.js:752:5)
at processImmediate [as immediateCallback] (timers.js:729:5)
(node:15436) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 20)
(node:15436) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
my-home> ~/Documents/Contentful/tld (master=) $ `

Can anyone please help?

Attached is the full log of the setup I am trying now.
setup-error.log

I got the Space Id & CDA token from Settings -> API Keys
I got the CMA token from Settings -> API Keys -> Content management tokens & generated a Personal token.

Please let me know if I am going the right way.

setup.js instructions need updating

setup.js still tells you to start the app with "npm run dev" but it's now "npm run start". It also tells you to access the site on port 8080 instead of port 3000.

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.