- Database:
discountmate(created and initialized) - Container:
app_db(PostgreSQL 16) - Running on port 5432 - Tables Created: 6 tables (user, store, product, product_pricing, wish, wishlist)
- pgAdmin: Available at http://localhost:5050
- Environment:
.envfile created inDE/data_pipeline/
# Connect to PostgreSQL from WSL
docker exec -it app_db psql -U postgres -d discountmate
# List all tables
docker exec app_db psql -U postgres -d discountmate -c "\dt"
# View table structure
docker exec app_db psql -U postgres -d discountmate -c "\d product"- Open browser: http://localhost:5050
- Login credentials:
- Email:
pgadmin@localhost.com - Password:
pgadmin
- Email:
- Add Server:
- Right-click "Servers" → "Create" → "Server"
- General tab: Name it (e.g., "DiscountMate App DB")
- Connection tab:
- Host name/address:
app_db(use this from inside Docker network) - Port:
5432 - Maintenance database:
discountmate - Username:
postgres - Password:
password - ✅ Check "Save password"
- Host name/address:
- Click "Save"
Note: If app_db doesn't work, try host.docker.internal or localhost
From any PostgreSQL client (DBeaver, TablePlus, psql, etc.):
- Host:
localhost - Port:
5432 - Username:
postgres - Password:
password - Database:
discountmate
postgresql://postgres:password@localhost:5432/discountmate
postgresql://postgres:postgres@localhost:5432/discountmate
The following tables were created by db_init:
- user - User accounts and profiles
- store - Store information and locations
- product - Product catalog
- product_pricing - Historical pricing data
- wish - Wish items
- wishlist - User wishlists
Note: The SQL schema also defines basket, shopping_list_item, and shopping_list tables, but these were not created by the Python script.
cd DE
docker-compose up -d postgrescd DE
docker-compose up db_initcd DE/data_pipeline
docker-compose up -d pgadmindocker ps | grep -E "app_db|pgadmin"If you want to use psql directly in WSL:
# For Ubuntu/Debian
sudo apt update
sudo apt install postgresql-client
# Then connect
psql -h localhost -p 5432 -U postgres -d discountmate
# Password: password- Make sure pgAdmin is on the same Docker network:
docker network connect de_openfga pgadmin - Use
app_dbas hostname (notlocalhost) when connecting from pgAdmin container - Verify container is running:
docker ps | grep app_db
- Only one PostgreSQL container can use port 5432 at a time
- Stop the other one:
docker stop postgresordocker stop app_db
- Run
db_initto create tables:cd DE && docker-compose up db_init - Or manually create from SQL:
docker exec -i app_db psql -U postgres -d discountmate < DE/data_pipeline/discountmate_schema.sql