A simple example of how MPESA works. Works with all 3 types of customers i.e. Agents, Merchants and Subscribers. Allows you to configure a tariff and apply it to transactions. The project follows DDD principles.
# Simple MPESA RESTful API
As the name of the project suggests, this is a simple implementation of MPESA. If you are East-African you already know what
MPESA is, but if you don't, I will have a description herein to help you understand inner workings that you may not have been
aware of.
*Click here to learn about What MPESA is*
## System Design And Architecture
Whatever follows, is the design and architecture of our simple MPESA application.
### System Architecture
This application is built as a `Monolith` application following Domain Driven Design principles. The application uses a
postgres database for storage.
### System Design
Domain Driven Design is at the heart of our simple mpesa application.
#### Bounded Contexts
DDD principles have concepts called contexts. The application uses the following bounded contexts:
1. Admin
2. Agent
3. Merchant
4. Subscriber
5. Transaction
6. Account
7. Statement
8. Tariff
9. Auth
10. Customer
##### 1. Admin Context
The application needs some form of administration by a super user charge with the responsibility of running and maintaining
the application to ensure reliability and stability. This user is an `admin` and is given their own bounded context. Some
responsibilities/actions of this user are:
1. Can login to system or register.
2. Can assign float to a Super Agent.
3. Can configure tariff
4. Can suspend/change status of a customer account
5. Can view/edit/delete customer accounts
As the application grows and scales the administrator context would have more responsibilities.
1. The application would need more than one administrator and more so more than one category of administrators. In the
case of MPESA, some examples of administrators with their roles include:
i. Customer Care - is a part admin who would assist customers with information about the system and troubleshoot
problems.
ii. Finance - is a part admin whose responsibilities would be financial and accounting aspect in the system.
iii. IT - an adm …