Introduction

This project was first created using the create-turbo npm package:

It is recommended that you read through the official documentation to understand the breakdown of the monorepo.

Changes to the official Turbo starter

The official Turbo starter is a great starting point for a monorepo, but it has some configurations I did not need. As I will not be sharing code between the backend and frontend (nor the docs), I have removed the packages/ui directory.

If you want to add a new package to the project, please reference the official documentation.

For quick reference:

  1. Create a new folder in packages/<folder>
  2. Add a package.json, with name and types pointing at src/index.ts[x]
  3. Add src/index.ts[x], with at least one named export
  4. Install your packages from root

Turbo.json

The currently configured turbo.json does not have many changes from the official starter. The only change is the addition of the globalEnv key.

{
  "globalEnv": [
    "NODE_ENV"
  ],
}

Without adding these environment variables to the globalEnv, you will receive an eslint error when referencing variables in your .env, however, your code will still work.

There are different ways that people solve this. While it’s possible to use
"globalDependencies": ["**/.env"], that did not work in this project.\