Create a project
In this step, we will create a Cube Core project on your computer, connect a data source, and generate data models.Scaffold a project
Start by opening your terminal to create a new folder for the project, then create adocker-compose.yml file within it:
docker-compose.yml file and add the following content:
CUBEJS_DEV_MODE environment variable to true to
enable the Development Mode. This is
handy for local development but not suitable for
production.
If you’re using Linux as the Docker host OS, you’ll also need to add
network_mode: 'host' to your docker-compose.yml.Start the development server
From the newly-created project directory, run the following command to start Cube:Using Windows? Remember to use PowerShell or
WSL2 to run the command below.
Connect a data source
Head to http://localhost:4000 to open the Developer Playground. The Playground has a database connection wizard that loads when Cube is first started up and no.env file is found. After database credentials have been set
up, an .env file will automatically be created and populated with credentials.
Want to use a sample database instead? Select PostgreSQL and use the
credentials below:
| Field | Value |
|---|---|
| Host | demo-db.cube.dev |
| Port | 5432 |
| Database | ecom |
| Username | cube |
| Password | 12345 |
orders table. After selecting the table, click Generate Data Model
and pick either YAML (recommended) or JavaScript format: