Skip to content

Develop setup instructions

Taylor North edited this page Jan 3, 2024 · 6 revisions

Create a new folder and clone these two projects:

mkdir coral
cd coral
git clone [email protected]:flaxandteal/arches.git
git clone [email protected]:flaxandteal/coral-arches.git

You'll want to have yarn on your local system at this version:

yarn -v
> 1.22.19

Next change directory to:

cd coral-arches/coral/coral

Run this command:

NODE_OPTIONS=--max_old_space_size=8192 NODE_PATH=./media/node_modules yarn add -D babel-loader html-loader clean-webpack-plugin webpack-cli mini-css-extract-plugin stylelint-webpack-plugin eslint-webpack-plugin css-loader postcss-loader sass-loader raw-loader ttf-loader file-loader url-loader

This adds a couple extra dev dependencies needed to get coral up and running. You can find this command used in the Dockerfile.static file.

Run the install command for yarn:

NODE_OPTIONS=--max_old_space_size=8192 NODE_PATH=./media/node_modules yarn install -D

After the install command try running:

NODE_OPTIONS=--max_old_space_size=8192 NODE_PATH=./media/node_modules yarn run start

Note this command will fail but it will create certain folders and files with your hosts permissions attached. This allows webpack when it is run from the container to access those folders without encountering permissions issues.

Notable files created:

webpack-stats.json

This file contains all the lookups/shorthands for finding files that have been compiled by webpack and stored in the static folder for the webpages to find.

Once you have setup the yarn parts of the project we need to build the new base container based on your local coral:

cd coral-arches
bash scripts/build_project.sh

After these steps your ready to build the database:

cd coral-arches
bash scripts/reset_db.sh

Once that has complete source the CLI util file to make it easier to start the project:

cd coral-arches
{"." or "source"} cli_util.sh

You'll now have access to the commands within that file and should be able to run:

coralup

If all goes well you should be able to visit:

http://localhost:8000

If nothing has loaded or you see a webpack error you might need to run the rebuild command:

rbwebpack

This command is within the cli_util.sh you sourced earlier but might need to source again in a different terminal if docker is running in your coralup container. This command only works if the containers are running.

Every time you create or change a JavaScript file a rebuild of webpack will need to happen. Sometimes this happens automatically and other times you need to run rbwebpack to build all the JavaScript files. It's also worth noting the location of webpack stats coral-arches/coral/coral/webpack/webpack-stats.json. If you have an error in your JavaScript sometimes an error message will output into this file.

Clone this wiki locally