Home inventory and shopping list management built with a modern microservices architecture
MyโPantry is a full-stack web application developed as a personal project for managing pantry inventory and shopping lists. It showcases best practices using modern technologies such as microservices, JWT authentication, event-driven architecture, and Google API integration.
- Backend: Java, Spring Boot, Spring Security (JWT), Apache Kafka, Redis Cache
- Frontend: ReactJS with React Query and i18n
- Database: PostgreSQL
- DevOps: Docker, GitHub Actions (CI/CD)
- Integrations: Google API Client, Redis, Kafka
- User registration and login with Google Sign-in or traditional user/password
- ๐ Multi-language support (currently English and Portuguese)
- Pantry inventory management
- Shopping list creation and editing
- Fast, reactive UI with React Query
- Real-time updates via Kafka
- Redis caching for optimized performance
- RBAC and ability to share Pantries, Shopping Lists and Products among users.
- pantry-web (frontend): responsive UI using React Query and custom styles or Bootstrap
- account-service: REST endpoints for authentication, authorization, RBAC and account-related api
- pantry-service: REST endpoints for Pantry-related api
- purchase-service: REST endpoints for Purchase-related api
- commons, kafka, security and security-core: configurations and dependencies
The system follows a microservices architecture, with communication via Kafka and JWT-secured REST APIs. Below is the architectural diagram:
- Microservices with Spring Boot and Spring Security
- Kafka events for decoupled, event-driven processing
- JWT as http-only cookie for authentication
- Redis for caching
- RBAC
Microservice | Port | Description |
---|---|---|
account-service | 8082 | 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 |
pantry-service | 8080 | 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 isclosed Stores data in Postgres |
purchase-service | 8081 | 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 |
-
Docker & Docker Compose installed
-
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
-
Configure the environment variables in the docker-compose.yml:
- SECURITY_SECRET=
openssl rand -hex 64
- ALLOWED_ORIGINS= http://localhost:3000, http://localhost:8080, http://localhost:8081
- GOOGLE_CLIENT_ID= generated by Google
- GOOGLE_CLIENT_SECRET= generated by Google
- SECURITY_SECRET=
git clone https://github.com/FernandaCastro/my-pantry.git
cd my-pantry
mvn clean install
docker compose up --build
Once up and running:
- Frontend: http://localhost:3000
- Pantry API: http://localhost:8080/pantryservice
- Purchase API: http://localhost:8081/purchaseservice
- Account API: http://localhost:8082/accountservice
GitHub Actions for CI/CD: build, test, deploy
Unit and integration testing: JUnit & Mockito (backend)
Hereโs a quick guide to the main icons used in the UI:
Hereโs how the main interface looks, with icons for:
Mono Light (default) | Mono Dark | Lila Light | Lila Dark |
---|---|---|---|
![]() |
![]() |
![]() |
![]() |
version: 0.11.0
- pantry-web: v.0.10.0
- account-service: v0.5.0
- pantry-service: v0.7.0
- purchase-service: v0.5.0
-
pantry-web:
- Add alert to inform the use of essencial cookie
- Remove unused libraries
- Add "Delete Account" to the slide menu
- Add "View items" to Account Group in Group Members page
-
purchase-service:
- Delete Account data
-
lib-dependencies:
- refactoring
- Delete provisioned products from the shopping list (on Shopping List page)
- CRUD for Role and Permissions
This project demonstrates modern backend/frontend development using:
-
Microservices and event-driven architecture
-
Secure backend with Spring Security + JWT in Http only cookie
-
Modern frontend with React and state management via React Query
-
Containerized architecture with Docker for reproducibility
-
Integration of third-party services (Google API, Kafka, Redis)
Contributions are welcome! Feel free to open an Issue or Pull Request. Contact: @FernandaCastro on GitHub
This project is licensed under the MIT License.