This is a Flask-based web application that allows users to send M-Pesa STK (SIM Tool Kit) push requests. Users can sign up, log in, register their businesses, and initiate STK push requests for both Paybill and Buy Goods and Services transactions.
- User Authentication (Signup and Login)
- JWT-based session management
- Business Registration
- M-Pesa STK Push initiation
- Support for Paybill and Buy Goods and Services transactions
- Backend: Python with Flask
- Frontend: HTML, CSS, JavaScript (jQuery)
- Database: SQLAlchemy (ORM)
- Authentication: JWT (JSON Web Tokens)
- API: M-Pesa API integration
/
├── __pycache__/
├── src/
│ ├── dashboard.html
│ ├── login.html
│ ├── signup.html
│ └── styles.css
├── __init__.py
├── config.py
├── extensions.py
├── models.py
├── OAuth.py
├── qr.py
├── routes.py
└── stk_push.py
-
Clone the repository:
git clone https://github.com/lordlegacy/Densowave.git cd densowave
-
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
-
Set up your environment variables: Create a
.env
file in the root directory and add the following:SECRET_KEY=your_secret_key DATABASE_URL=your_database_url CONSUMER_KEY=your_mpesa_consumer_key CONSUMER_SECRET=your_mpesa_consumer_secret PASSKEY=your_mpesa_passkey
-
Initialize the database:
flask db init flask db migrate flask db upgrade
-
Run the application:
python app.py
-
Open your web browser and navigate to
http://localhost:5000
- Sign up for a new account or log in if you already have one.
- Once logged in, you'll be directed to the dashboard.
- Register your business by providing the required details.
- Initiate an M-Pesa STK push by filling out the transaction form.
/auth/register
- User registration/auth/login
- User login/auth/refresh
- Refresh JWT token/business/register
- Register a new business/business/view
- View registered business information/business/update
- Update business information/stk_push/stk
- Initiate M-Pesa STK push
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.