Sample shopping cart implementation from the book Microservices in .NET Core by Christian Horsdal Gammelgaard, ISBN 9781617293375.
Running .NET 5.0 on a Raspberry Pi with a 64-bit operating system inside a Docker container.
- Clone the repository into an IDE
- Build the project: debug configuration
- Verify 22 unit tests pass
- Debug the unit tests
- Breakpoint: ShoppingCartController.cs, line 55
- Debug: ShoppingCartControllerTest.cs, AddCartItemTest()
- Start with a Raspberry Pi
- Install a 64-bit operating system
- Install Docker
- Select arm64 in step three
- Install Docker-Compose
- Use the Alternative Install Options
sudo apt install python3-pip
pip3 install docker-compose
export PATH="$PATH:$HOME/.local/bin"
- Clone the repository
sudo apt install git
git clone https://github.com/GregEakin/Microservices.git
cd Microservices
docker-compose build
docker-compose up -d
docker-compose ps
- Database PostgreSQL: host rpi, port 5432, user cartapp, pass cartpw
- Manually add UserIds to Shopping Cart table
- Review the API: Postman
- ProductCatalogSvc: http://rpi:8086/swagger/index.html
GET http://rpi:8086/api/Products/products?id=0&id=19
- ShoppingCartSvc: http://rpi:8087/swagger/index.html
POST http://rpi:8087/api/ShoppingCart/14/items [0,19]
GET http://rpi:8087/api/ShoppingCart/14
DELETE http://rpi:8087/api/ShoppingCart/14/items [0,19]
- ProductCatalogSvc: http://rpi:8086/swagger/index.html
docker-compose down --volumes
docker-compose push
- REST ASP.NET interface
- Persistence storage - Database
- Get cart contents
- Add products to the cart
- Empty the cart
- Ask Product Catalog for information
- Caching Product Catalog information
- Generate event notifications
- Unit Tests
- REST ASP.NET interface
- Returns dummy information
- Unit Tests
- Product Copy and Pictures
- Inventory Events
- Customers
- Reservations
- Promotions
- Save for Later
- Suggestions
- Send reminders
- Event Logging
- Customers
- Inventory
- Suppliers
- Shippers
- Promotions
- Accounting
- Security
- Performance
- Feedback
- Wish List
- Collections
- Advertising
- Browsing History
- Help