Skip to content

Exporting examples from Grommet

Alan Souza edited this page Oct 12, 2015 · 4 revisions

[DEPRECATED] - Right now working on moving all examples apps to a separate repository

The examples folder inside Grommet contains a set of useful apps that illustrate real-life usage of Grommet. It could work as an extension of the Grommet Component Docs with more concrete examples.

While copy-and-paste the sample application folder to an external location is an optimal scenario, this is not possible because we have links to Grommet source files inside these examples that help with development and hot-reloading.

So, we have created an export task as part of the Grommet CLI that enables extracting a sample application from Grommet. The rest of this page will use the medium-app as an export example.

  1. Open the terminal, go to any location (probably your development workspace) and run:
```
  $ grommet export medium-app my-medium-app
```

At this point a new `my-medium-app` folder will be created containing the medium-app source code (including a sample Node.Js server).
  1. Access my-medium-app and install NPM dependencies:
```
  $ cd my-medium-app
  $ npm install
  $ cd server
  $ npm install
```
  1. Start the backend server:
```
  $ cd my-medium-app/server
  $ node server.js
```
  1. Start the development server for the medium-app:
```
  $ cd my-medium-app
  $ gulp dev
```

Access the Medium App and you should be able to see the Login screen.

At this point, any Username and Password combination works, as long as Username is a valid email.

Clone this wiki locally