After cloning the repo, setup local environments as follows:

  1. Set up local PostgreSQL database: This is used for local development and debugging (via VS Code launch configurations and when generating migrations) whereas local continuous testing setup which uses Docker Compose creates its own, new database container separate from this every time docker compose up is run.

Ensure that the local database is set up as follows: - Make sure PostgreSQL is installed on your machine. - Create a database named FlowmazonDB in your local PostgreSQL server. - Using pgAdmin, right-click the database you just created and select Query tool (or connect to the database using some other tool for executing queries such as psql) - Execute the following script against FlowmazonDB database.

This creates a user named `flowmazon_app_user` and assigns privileges to it on the database. We don't want to use the superadmin `postgres` user from the app, hence why we are creating a dedicated user for the database with enough privileges for development:
    
    ```sql
    CREATE USER flowmazon_app_user WITH PASSWORD '<pick a strong password>';
    ALTER DATABASE FlowmazonDB OWNER TO <username you picked>;
    
    ```
    
- **Temporarily note down the password somewhere safe**.
  1. Setup Grafana Cloud for local environments by following instructions given on Grafana Cloud Setup page.

  1. Create .env files for the “Local Full Stack Debugging” environment (as described in my dev.to article):

    1. In .vscode folder, duplicate flowmazonapi.env.template as flowmazonapi.env and substitute the missing values (in angle brackets <...>) from those you noted down above.
    2. In .vscode folder, duplicate flowmazonfrontend.env.template as flowmazonfrontend.env and substitute the missing values (in angle brackets <...>) from those you noted down above.
  2. Update the local database for “Local Full Stack Debugging” environment:

    1. Navigate to the folder flowmazonbackend/flowmazonapi on the terminal.
    2. Create an .envrc file which points to ../../.vscode/flowmazonapi.env, as described in my dev.to post.
    3. run dotnet ef database update to migrate the database to the current state of the EF Core model in flowmazonapi project.
  3. Create .env file for Full Stack Integration Testing (Playwright) environment (remember this is a Docker Compose-based setup that uses its own database container):

    1. Go to solution root and duplicate compose.env.template as compose.env
    2. Pick a strong password and replace <postgres user password> in the new file with it.
  4. Install NPM pacakges:

    1. cd into working directory (/) and run npm install.
    2. cd into folder /flowmazonfrontend and run npm install
  5. Install Playwright Browsers (these are needed for Playwright tests to run):

****In the same folder on the terminal (i.e. /flowmazonfrontend), run npx playwright install. This installs Playwright's browsers etc.