Getting Started
Prerequisites
Nx
We recommend installing Nx globally, all Nx based commands in this guide are based upon a globally installed Nx package.
- npm
- yarn
npm install -g nx
yarn global add nx
Node
We recommend using the latest LTS version of Node, you can find the latest LTS version here.
Get Started
There are three ways to get started with building an SSR (Next JS) frontend web application with Ensono Stacks, we recommend using our Ensono Stacks CLI for the best experience!
Option 1: Ensono Stacks CLI
The Ensono Stacks CLI is a command line interface that allows you to scaffold a brand new Ensono Stacks and Nx workspace. This is the recommended approach if you are planning to use Ensono Stacks to build your infrastructure as well as your frontend web applications.
Once the Ensono Stacks CLI has been installed you can scaffold a brand new Ensono Stacks and Nx workspace through answering a set of interactive questions. Launch the Ensono Stacks CLI with the following command to get started:
stacks-cli interactive
Visit the Ensono Stacks CLI docs for more information and setup instructions!
Visit the NX Example for the complete instructions/example on using NX with the Ensono Stacks CLI!
Option 2: Create Ensono Stacks workspace generator
You can scaffold a brand-new Ensono Stacks and Nx workspace using the @ensono-stacks/create-stacks-workspace package.
This approach is ideal if you want to use Ensono Stacks to build your frontend web applications but already have an existing infrastructure set up without Ensono Stacks as it's not mandatory to provide any infrastructure details.
Follow the interactive questions with the below command to get started:
npx @ensono-stacks/create-stacks-workspace@latest
Visit the @ensono-stacks/create-stacks-workspace docs for more information and setup instructions!
Option 3: 'Stackify' your existing Nx monorepo
If you already have an Nx monorepo, you can still utilise Ensono Stacks!
Visit the @ensono-stacks/workspace docs for more information and setup instructions!
Ensono Stacks Plugins
To accelerate your project development and ensure consistency across those projects, we have several Ensono Stacks plugins available!
Plugin | Description |
---|---|
@ensono-stacks/create-stacks-workspace | Create an Nx workspace using Ensono Stacks! |
@ensono-stacks/workspace | 'Stackify' your existing Nx workspace |
@ensono-stacks/next | Enhance your Next.js project with Ensono Stacks! |
@ensono-stacks/azure-node | |
@ensono-stacks/azure-react | |
@ensono-stacks/rest-client | Add a rest client to a project in your Ensono Stacks workspace |
@ensono-stacks/playwright | Add the playwright testing library and much more to your project! |
@ensono-stacks/logger | Add industry standard logging capabilities to your project |
Further Notes
Quite a few of our generators have a safeguard of sorts to prevent running them subsequent times. This has been implemented to prevent accidental overwriting of further developed custom code following an understanding that most likely multiple runs would not be required anyway. However, if for your own reasons you would like to re-run such a generator, then you are simply required to remove the relevant project/generator or workspace/generator name entry within the stacks
-> executedGenerators
fields within nx.json
.