|
| 1 | +# E-Wallet |
| 2 | + |
| 3 | +This is a simple E-Wallet application that can be accessed via USSD interface. The application allows users to create an account, top up their wallet, make withdrawals, and request for balance and statements. The main notification channel for the application is via SMS. |
| 4 | + |
| 5 | +## Table of Contents |
| 6 | + |
| 7 | +- [Technologies](#Technologies) |
| 8 | +- [Features](#Features) |
| 9 | +- [Installation](#Installation) |
| 10 | +- [Testing](#Testing) |
| 11 | +- [interaction](#interaction) |
| 12 | +- [License](#license) |
| 13 | + |
| 14 | +## Technologies |
| 15 | + |
| 16 | +The application is built using the following technologies: |
| 17 | + |
| 18 | +- Python: Programming language used to build the application |
| 19 | +- Flask: Web framework used to create the USSD application |
| 20 | +- PostgreSQL: Relational database used to store user information and transaction details |
| 21 | +- Redis: Used for efficient scheduling of tasks |
| 22 | +- Africa's Talking API: Used for payment handling and SMS notifications to users |
| 23 | + |
| 24 | +## Features |
| 25 | + |
| 26 | +The application offers the following features: |
| 27 | + |
| 28 | +- Account Creation: Users can create an account by entering their name and phone number. |
| 29 | +- Top Up: Users can top up their wallet by entering the amount they wish to add. |
| 30 | +- Withdraw: Users can withdraw money from their wallet by entering the amount they wish to withdraw. |
| 31 | +- Check Balance: Users can check their wallet balance by selecting the balance option from the menu. |
| 32 | +- Request Statement: Users can request for their transaction statement by selecting the statement option from the menu. |
| 33 | + |
| 34 | +## Installation |
| 35 | + |
| 36 | +To install and run the application, follow these steps: |
| 37 | + |
| 38 | +1. Clone the repository to your local machine. |
| 39 | +2. Install the Poetry dependency manager by following the instructions [here](https://python-poetry.org/docs/). |
| 40 | +3. Install the dependencies using `poetry install`. |
| 41 | +4. Create a PostgreSQL database and update the database URI in the `config.py` file. |
| 42 | +5. Create an account with Africa's Talking and obtain your API key and username. |
| 43 | +6. Update the Africa's Talking API credentials in the `config.py` file. |
| 44 | +7. Start the application using `poetry run python app.py`. |
| 45 | + |
| 46 | +## Testing |
| 47 | + |
| 48 | +The application was developed using a test-driven approach, and tests are included in the `tests` folder. To run the tests, execute `poetry run flask test` from the command line. |
| 49 | + |
| 50 | +## Continuous Integration/Continuous Deployment |
| 51 | + |
| 52 | +The application is deployed to an AWS EC2 instance using a CI/CD pipeline with GitHub Actions. The pipeline automatically tests and deploys the application whenever code is pushed to the `main` branch. The configuration for the pipeline can be found in the `.github/workflows/deploy.yml` file. |
| 53 | + |
| 54 | +## How It Works |
| 55 | + |
| 56 | +### Account Creation |
| 57 | + |
| 58 | +When a user dials the USSD code, they are prompted to create an account by entering their name and phone number. |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | +### Top Up |
| 63 | + |
| 64 | +Users can top up their wallet by entering the amount they wish to add. |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | +### Withdraw |
| 69 | + |
| 70 | +Users can withdraw money from their wallet by entering the amount they wish to withdraw. |
| 71 | + |
| 72 | + |
| 73 | + |
| 74 | +### Check Balance |
| 75 | + |
| 76 | +Users can check their wallet balance by selecting the balance option from the menu. |
| 77 | + |
| 78 | + |
| 79 | + |
| 80 | +### Request Statement |
| 81 | + |
| 82 | +Users can request for their transaction statement by selecting the statement option from the menu. |
| 83 | + |
| 84 | + |
| 85 | + |
| 86 | +## Application Desing. |
| 87 | + |
| 88 | +### Database Design |
| 89 | + |
| 90 | +### User Registration Sequence |
| 91 | + |
| 92 | +### Account Activation Sequence |
| 93 | + |
| 94 | + |
| 95 | +### Account Deactivation Sequence |
| 96 | + |
| 97 | + |
| 98 | +### Account Topup Sequence |
| 99 | + |
| 100 | + |
| 101 | +### Account withdraw Sequence |
| 102 | + |
| 103 | + |
| 104 | +### Account Balance Request Sequence |
| 105 | + |
| 106 | + |
| 107 | +### Account Statement Request Sequence |
| 108 | + |
| 109 | + |
| 110 | +### User Initiated C2B Topup Sequence |
| 111 | + |
| 112 | + |
| 113 | +## License |
| 114 | + |
| 115 | +This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. |
0 commit comments