{"id":19495236,"url":"https://github.com/rodik-dev/local-starter-contentful","last_synced_at":"2026-05-06T19:05:57.527Z","repository":{"id":76766616,"uuid":"481174206","full_name":"rodik-dev/local-starter-contentful","owner":"rodik-dev","description":"Jamstack site created with Stackbit","archived":false,"fork":false,"pushed_at":"2022-04-13T10:39:30.000Z","size":5796,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-08T09:24:55.858Z","etag":null,"topics":["contentful","headless","jamstack","nextjs","ssg","stackbit","static"],"latest_commit_sha":null,"homepage":"https://jamstack.new","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rodik-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-13T10:39:21.000Z","updated_at":"2022-04-13T10:39:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"0825d3d8-6b01-4058-813e-cbd46c6db704","html_url":"https://github.com/rodik-dev/local-starter-contentful","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodik-dev%2Flocal-starter-contentful","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodik-dev%2Flocal-starter-contentful/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodik-dev%2Flocal-starter-contentful/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodik-dev%2Flocal-starter-contentful/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rodik-dev","download_url":"https://codeload.github.com/rodik-dev/local-starter-contentful/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240740871,"owners_count":19850054,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["contentful","headless","jamstack","nextjs","ssg","stackbit","static"],"created_at":"2024-11-10T21:36:42.598Z","updated_at":"2026-05-06T19:05:57.483Z","avatar_url":"https://github.com/rodik-dev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A New Stackbit Project\n\nWelcome to your new project created with Stackbit!\n\nHere are a few useful tips \u0026 links:\n\n## Set up\n\n1. If you haven't yet transferred this project to your GitHub account, click on the **Gear** icon in the visual editor to open **Project Settings** and start the transfer. [Learn More](https://docs.stackbit.com/how-to-guides/transfer-repo/).\n1. Once the repository is in your account, the Project Settings window will show you the commands to run for setting up your local environment. [Learn More](https://docs.stackbit.com/how-to-guides/local-development/).\n\n## Develop with Stackbit Locally\nTo spin up local dev, run:\n1. In terminal 1: `git clone` \u003e\u003e `npm install` \u003e\u003e Add the Cntfl tokens to the `.env` file \u003e\u003e `npm run dev`\n2. In terminal 2: `sudo npm i -g @stackbit/cli@0.2.4`\n``` \nstackbit dev \\\n    -c contentful \\\n    --contentful-space-id \u003cspace_id\u003e \\\n    --contentful-preview-token \u003cpreview_token\u003e \\\n    --contentful-access-token \u003caccess_token\u003e\n```\n\n## Learn the basics\n\n1. It's a good idea to go through our [Getting Started tutorial](https://docs.stackbit.com/getting-started/). It will give you a small taste of component development as well, and links for further reading.\n1. To go deeper into how things work, head to the [Conceptual Guides](https://docs.stackbit.com/conceptual-guides/).\n1. For more concise, practical information see the [How-to Guides](https://docs.stackbit.com/how-to-guides/).\n\n## Get answers\n\n[Join us on Discord](https://discord.gg/HUNhjVkznH) for community support.\n\n## Building for production 🏗\n\nTo build a static site for production, run the following command\n\n```shell\nnpm run build\n```\n\nThe generated site will be written to the `out` folder. The contents of this folder can be deployed by a serverless deployment platform such as [Netlify](https://www.netlify.com). You can start a local server serving the static files from the `out` folder, for example, by installing and running `http-server`:\n\n```shell\nnpm install http-server -g\nhttp-server out\n```\n\n## Contributing 🙏\n\nTo contribute to this theme, please follow the following steps:\n\n1. Clone this repository locally\n\n2. Create a new Space in Contentful\n\n3. Create new Contentful Personal Access Tokens [here](https://app.contentful.com/account/profile/cma_tokens/)\n\n4. Install dependencies\n\n   ```shell\n   npm install\n   ```\n\n5. Import the Contentful data stored in the `contentful/export.json` file to the new space by running the following command. Replace the `\u003cmanagement_token\u003e` with your Personal Access Token and the `\u003cspace_id\u003e` with the new space ID.\n\n   ```shell\n   ./contentful/import.js \u003cmanagement_token\u003e \u003cspace_id\u003e\n   ```\n\n6. Create \"**Content Preview API - Access Token**\" for the new space via Contentful app \"Settings\" =\u003e \"API Keys\" =\u003e \"Content delivery / preview tokens\" =\u003e \"Add API Key\".\n\n7. Define the following environment variables to allow Next.js to fetch the content from Contentful when developing or building the site. Replace the `{SPACE_ID}` with your Space ID and the `{CPA}` with the new **Content Preview API - Access Token**.\n\n   ```shell\n   export CONTENTFUL_SPACE_ID={SPACE_ID}\n   export CONTENTFUL_PREVIEW_TOKEN={CPA}\n   ```\n\n8. Lastly, run the Next.js development server:\n\n   ```shell\n   npm run dev\n   ```\n\n   Navigate to [http://localhost:3000](http://localhost:3000) to see the site.\n\n9. Now you can update site code, and the content in Contentful. The browser will automatically live-update your changes.\n\n10. Once you finish updating the code and contents, export the contents back to the `contentful/export.json` file by running the following command. Replace the `\u003cmanagement_token\u003e` with your Personal Access Token and the `\u003cspace_id\u003e` with the new space ID.\n\n    ```shell\n    ./contentful/export.js \u003cmanagement_token\u003e \u003cspace_id\u003e\n    ```\n\n11. Commit, push and submit a pull-request 🎉\n\n## Working with types\n\nWhen you update content models in Contentful, run `npm run generate-types` with `CONTENTFUL_ACCESS_TOKEN` and `CONTENTFUL_SPACE_ID` environment variables to generate types from Contentful content models. The types will be stored at `src/types/contentful.d.ts`.\n\nContentful types re-mapped into internal Sourcebit types inside `src/types/sourcebit.ts`. And these are the types that are used by React components. The remapping is done for several reasons:\n\n1. Remove Contentful specific fields such as `sys` and `metadata` and unwrap Contentful `fields` for simplicity.\n2. Add `__metadata` introduced by Sourcebit.\n\n## Learn More 📚\n\nTo learn more about Stackbit, take a look at the following resources:\n\n- [Stackbit Documentation](https://docs.stackbit.com)\n- Configure your theme using [stackbit.yaml](https://docs.stackbit.com/reference/stackbit-yaml/)\n\nTo learn more about Next.js, take a look at the following resources:\n\n- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.\n- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.\n\nTo learn more about Contentful, take a look at the following resources:\n\n- [Contentful Docs](https://www.contentful.com/developers/docs/)\n- [Importing and exporting content with the Contentful CLI](https://www.contentful.com/developers/docs/tutorials/cli/import-and-export/)\n\nTo learn more about Netlify, take a look at the following resources:\n\n- [Netlify Docs](https://docs.netlify.com/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frodik-dev%2Flocal-starter-contentful","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frodik-dev%2Flocal-starter-contentful","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frodik-dev%2Flocal-starter-contentful/lists"}