After cloning the repo, setup local environments as follows:
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**.
Create .env
files for the “Local Full Stack Debugging” environment (as described in my dev.to article):
.vscode
folder, duplicate flowmazonapi.env.template
as flowmazonapi.env
and substitute the missing values (in angle brackets <...>
) from those you noted down above..vscode
folder, duplicate flowmazonfrontend.env.template
as flowmazonfrontend.env
and substitute the missing values (in angle brackets <...>
) from those you noted down above.Update the local database for “Local Full Stack Debugging” environment:
flowmazonbackend/flowmazonapi
on the terminal..envrc
file which points to ../../.vscode/flowmazonapi.env
, as described in my dev.to post.dotnet ef database update
to migrate the database to the current state of the EF Core model in flowmazonapi
project.Create .env
file for Full Stack Integration Testing (Playwright) environment (remember this is a Docker Compose-based setup that uses its own database container):
compose.env.template
as compose.env
<postgres user password>
in the new file with it.<app user password>
in the new file with it.<...>
) with the values you noted down above.Install NPM pacakges:
cd
into working directory (/
) and run npm install
.cd
into folder /flowmazonfrontend
and run npm install
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.