Setup the Unchained Engine
In this section, we will walk you through the steps required to start up an Unchained Engine API server locally. To achieve this, we install and configure a new Meteor app with the Unchained Engine included.
This tutorial helps you:
- Install and run locally the Meteor application with the Unchained Engine embedded.
- Access the local Admin UI example admin app
- Open the graphQL playground of your local Unchained Engine
- First create a new folder for your project to be installed.
mkdir my-unchained-engine cd my-unchained-engine
- Use the Unchained initialisation script to download the code.
npm init @unchainedshop
- A message prompts you to select the installation template. Choose Unchained engine by using the
down keyand press
? What type of template do you want › Full stack e-commerce Storefront Unchained engine <--
- Next two steps are to select the directory, as we already created a new empty directory you can simply press
enter, and whether you want to initialise git which is up to you.
? Directory name relative to current directory (press Enter to use current directory) › ? Do you want Initialize git? no / yes
- Install the npm packages
meteor npm install
The installation script downloads, installs and initialises all files and packages required to build and run a new Meteor app that has the Unchained Engine backed in.
meteor npm run dev
Open localhost:4010 to check if your meteor app is running correctly. You should see an Login Screen. Well, log-in!
You should see the following admin console in your browser (Yes, the UI can be improved. However, it's an admin console that is not visible to any customer).
localhost:4010/graphql opens the GraphQL playground for you to easily execute queries and mutations.
Follow the examples to learn about how to add products, initiate a check-out and use plugins with GraphQL.
An easy way to test the Unchained Engine is to setup the test storefront web app created with React.js and Next.js locally and connect our local Unchained Engine GraphQL API to it which is covered in the next chapter.