Skip to content

Getting Started

The stack9 development environment is designed for local dev inside of containers and working with client customisations and debugging the core at the same time.

Requirements

Written in details in System Requirements

Getting up and running

Here are the steps to get running. They may vary from this as these steps are for Windows but Powershell Core is very similar across all there major platforms.

  1. Ensure you have the requirements installed
  2. Add host file entries How to Edit Your Hosts File on Windows, Mac, or Linux (howtogeek.com)
    • 127.0.0.1 minio
    • 127.0.0.1 azurite
  3. Ensure you have your execution policy set to allow local scripts to run.
    • To find your current execution policy you can run Get-ExecutionPolicy
    • Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
  4. Cloned down the relevant repositories next to each other.
    • stack9-core
    • client1-stack9
  5. Run run-tools.ps1 in the core repository to configure required steps, such as host file entries
  6. Run run-local.ps1 in the client repository and press y to install all the npm packages

Local containers

Locally the development environment is based on docker-compose. There are 4 images that make up the local development environment. The reason for splitting server and client is there is no easy way to enable hot reloading of both without them being separated. To emulate as close to production the expressjs app uses a http proxy to proxy requests for the react assets through to the client container.

  • Server (NodeJs ExpressJs app)
  • Client (Frontend React App)
  • PostgreSQL
  • MySQL

Ports exposed to the host machine are

  • 3333 - ExpressJS server
  • 5432 - PostgreSQL
  • 3306 - MySQL

Connecting to local databases

Inside of containers

When connecting inside of the docker-compose network you can use the container name as docker manages a DNS entry for each container in the docker-compose file.

  • postgres
  • mysql

From host machine

When connecting to the local databases you connect to localhost which is where docker will expose the port for you to connect to. We use the default port for both PostgreSQL and MySQL.

Resetting local environment

If you run into a situation where you need to clean up your local copy of stack9 and reset the databases you can use the run-tools.ps1 script to clean up the containers.

Run Tools commands

Run Local command