This project is a very naive implementation of a simple shop system. It mimics in its structure a real world example of a service that was prepared for being split into microservices and uses the current Helu backend tech stack.
Please answer the following questions:
- Why can we not easily split this project into two microservices?
- Why does this project not adhere to the clean architecture even though we have seperate modules for api, repositories, usecases and the model?
- What would be your plan to refactor the project to stick to the clean architecture?
- How can you make dependencies between modules more explicit?
Please do not spend more than 2-3 hours on this task.
Stretch goals:
- Fork the repository and start refactoring
- Write meaningful tests
- Replace the SQL repository with an in-memory implementation
- Clean Architecture by Uncle Bob
- Clean Architecture in Python
- A detailed summary of the Clean Architecture book by Uncle Bob
If you have not installed poetry you find instructions here.
docker-compose up
- runs a postgres instance for developmentpoetry install
- install all dependency for the projectpoetry run schema
- creates the database schema in the postgres instancepoetry run start
- runs the development server at port 8000/postman
- contains an postman environment and collections to test the project
poetry run graph
- draws a dependency graph for the projectpoetry run tests
- runs the test suitepoetry run lint
- runs flake8 with a few pluginspoetry run format
- uses isort and black for autoformatingpoetry run typing
- uses mypy to typecheck the project
- As a customer, I want to be able to create an account so that I can save my personal information.
- As a customer, I want to be able to view detailed product information, such as price, quantity available, and product description, so that I can make an informed purchase decision.
- As a customer, I want to be able to add products to my cart so that I can easily keep track of my intended purchases.
- As an inventory manager, I want to be able to add new products to the system so that they are available for customers to purchase.