Proof of Concept (PoC) for a mobile app store controller, supporting sell operation.
pip install -e git+ssh://[email protected]/91nunocosta/store.git#egg=appstore
Enter the appstore
Read-Eval-Print Loop (REPL) Command Line Interface (CLI),
and type help
.
appstore
>help
See the internal API's documentation here.
The implementation includes the following classes:
The PoC focuses on app sales business logic, implemented in appstore
module.
In a real world-scenario, some steps would likely follow:
-
Implementing app persistence and distributed access. I.e., providing an
AppsDB
interface connected to a database. -
Implementing user persistence and distributed access. I.e., providing an
UsersDB
interface connected to a database. There could be a combination of DBMS. We could keep the purchases counter in a key-value memory DB as Redis. -
Implementing a full-fledged
AccountsController
. It likely implies connecting to external services. Such services could support functionalities such as currency exchange. They could accept accounts in many currencies and perform the transferences accordingly.
If you want to test or change the source code, prepare your local environment.
-
Clone the repository.
git clone [email protected]:91nunocosta/store.git
-
Change to the project directory.
cd appstore
-
Install poetry package and dependency manager. Follow the poetry installation guide. Chose the method that is more convenient to you, for example:
curl -sSL\ https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py \ | python -
-
Create a new virtual environment (managed by poetry) with the project dependencies.
poetry install --with lint --with test --with cd
-
Activate the virtual environment.
poetry shell
Pre-commit runs the linters configured in .pre-commit-config.yaml.
You can run it as follows:
-
Prepare the development environment, as described in Preparing the development environment.
-
Run pre-commit with all files.
pre-commit run --all-files
You can execute all tests and test coverage with tox.ini.
-
Prepare the development environment, as described in Preparing the development environment.
-
Run tox.
tox