Skip to main content

Install CODE and DRAW

Prerequisites#

You will need:

Installing the Olympe Yeoman generator#

Olympe provides package @olympeio/generator-project, a Yeoman generator to help users quickly scaffold a CODE project. The generator installs all dependencies and create all configuration and runtime files needed to execute Olympe apps and build Olympe libraries. To install it run

npm install --global @olympeio/generator-project

Generate an Olympe project#

To setup a new project, create an empty directory, navigate to it and call the Yeoman generator:

yo @olympeio/project

The generator will ask you multiple questions. In the following example, we create a new project from scratch named My Test Project in which we want to create a runnable application without React:

generatorPrompting

You have the following options when creating a project:

  • Create a new project or import an existing project from a server.
  • Create runnable applications or a library. Applications may be run directly in the browser whereas a library is intended to provide a set of functions or components that can be used in another project.
  • Integrate React framework.

The generator fetch automatically the compatible versions of DRAW, Olympe runtime, and Olympe Orchestrator.

note

You can always run again the generator later to change options.

Start the Olympe backend#

Yeoman automatically generates a descriptor indicating how to retrieve and start an Olympe backend that is necessary to work locally. To start this backend, make sure docker is running, then call

docker compose up --detach

This launches two docker containers: the Neo4j database and the Olympe Orchestrator. You can check that everything is up-and-running by visiting http://localhost:8080/status/. All boxes should be green.

note

If you experience an error -- possibly because you have executed the Olympe backend sometime else in the past --, run docker container prune to remove stopped containers. If the problem persists, you will have to remove the container that conflicts using docker stop <hash> and then docker rm <hash>.

Initialise the database#

Once Neo4j and the Olympe Orchestrator are running, you can initialise the database with your new project:

npm run reset
warning

This will erase all the content of your Neo4j database. If have already set up a DRAW project, you should snapshot your project before proceeding. If your database is otherwise empty, you can safely ignore the snapshot step:

npmRunReset

Taking a snapshot will dump the content of your project on the data cloud to your local drive.

Launch DRAW#

Finally, launch DRAW by running

npm run serve

You can finally visit http://localhost:8888/ to start working in DRAW.

That's all! You can now take a look at our guides and tutorials, and start building a first app and add a first brick.