The general Idea of this repo it's to test how to implement a microservices infra using docker and aspnetcore.
I will only focus on the CHKTR (a join between CheKout and caRT... that I misspell as CHecKout c{K}a TR when creating the folder ¯\(ツ)/¯ )
After downloading the code run .\up.ps1
from a powershell console.
Then access the API using http://localhost:8181/
in brwoser to see the Swagger UI.
You can also run the test-console
app:
(assuming you have a console open at the project root level)
cd test-console
dotnet run -- <ADDRESS_TO_API>
First you need to specify a redis server in appSettings.Development.json
.
There is always the option of running docker-compose up -d redis
from the project's root and use the docker version (in that case there is nothing to change in appSettings
).
Once you have Redis running you can go ahead and run .\api\rundev.ps1
from the project's root in a PS console.
Then you can access the SwaggerUI at http://localhost:5000
.
This is the cart service that a client (yet to be done) will use to handle whatever their customers want to buy. This project will not take care of the payment process.
You can find the test for it under [root]\tests\ApiTests
.
To Debug:
- run the task
debug api test proj
(fromCTRL+SHIFT+P
>Tasks: Run task
). - Switch to Debug Panel (
CTRL+SHIFT+D
) ad pickdebug-tests
- Hit Play and pick the process id from step 1
There is also a runWatch.ps1
under [root]\tests\ApiTests
scripts that you can run and see how tests get re-run after every change you save.
This will contain the shared model between the client and the API.
This will be an assembly that anyone can use to easily access the chktr-api API.
You can find the test for it under [root]\tests\ClientTests
.
To Debug:
- run the task
debug client test proj
(fromCTRL+SHIFT+P
>Tasks: Run task
). - Switch to Debug Panel (
CTRL+SHIFT+D
) ad pickdebug-tests
- Hit Play and pick the process id from step 1
There is also a runWatch.ps1
under [root]\tests\ClientTests
scripts that you can run and see how tests get re-run after every change you save.
An ApiKey will be handled to the dev that want to use this service and, by using the client, the dev can connect it's project to our service and add a cart to it's website.
- Enhance Model (ie.: add an Key to CartItem)
- Fix Code Coverage to increate it up to 80%
- Add some UTs for CartService
- Add a dashboard to generate the dev Key.
- Add E2E Test.
- Add an MVC sample App.
- Rename same projects.
- Add a new redis subkey to separate Carts by client.