Welcome to the Iced Latte! This guide will assist you in setting up and running the application using Docker and Docker Compose.
Ensure you have Docker Desktop installed.
Key variables which are used in the startup of the app. They are pre-configured for initial use, can be adjusted to tailor the app's startup settings.
APP_PROFILE
: Application profile (e.g.,dev
)APP_VERSION
: Application versionAPP_SERVER_PORT
: Server port for the backend serviceDATASOURCE_URL
: JDBC URL for the PostgreSQL databaseDATASOURCE_PORT
: Database portDATASOURCE_NAME
: Database nameDATASOURCE_USERNAME
: Database usernameDATASOURCE_PASSWORD
: Database passwordREDIS_HOST
: Redis hostREDIS_PORT
: Redis portAWS_ACCESS_KEY
AWS access keyAWS_SECRET_KEY
AWS secret keyAWS_REGION
AWS regionAWS_PRODUCT_BUCKET
AWS product's bucket nameAWS_USER_BUCKET
AWS product's bucket nameAWS_DEFAULT_PRODUCT_IMAGES_PATH
Package with product's filesSTRIPE_SECRET_KEY
Stripe secret key for payment session creationSTRIPE_WEBHOOK_SECRET
Stripe secret key for webhook
Refer to docker-compose.local.yml
To start the application containers with the latest build:
docker-compose -f docker-compose.local.yml up -d --build
To start both the backend and PostgreSQL database services as defined in the docker-compose.yml
file:
docker-compose -f docker-compose.local.yml up -d
To start only the PostgreSQL database as defined in the docker-compose.local.yml file:
docker-compose -f docker-compose.local.yml up -d iced-latte-postgresdb
docker-compose -f docker-compose.local.yml build
To stop all running containers:
docker-compose -f docker-compose.local.yml down
To view logs for a specific service:
docker-compose -f docker-compose.local.yml logs [iced-latte-backend|iced-latte-postgresdb] [-f]
docker-compose -f docker-compose.local.yml down -v
If you want to debug BE application running in Docker, use Remote JVM Debug configuration:
-
Double press Shift
-
Type
Edit Configurations
-
Click
+
and selectRemote JVM Debug
-
Select Attach to Remote JVM, make sure that port is
5005
and host islocalhost
-
Save configuration and click debug button
-
Start containers as usual
docker compose -f docker-compose.local.yml up -d --build
-
Set a breakpoint, e.g. here ProductsEndpoint#getProducts
-
Try it out:
curl -X 'GET' \ 'http://localhost:8083/api/v1/products?page=0&size=50&sort_attribute=name&sort_direction=desc' \ -H 'accept: application/json'
Enjoy!
To run FE and BE locally for testing purposes:
- Check out Iced Latte Frontend repo
- Navigate to the root of FE repo and create
.env
:bash echo 'NEXT_PUBLIC_API_HOST_REMOTE=http://localhost:80/backend/api/v1' > .env
- Uncomment
iced-latte-frontend.build
section in docker-compose.local.yml - Set path to local FE repo in
iced-latte-frontend.build.context
- Run build as usual
docker compose -f docker-compose.local.yml up -d --build
- FE is here http://localhost/
- BE is here http://localhost/backend (e.g. http://localhost/backend/api/v1/products) and here too http://localhost:8083
AWS is available only in production, therefore there are no real pictures of products, only stubs.
- Install Stripe CLI
- Redirect webhook events
stripe listen --forward-to localhost:80/backend/api/v1/payment/stripe/webhook
- Use test cards:
4242424242424242
For Ultimate Edition consider using Database Tools and SQL plugin
Install Database Navigator.
Go to View > Tool Windows > DB Browser.
Add new PostgresSQL connection:
- Host
127.0.0.1
- Database
testdb
- User
postgres
- Password
postgres
Enjoy!