Skip to content

Instantly share code, notes, and snippets.

@shadcn
Created June 8, 2022 06:29
Show Gist options
  • Save shadcn/e5a18cfc51ab3dfa8a1e33b1fc2b890d to your computer and use it in GitHub Desktop.
Save shadcn/e5a18cfc51ab3dfa8a1e33b1fc2b890d to your computer and use it in GitHub Desktop.
next-drupal: how to run the marketing example.

Get the code

git clone https://github.com/chapter-three/next-drupal

Get the database

The database is not publicly available in the repo. You can ping @shadcn. I'll send you a copy.

Setup Drupal

  1. cd drupal
  2. composer install
  3. Create a settings.local.php file at drupal/web/sites/default/settings.local.php with the following:
<?php

// UPDATE THE DATABASE CONNECTION TO PULL FROM THE COPY ABOVE.
$databases['default']['default'] = array (
  'database' => 'next_drupal',
  'username' => 'root',
  'password' => 'root',
  'prefix' => '',
  'host' => 'localhost',
  'port' => '3306',
  'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
  'driver' => 'mysql',
);
$settings['hash_salt'] = 'QHcBzdj7VmVv3fuoBKQzm9CDau80ugUUUewL89p0c38Tf8-WYz0pKXeMam3tLaGoJodflRlaUA';

$config['next.next_site.example_marketing']['base_url'] = 'http://localhost:3001';
$config['next.next_site.example_marketing']['preview_url'] = 'http://localhost:3001/api/preview';
$config['next.next_site.example_blog']['base_url'] = 'http://127.0.0.1:3030';
$config['next.next_site.example_blog']['preview_url'] = 'http://127.0.0.1:3030/api/preview';

$settings['trusted_host_patterns'] = [
  '127.0.0.1$',
  '^localhost$',
];
  1. From the drupal directory, run drush rs 8080 to start the Drupal development server.
  2. You can now visit http://localhost:8080/user and login with admin/admin to the Drupal site.
  3. Visit /admin/config/people/simple_oauth and click on Generate Keys.
  4. Enter sites/default/files for the directory.

Step example-marketing

  1. From the root of the next-drupal repo, run yarn install
  2. Copy examples/example-marketing/.env.example to examples/example-marketing/.env.local
  3. Run yarn workspace example-marketing dev
  4. You can now visit the marketing site at http://localhost:3001
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment