Before getting started, you'll need these global packages to be installed:
- Node.js (v12) - easiest way to install via nvm
- Yarn - to manage dependencies
- PostgreSQL (v12) - postgres database
You can read more about engine requirements from package.json on GitHub.
First, you'll need to make a fork of the LogChimp repository. Click on the fork button right at the top, wait for a copy to be created over on your personal GitHub account, and you should be all set!
You'll also need a LogChimp theme as client to intract with LogChimp APIs.
- LogChimp Core - https://github.com/logchimp/logchimp
- LogChimp default theme - https://github.com/logchimp/theme
Once you run the command at the root repository, it will install all the required dependencies for client and backend.
Setup postgreSQL database
There are a few ways to set up a database.
- Download the official Postgres package
- Run a postgres docker container
- Use a remote or self-managed database
To spin up a database quickly and easily on your local machine, we recommend you to use the PostgreSQL docker image.
docker run -d \ --name db \ -p 5432 \ -e POSTGRES_DB=$database_name \ -e POSTGRES_USER=$database_user \ -e POSTGRES_PASSWORD=$strong_password \ postgres:12.4
Once you take down the Postgres Docker container all the data is also removed, to persist the data on your machine, you can add this line.
Starting from v0.4.0
.env has been replaced with
logchimp.config.json file in the root directory, which will contain all the configuration for the LogChimp site.
You need two separate terminal windows to run the client and backend separately.
# in terminal 1 - to run logchimp core yarn run dev # in terminal 2 - to run logchimp theme yarn run dev