Simple payment application utilizing Monorepo codebase architecture and Microservice deployment architecture.
The Monorepo codebase architecture was achieved without using any of the traditional build tools (e.g. Bazel, Pants).
- Simple CRUD operations
- Deposit and withdraw features
- Functionalities:
- Database
- REST API
- Admin panel
- Async events
- gRPC communication
- Double-entry ledger
- Simple transaction journal
- Functionalities:
- Database
- Admin panel
- Async events
- Bank API proxy middleman.
- Functionalities:
- Ephemeral
- gRPC communication
Service | Admin | Swagger |
---|---|---|
rabbitmq |
0.0.0.0:15672 | - |
ledger |
0.0.0.0:8201/admin/ | - |
wallet |
0.0.0.0:8200/admin/ | 0.0.0.0:8200/swagger/ |
Before anything, generate a JWT RS256
key-pair:
./scripts/keygen.sh
Make sure you have Docker and Docker Compose installed.
Build and start the services:
docker compose up
If any of the service builds fail, try manually building with
docker build -t dmm/<SERVICE> -f docker/<SERVICE>.Dockerfile .
Make sure you have Python 3.11.2 installed.
You also need to have PostgreSQL and RabbitMQ installed and running on your system.
Make all the .sh
files executable:
find . -type f -iname "*.sh" -exec chmod +x {} \;
Create and activate a virtual environment:
python -m venv .venv
source .venv/bin/activate
Install all the requirements:
./scripts/install.sh --all
To also additionally install the development requirements, use the
--develop
or-D
flag.
To install the requirements of only one service, run
./scripts/install.sh <SERVICE NAME>
Generate gRPC codes:
./scripts/codegen.sh
Run migrations for all services:
./scripts/manage.sh --all migrate
This will perform migrations for the
wallet
andledger
services.
To run migrations for only one service, run
./scripts/manage.sh <SERVICE NAME> migrate
Get a valid UUID for userID
from uuidgenerator.net.
Either run the following command:
./scripts/manage.sh wallet createwallet <userID>
or go to 0.0.0.0:8200/admin/wallet/wallet/add/ and manually create a wallet
record.
In deployment, you need to inspect into the
dmm-wallet
container for running the command.
With the userID
of an existing Wallet
, run the following command:
./scripts/manage.sh wallet generatetoken <userID>
You also need to inspect into the
dmm-wallet
container for running this command in deployment.
Import the collection at docs/dmm.postman_collection.json
into Postman.
Providing the success of Wallet Creation and using the token obtained from Token Generation, you can now test the APIs.