AidFlow is a web application built with SvelteKit that enables anonymous donations to social projects through M-Pesa integration. The platform provides an intuitive interface for donors and an administrative dashboard for tracking donations.
Before you begin, ensure you have the following installed:
Clone the repository:
git clone https://github.com/hanapiko/aidflow.git
cd aidflow
Install dependencies:
npm install
Create a .env
file in the root directory with the following variables:
```env
DB_HOST=localhost DB_USER=aidflow_user DB_PASSWORD=your_database_password DB_NAME=aidflow_db
MPESA_CONSUMER_KEY=your_consumer_key MPESA_CONSUMER_SECRET=your_consumer_secret MPESA_PASSKEY=your_passkey MPESA_SHORTCODE=your_shortcode MPESA_CALLBACK_URL=https://your-domain.com/api/mpesa/callback
NODE_ENV=development
4. Set up the database:
```bash
mysql -u root -p < schema.sql
To start the development server:
npm run dev
The application will be available at http://localhost:5173
aidflow/
├── src/
│ ├── lib/
│ │ ├── components/ # Reusable components
│ │ ├── database/ # Database configuration
│ │ └── mpesa.js # M-Pesa integration
│ ├── routes/
│ │ ├── admin/ # Admin dashboard
│ │ ├── api/ # API endpoints
│ │ └── projects/ # Project pages
│ └── styles/ # Global styles
├── static/ # Static assets
└── schema.sql # Database schema
POST /api/donations
: Create a new donation recordPOST /api/mpesa/stk
: Initiate M-Pesa STK PushPOST /api/mpesa/callback
: Handle M-Pesa payment callbacksGET /api/projects
: List all projectsGET /api/projects/:id
: Get project detailsThe application uses two main tables:
projects
: Stores project information and funding progressdonations
: Records all donation transactions and their statusgit checkout -b feature/AmazingFeature
)git commit -m 'Add some AmazingFeature'
)git push origin feature/AmazingFeature
)This project is licensed under the MIT License - see the LICENSE file for details.