Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sahithya-01/contentful-cms
This React project integrates Contentful CMS to fetch and display project data. It includes components for rendering project information fetched via Contentful's API, showcasing how to manage dynamic content in a web application.
https://github.com/sahithya-01/contentful-cms
cms contentful customhooksreact reactjs undraw
Last synced: about 1 month ago
JSON representation
This React project integrates Contentful CMS to fetch and display project data. It includes components for rendering project information fetched via Contentful's API, showcasing how to manage dynamic content in a web application.
- Host: GitHub
- URL: https://github.com/sahithya-01/contentful-cms
- Owner: Sahithya-01
- Created: 2024-07-11T20:28:20.000Z (4 months ago)
- Default Branch: master
- Last Pushed: 2024-07-12T16:43:23.000Z (4 months ago)
- Last Synced: 2024-10-15T17:37:05.397Z (about 1 month ago)
- Topics: cms, contentful, customhooksreact, reactjs, undraw
- Language: CSS
- Homepage: https://sahithya-contentful-cms.netlify.app/
- Size: 4.87 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Figma URL
[Contentful](https://www.figma.com/file/XtVr3JRCGWyZESYxd9EhZK/Contentful?node-id=0%3A1&t=SNnU6FgNUQXktIFb-1)
Used Undraw for hero image
## Steps
#### Install and Setup
- npm install
- npm run dev#### Structure
Create Hero and Projects components
#### Hero
Setup Hero component.
#### Nice Images
[Undraw](https://undraw.co/)
#### Data
Explore data.js
#### Headless CMS
A headless CMS is a back-end only content management system that provides content creators with an intuitive interface for creating and managing content, while leaving the front-end presentation layer to be handled by a separate system or platform. This approach allows for greater flexibility and scalability, as the content can be easily distributed to multiple channels and devices, without being limited by the constraints of a particular front-end system.
#### Contentful
Create a Contentful account
[Contentful ](https://www.contentful.com/)
##### Create Data
Setup content type and create few entries
#### Explore API
Get Space ID, Access Token and explore code examples.
#### Install SDK
- npm install contentful
#### Get Entries
```js
import { createClient } from 'contentful'const client = createClient({
space: 'qz00uzgg3leh',
environment: 'master', // defaults to 'master' if not set
accessToken: import.meta.env.VITE_API_KEY,
})client
.getEntries({ content_type: 'projects' })
.then((response) => console.log(response.items))
.catch(console.error)
```#### Custom Hook
Create custom hook with loading and projects state values.
#### Parse Data
Setup projects array
#### Setup Products Component
Render data in Products component