Documentation
Developing locally

Developing locally

Let's finally get our fingers dirty and start developing locally.

Spin up the infrastructure

First, make sure you use a node version higher than 18.17 (preferrably 20.14). Run the following command to make sure you have the right version:

nvm use 20.14

Let's start our SST script using the following command:

npx sst dev

The first time you run this, it will ask you to choose a stage name. While developing locally, simply call it by your name (i.e. maxim). Your infrastructure at AWS will be namespaced to this stage name.

Now sst will deploy all your infrastructure to AWS (yes, even for local development) and route all incoming requests via websockets to your local machine while developing locally. This makes cloud development a breeze. Checkout our introduction to SST or the SST docs (opens in a new tab) for more information on how that works.

Aditionally, it will run a development server for your Next.js apps in the same terminal.

Email Templates

To develop your email templates locally, you can start a development server for your React Email Templates using the following command:

Otherwise, you can start each development server individually:

cd ./packages/transactional
pnpm run dev

Localhost Ports

  • Open http://localhost:3001 to see your landing page
  • Open http://localhost:3001/docs to see your documentation website
  • Open http://localhost:3000/ to see your main SaaS application
  • Open http://localhost:5001 to see your React Email Template Development Server