In this tutorial, I’m going to show you how to create a tour diary app using Next, Redux, Ant design and Cosmic JS. It will cover all available options to CRUD using Cosmic JS.
Download the GitHub repo.Check out the demo.
You will be required to install Node JS and npm before starting. Make sure you already have them installed.
First, we will setup the bucket in Cosmic JS.
**Setup bucket:**To create the bucket, login to Cosmic JS and click add ‘new bucket’.
Select start from scratch.
**Import Bucket Data:**Download this bucket.json file. And in Settings -> Import / Export Data, click “Add Import File” and choose the downloaded file. It will import all the Object Types and required data.
Now we will work on application.
Doing everything using the existing git repo
You need to have git installed in your system in order to clone the repository. Once done run the following command through terminal or command line:
git clone https://github.com/cosmicjs/next.js-tour-diary
package.json will look like this:
Once we’re done installing every required package by running npm install, let’s start creating our app.
Let’s create our TourDetailModal component by creating a file in Tour/TourDetailModal.jsand adding the following code in it:
TourDetailModal.js
This is the abbreviated version of the article that originally appeared on Cosmic JS.
**Conclusion**So, this is an app where every scenario of Cosmic RESTful API using the Cosmic JS npm package is covered (CRUD). I hope you like the tutorial. If you have any questions please reach out to Cosmic JS on Twitter and join the Cosmic JS Community on Slack.