Example: Engineering bootstrap

This document will guide you through all the steps needed to setup your dev environment.

Cloning the Slite project

The entire Slite codebase is hosted under one mono-repo. Every single part of the infrastructure that you'll be able to touch as an engineer is located in there. So head off to  GitHub  and start by cloning the project:
git clone git@github.com:xxxx/yyy.git
Two step authentication is required to access Slite's GitHub, be sure to set it up first.
Optional: For an extra layer of security, you can generate a GPG key to sign your commits, follow  GitHub instructions  to set it up.  GitHub now also supports SSH signatures .


Installing required tools

New starters: We recommend running a Garden environment, instead of running everything locally. Garden effectively gives every developer their own hosted development+staging environment. To learn about Garden and the setup, head of to  🌱How to use Garden 

Brew bundle (Mac only)

You install all required tools by heading to mono-repo root and running:
brew bundle install

This will pull and install all dependencies using  Homebrew . You will then be able to keep those tool up to date by running cd .

Manual installation

Node

You will need Node version 14 at least to work on any part of Slite. You can install  FNM  (recommended) or  NVM  to handle multiple versions of Node on your system.

Yarn

We use Yarn as a package manager to install dependencies, do not try to use NPM, it will not work as we use the workspaces feature of Yarn. You can install it through:
npm install -g yarn
The global installed version doesn't matter as yarn will automatically use the one in the mono-repo thanks to the configuration files.

Docker & Garden

You will most likely need Docker. On Mac/Windows you will need to install  Docker Desktop , whereas on Linux you can install it from the command line.

And Garden :
curl -sL https://get.garden.io/install.sh | bash

Installing Node.js dependencies

Since we use  Yarn workspaces , you will need to run only once the installation command for the whole stack. Head to the root of the mono-repo in your terminal and run:
yarn

Troubleshooting

Problems installing Puppeteer on M1 Macbook
api-export uses puppeteer to generate PDF exports. The version of puppeteer we're using doesn't know about the apple M1 chip and  makes some assumptions that mean it can't find a compatible chromium binary during install .

If you run into this issue you can work around it by installing chromium yourself and instructing Puppeteer to skip its install step  as described in this guide . If/when we upgrade Puppeteer this should no longer be a problem.


Building packages

To be able to share code between parts of the stack, we use private node_modules that are linked through the workspaces feature of Yarn. Those packages need to be built on a regular basis (specially editor package) or otherwise you will most likely encounter runtime errors.
yarn build:all
To rebuild only the packages that are moving often, use yarn build:packages instead.

What's next?

When you're done with the setup, you can head to the next guides in the same folder to learn about: