Create a product catalog using Ruby on Rails (or simply Rails), GraphQL Client, and Contentstack's GraphQL APIs.
About Contentstack: Contentstack is a headless CMS with an API-first approach that puts content at the centre. It is designed to simplify the process of publication by separating code from content.
About this project: This sample app is a professional website built using Rails and Contentstack.
- To get your app up and running quickly, you need to download it and change the configuration. Download the app using the command given below:
$ git clone https://github.com/contentstack/contentstack-ruby-graphql-example.git
-
Once you have downloaded the project, add your Contentstack API Key, Delivery Token, and Environment name to the project. (Learn how to find your Stack's API Key and Delivery Token. Read more about Environments).
-
Now create a
secrets.yml
file inside theconfig
folder and enter your credentials as shown below:
development:
host: <HOST_NAME>
api_key: <API_KEY>
delivery_token: <DELIVERY_TOKEN>
environment: <ENVIRONMENT_NAME>
Note: You should set Host name to GraphQL URLs for Contentstack. For example 'graphql.contentstack.com'.
- Run the app by using the following command:
$ rails server
This command will start the app. Open the browser and go to http://localhost:3000 where you will find the Rails welcome page.
We have created an in-depth tutorial on how you can create a product catalog app using Rails, GraphQL Client, and Contentstack's GraphQL APIs.
By following the steps given in the step-by-step tutorial, you can create a fully functional product catalog app.
Create a product catalog using Rails, GraphQL Client, and Contentstack's GraphQL API