Novu Handbook
    Dev Machine Setup
    đź’»

    Dev Machine Setup

    • Mac Setup:
    • Terminal upgrade (Optional)
    • Install ZSH
    • ZSH auto-complete plugin
    • Powerlevel10k (optional)
    • Command Line Tools, Homebrew & Casks
    • Homebrew & Casks
    • Setting up git
    • Helpful settings
    • Development Environment
    • Node & NVM
    • PNPM
    • Docker
    • AWS CLI
    • Run LocalStack
    • MongoDB
    • Redis
    • Secret management via Doppler (Optional)
    • Local dev domain (Optional)
    • Code Editor
    • Productivity tools
    • GitHub Desktop (Optional)
    • Clean your Dock bar (Optional)
    • What’s next?

    Mac Setup:

    Terminal upgrade (Optional)

    Install ZSH

    ZSH is a shell on steroids, it has multiple plugins and functionality that can save a lot of time.

    To install zsh run in your command line:

    sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
    đź’ˇ
    If you previously haven’t installed git on the machine, a prompt to install git will show up. After installation, run the sh command from above again.
    âť•
    Make sure you have a ~/.zshrc exists, if not it might be an indicator that the installation failed for some reason.

    ZSH auto-complete plugin

    Add the autocomplete plugin for autocompleting previously typed commands in the shell. Follow the instructions here.

    Powerlevel10k (optional)

    Powerlevel10k is a theme for Zsh. It emphasizes speed, flexibility, and out-of-the-box experience.

    1. Clone the repository:
    2. git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

    3. Set ZSH_THEME="powerlevel10k/powerlevel10k" in ~/.zshrc.
    4. Restart your terminal and follow the onboarding wizard to configure it to your likings and preferences.

    Command Line Tools, Homebrew & Casks

    Every developer utilizes Command Line Tools. A simple terminal command will allow you to download these. It will ask you to confirm after you have entered the command.

    xcode-select --install

    Homebrew & Casks

    Homebrew, it’s the missing package manager for macOS, and quite powerful at that.

    Copy and paste the following code into your terminal to install Homebrew.

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

    It will ask you to enter 'Return' to confirm the installation.

    đź’ˇ
    After installation run, the echo and eval commands shown on screen to add brew to your shell executables

    Setting up git

    To set up git and create an access token for GitHub, suggested installing GitHub Desktop before.

    Helpful settings

    Show hidden files in Finder: cmd + shift + . or in the terminal:

    defaults write com.apple.finder AppleShowAllFiles YES

    Development Environment

    Node & NVM

    For installing node we suggest installing it using NVM (Node Version Manager) for easily managing multiple node versions.

    1. Install nvm on your machine.
    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
    đź’ˇ
    Make sure that you have installed zsh previously, so NVM can automatically inject the executable to PATH in the .zshrc config file.
    1. After installing nvm and checking that it’s in the path by running nvm --version in your CLI. You can now install our node version:
    đź’ˇ
    After running the install script, if you get nvm: command not found or see no feedback from your terminal after you type command -v nvm, simply close your current terminal, open a new terminal, and try verifying again.
    nvm install v16.15.1
    1. Optional for M1 processors - Install Rosetta.

    Rosetta enables a Mac with Apple silicon to use apps built for a Mac with an Intel processor.

    softwareupdate --install-rosetta

    PNPM

    For package management, we use PNPM instead of npm or yarn to speed up our install times and space efficiency. To install pnpm globally run:

    	npm install -g pnpm@latest

    Docker

    Follow the installation guide on docker website to install docker on your own machine. For ease of use, we suggest installing Docker Desktop.

    AWS CLI

    Follow the instructions to install the AWS CLI so you can use it to create env later on, based on existing S3 buckets:

    Installing or updating the latest version of the AWS CLI

    This topic describes how to install or update the latest release of the AWS Command Line Interface (AWS CLI) on supported operating systems. For information on the latest releases of AWS CLI, see the AWS CLI change notes on GitHub. To install a past release of the AWS CLI, see Installing past releases of the AWS CLI version 2.

    docs.aws.amazon.com

    You should get something like this:

    image

    If needed, see:

    Resolve "Unable to locate credentials" error in Amazon S3

    When I try to access my Amazon Simple Storage Service (Amazon S3) bucket using the AWS Command Line Interface (AWS CLI), I get an error. How do I fix this? An "Unable to locate credentials" error indicates that Amazon S3 can't find the credentials to authenticate AWS API calls.

    aws.amazon.com

    Resolve "Unable to locate credentials" error in Amazon S3

    Run LocalStack

    This is needed only when you upload files (for example - an image) in the admin panel from your local environment.

    LocalStack emulates cloud service that runs in a single container on your computer. So you can run your AWS applications on your local machine without connecting to the remote cloud provider.

    1. Build a container and run it:

    docker run --rm -it -p 4566:4566 -p 4571:4571 localstack/localstack
    1. Create local S3 buckets needed for the app:

    add fake credentials

    export AWS_ACCESS_KEY_ID=your_access_key_id
    export AWS_SECRET_ACCESS_KEY=your_secret_access_key
    export AWS_DEFAULT_REGION=us-east-1

    In local environment:

    	aws --endpoint-url=http://localhost:4566 s3 mb s3://novu-local

    In test environment:

    aws --endpoint-url=http://localhost:4566 s3 mb s3://novu-test
    1. Update cors:
    2. aws --endpoint-url=http://localhost:4566 s3api put-bucket-cors --bucket novu-local --cors-configuration file://cors.json

      cors.json

      {
        "CORSRules": [
          {
            "AllowedOrigins": ["*"],
            "AllowedHeaders": ["*"],
            "AllowedMethods": ["GET", "PUT", "POST", "DELETE"],
            "MaxAgeSeconds": 3000,
            "ExposeHeaders": ["x-amz-server-side-encryption"]
          }
        ]
      }

    MongoDB

    After installing brew you can easily install the MongoDB community edition.

    1. Tap the MongoDB Homebrew Tap to download the official Homebrew formula for MongoDB and the Database Tools, by running the following command in your macOS Terminal:
    brew tap mongodb/brew
    1. To install MongoDB, run the following command in your macOS Terminal application
      1. You might need to update the Command Line Tools to be compatible with Xcode - see
      2. Sign in with your Apple ID

        Sign in with your Apple ID

        developer.apple.com

    brew install mongodb-community
    1. Run the service in the background and start automatically after restart.
    brew services start mongodb/brew/mongodb-community

    Redis

    After installing homebrew run the redis installation

    brew install redis

    After installation run the service to start on system start as well.

    brew services restart redis

    Secret management via Doppler (Optional)

    Doppler is used for secret management. Request access to Novu Doppler account. The account contains the api project that has three sets of secrets for development, staging and production environments.

    image
    ℹ️
    Secrets are required for specific features such as Sign in with Github. The local environment should work without access to such features without them.

    To download secrets for the local development environment:

    1. Install the Doppler CLI
    2. Authenticate in the CLI via doppler login
    3. Download the secrets via pnpm run get-remote-env-files

    Local dev domain (Optional)

    This will allow you to use local.novu.co instead of localhost when accessing the service on your machine.

    Open the /etc/hosts file:

    sudo nano /etc/hosts

    And add the local.novu.co domain

    127.0.0.1       local.novu.co

    Code Editor

    Feel free to install your favorite code editor. We supply licenses for No access, or you can Visual Studio Code if you prefer it.

    Productivity tools

    GitHub Desktop (Optional)

    GitHub Desktop simplifies the development workflow and interaction with Git. Download the client from their website.

    Clean your Dock bar (Optional)

    For better productivity and wellness, we suggest removing the not-used apps from LaunchBar. Don’t worry if you will remove most apps from there. You can always use the spotlight to open the apps you need. Clean workspace === Happy life :)

    • Right Click on the app icon > Options > Remove from Dock
    image

    What’s next?

    Check out the Start Coding guide to learn how to run and test the project

    Logo

    The Open Source Notifications infrastructure For Developers

    GitHubXDiscord