JamiiFund is a modern, secure donation platform that connects generous donors with impactful community projects. Built with SvelteKit and integrated with Mpesa, it enables anonymous donations to verified social initiatives focused on clean water, education, and food security.
# Clone the repository
git clone https://github.com/steodhiambo/JamiiFund.git
cd JamiiFund
# Install dependencies
npm install
# Start development server
npm run dev
Option 1: Quick UI Testing (No Mpesa Setup)
# Just copy the example file - payments won't work but UI will
cp .env.example .env
npm run dev
# You can browse projects, see admin panel, but donations won't process
Option 2: Full Mpesa Testing
# 1. Copy example file
cp .env.example .env
# 2. Get Mpesa sandbox credentials from:
# https://developer.safaricom.co.ke/
# 3. Edit .env with your credentials:
MPESA_CONSUMER_KEY=your_actual_key
MPESA_CONSUMER_SECRET=your_actual_secret
MPESA_BUSINESS_SHORTCODE=174379
MPESA_PASSKEY=your_actual_passkey
MPESA_CALLBACK_URL=https://your-ngrok-url.com/api/mpesa/callback
# 4. Use ngrok for local testing:
# npx ngrok http 5173
** Access the application at:** http://localhost:5173
/admin/login
- password: admin123
)Get Mpesa Sandbox Credentials:
Setup Local Testing:
# Install ngrok for public URL
npm install -g ngrok
# Expose your local server
ngrok http 5173
# Copy the https URL to your .env file
Test Payments:
254708374149
/admin/login
admin123
)JamiiFund/
├── src/
│ ├── lib/
│ │ ├── components/ # Reusable UI components
│ │ ├── database.ts # SQLite database setup
│ │ ├── mpesa.ts # Mpesa payment integration
│ │ └── types.ts # TypeScript definitions
│ ├── routes/
│ │ ├── about/ # About page
│ │ ├── contact/ # Contact page
│ │ ├── admin/ # Admin dashboard
│ │ ├── api/ # API endpoints
│ │ └── project/ # Project pages
│ └── app.html # Main template
├── static/
│ └── images/ # Project images
└── README.md # Documentation
Method | Endpoint | Description |
---|---|---|
POST |
/api/donate |
Initiate donation process |
POST |
/api/mpesa/callback |
Mpesa payment callback |
GET |
/api/donation/status |
Check donation status |
Field | Type | Description |
---|---|---|
id |
INTEGER | Primary key |
title |
TEXT | Project title |
description |
TEXT | Project description |
goal_amount |
INTEGER | Funding goal (in cents) |
current_amount |
INTEGER | Current funding (in cents) |
image_url |
TEXT | Project image URL |
created_at |
DATETIME | Creation timestamp |
updated_at |
DATETIME | Last update timestamp |
Field | Type | Description |
---|---|---|
id |
INTEGER | Primary key |
project_id |
INTEGER | Foreign key to projects |
amount |
INTEGER | Donation amount (in cents) |
mpesa_transaction_id |
TEXT | Mpesa transaction reference |
phone_number |
TEXT | Donor phone number |
status |
TEXT | Payment status (pending/completed/failed) |
created_at |
DATETIME | Creation timestamp |
npm run build
npm run preview # Test production build locally
We welcome contributions! Please follow these steps:
git checkout -b feature/amazing-feature
)git commit -m 'Add amazing feature'
)git push origin feature/amazing-feature
)This project is licensed under the MIT License - see the LICENSE file for details.
For support, questions, or partnership opportunities: