Skip to content

christiankaseburg/average.dev

Repository files navigation

average.dev Monorepo

🛠️ Local Setup & Prerequisites

Welcome to the average.dev monorepo! Before you begin, ensure your local development environment is set up.

1. Node.js & NVM

1. Node.js & Fast Node Manager (fnm)

This repository enforces strict Node.js versioning via the .nvmrc file at the root. We strongly recommend using Fast Node Manager (fnm):

  • Windows: winget install Schniz.fnm
  • macOS/Linux: brew install fnm or curl installation.

Once installed, ensure your terminal profile is configured for fnm. For PowerShell, you must run this to apply it to your current session, and also add it to your profile for future sessions:

# Apply to current session:
fnm env --use-on-cd | Out-String | Invoke-Expression

# Add to profile for future sessions:
notepad $PROFILE
# Add the line below to the bottom and save.
fnm env --use-on-cd | Out-String | Invoke-Expression

After configuring your terminal, navigate to the repository root. If this is your first time setting up the repository, download the required Node version specified in .nvmrc:

fnm install

fnm will now automatically switch to the correct Node version whenever you enter the directory.

2. Yarn

We use Yarn as our package manager. With the correct Node version active via fnm, enable Yarn via Corepack:

corepack enable yarn
yarn install

Note

Node.js ships with Corepack but it is opt-in by default. Running corepack enable yarn makes the yarn command available in your terminal without needing a global npm install, and guarantees you use the exact Yarn version specified in the project.

Warning

If you get an error saying corepack: The term 'corepack' is not recognized or yarn: The term 'yarn' is not recognized, it means fnm was not loaded into your current shell. You can fix this immediately by running:

fnm env --use-on-cd | Out-String | Invoke-Expression

3. Go (Golang)

If you are working on Go services within this monorepo, you need the Go toolchain installed:

  • Windows: Download the MSI installer from go.dev/dl/.
  • macOS: brew install go
  • Verify installation by running go version. We use golangci-lint for linting, which is configured via .golangci.yml.

✨ Your new, shiny Nx workspace is ready ✨.

Learn more about this workspace setup and its capabilities or run yarn nx graph to visually explore what was created. Now, let's get you up to speed!

Run tasks

To run tasks with Nx use:

npx nx <target> <project-name>

For example:

npx nx build myproject

These targets are either inferred automatically or defined in the project.json or package.json files.

More about running tasks in the docs »

Add new projects

While you could add new projects to your workspace manually, you might want to leverage Nx plugins and their code generation feature.

To install a new plugin you can use the nx add command. Here's an example of adding the React plugin:

npx nx add @nx/react

Use the plugin's generator to create new projects. For example, to create a new React app or library:

# Generate an app
npx nx g @nx/react:app demo

# Generate a library
npx nx g @nx/react:lib some-lib

You can use npx nx list to get a list of installed plugins. Then, run npx nx list <plugin-name> to learn about more specific capabilities of a particular plugin. Alternatively, install Nx Console to browse plugins and generators in your IDE.

Learn more about Nx plugins » | Browse the plugin registry »

Set up CI!

Step 1

To connect to Nx Cloud, run the following command:

npx nx connect

Connecting to Nx Cloud ensures a fast and scalable CI pipeline. It includes features such as:

Step 2

Use the following command to configure a CI workflow for your workspace:

npx nx g ci-workflow

Learn more about Nx on CI

Install Nx Console

Nx Console is an editor extension that enriches your developer experience. It lets you run tasks, generate code, and improves code autocompletion in your IDE. It is available for VSCode and IntelliJ.

Install Nx Console »

Useful links

Learn more:

And join the Nx community:

About

Mono repository for the average.dev LLC

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors