version: 0.10.0
- pantry-web: v.0.8.16
- account-service: v0.4.11
- pantry-service: v0.6.11
- purchase-service: v0.4.8
-
pantry-web:
- Big refactoring replacing the use of React Context by React-Query as a global state manager
- Use of react-query cache to improve the dashbord graph generation, fetching fresh data only when it's stale.
- Totally refactoring of App.js, removing context dependencies and isolating routes to avoid unnecessary re-rendering.
- Use of Link component from react-router-dom to correctly navigate among pages, avoiding complete re-render on transitions.
- Apply theme based on the user logging in. It's no more based on the last theme saved on the browser LocalStorage.
-
account-service:
- Remember Me Logic. When it's active, JWT and AUTH Cookie are valid for 30 days, otherwise it's valid for only 24 hours.
-
Delete provisioned products from the shopping list (on Shopping List page)
-
CRUD for Role and Permissions
My Pantry manages your pantries and creates shopping lists for you. Its core logic mechanism is the product
consumption.
Simply tell My Pantry that you opened a new package of pasta. The app will analyse the ideal and current quantities in your pantry, and in case the current quantity is below 50%, it will add Pasta to the Shopping List.
RBAC is managed by account-service and uses Redis as a cache support.You can also share your Pantries, Shopping Lists and Products with other users, by adding them to your Account Group.
The Authentication is possible by either Google Sign-in (Google IDToken - configure it as localhost callback) or by the traditional user/password. A JWT is generated and stored as a http-only cookie.
The frontend is developed in Reactjs and Javascript.
Backend is written in Java 17, based on Spring Boot and Spring Security. It uses Postgres as database, Redis as cache for RBAC and Kafka as prov/sub for asynch communication between pantry-service and purchase-service.
- Install Docker and Maven
- Generate SECURITY_SECRET by running command:
openssl rand -hex 64
- If you want to use Google Sign-in, then get a new Google Credentials for your MyPantry app:
- Log in at https://console.developers.google.com/apis
- Create a new project (MyPantry)
- Follow the instructions to configure it: https://developers.google.com/identity/gsi/web/guides/get-google-api-clientid
- Download the source code
- Configure the environment variables in the docker-compose.yml:
- SECURITY_SECRET= <SECURITY_SECRET>
- GOOGLE_CLIENT_ID= <CLIENT_ID generated by Google>
- GOOGLE_CLIENT_SECRET= <CLIENT_SECRET generated by Google>
- ALLOWED_ORIGINS= <SAMPLE: http://loocalhost:3000, http://localhost:8080, http://localhost:8081>
- Navigate to my-pantry folder
- Run:
mvn clean install
- Run:
docker-compose up -d
Themes:
Mono Light (default) | Mono Dark | Lila Light | Lila Dark |
---|---|---|---|
- Manages Accounts, Account Groups and Account Group Members
- Manages Roles and Permissions
- Acts as Authentication server:
- validating the Google IDToken or the user/password informed
- issuing an JWT Token embedded in a Http Only Cookie
- Acts as Authorization server:
- verify and retrieves permissions e/or objects associated to the user in a group
- Manages pantry, pantry items and products.
- Manages the consumption of the items in the pantry as well as their replenishment
- Sends events to purchase-service through a Kafka Topic (PurchaseCreateTopic) when PantryItem reaches the defined threshold (50%)
- Listens to Kafka Topic (PurchaseCompleteTopic) in order to update the Pantry Inventory once the Purchase Order is closed
- Stores data in Postgres
- Manages shopping lists
- Listens to Kafka Topic (PurchaseCreateTopic) to manage a list of items to be purchased
- Once the purchase is closed, an event is sent back to pantry-service through a Kafka Topic (PurchaseCompleteTopic)
- Stores data in Postgres