Skip to main content

Starting a New Site

Setting up

Clone The Base Project

Use Git in your Terminal to clone the Base October Project

git clone git@github.com:wesayhowhigh/base-3.git NAME_OF_YOUR_PROJECT_FOLDER

Once inside the new folder you'll need to do the following:

Reset Git for project

As you cloned base, this new project will still be attached to the base repository. We want to remove that and set it up for your new project

rm -rf .git

This will remove any remnants of github from this new project

git init

This will initialise the new project as a fresh Github project to track changes with.

Copy the example ENV file to a real ENV file:

cp .example.env .env

Herd setup

Once Herd is installed globally, you can run herd link to set up the current directory as a Herd project.

herd link

You can now install composer dependencies using:

herd composer install

and Node dependencies using:

Instruct Node Version Manager to use the Node version defined in the .nvmrc file
nvm use
Install Node packages
npm install
Run the development script and build the bundle
npm run dev

Database

If you have a Herd Pro licence, create a database service inside the Herd UI.

If not, we recommend using DBngin.

Remember to add the database details to your .env file

Legacy sites - using Docker

Install PHP packages

Use your systems composer or the dev script to install the PHP packages:

Using system composer
composer install --ignore-platform-reqs
Using dev script
./dev composer install

Install Javascript/CSS packages

Either use your systems Node Version Manager (nvm) or the dev script to install packages

Using system composer
# This sets the node version to the one used in the projects .nvmrc file
nvm use

# This installs the JS packages
npm install

# This runs the development script and builds the bundle
npm run dev
Using dev script
# This installs the JS packages
./dev npm install

# This runs the development script and builds the bundle
./dev npm run dev

Launch the site

Use Docker to launch the website, including all relevant apps such as mysql, redis, caddy.

docker compose up
note

You can add the -d flag to detach the docker logs from the terminal if you wish - but it can be useful to keep it running so you can easily spot any critical errors with any of the apps

Accessing the containers

You can connect to the primary application by typing the following command in your terminal:

docker exec -it app sh

You can then run various commands such as modifying the .env with vi .env or run Artisan commands with php artisan

Bringing the site down

Use Docker to bring down the website, including all relevant apps such as mysql, redis, caddy.

docker compose down

If you've ran docker compose up without detaching, then cancelling the command in that terminal window (using ctrl + c) may also close the containers (though not necessarily in the same way docker compose down does)