# MediFind Rwanda 🇷🇼
### Real-Time Medication Stock Tracker
*African Leadership University | Prepared by: TETA SARO Cindy*
---
## Quick Start
### 1. Backend
```bash
cd backend
npm install
cp .env.example .env # Fill in your values
npm run migrate # Create all 9 database tables
npm run seed # Insert 30 medicines + test facilities
npm run dev # Start API on port 5000
```
### 2. Frontend
```bash
cd frontend
npm install
npm start # Open React app on port 3000
```
### 3. Database (PostgreSQL + PostGIS required)
```sql
CREATE DATABASE medifind_rwanda;
CREATE USER medifind_user WITH PASSWORD 'yourpassword';
GRANT ALL PRIVILEGES ON DATABASE medifind_rwanda TO medifind_user;
\c medifind_rwanda
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE EXTENSION IF NOT EXISTS "postgis";
```
---
## MTN SMS Sandbox Setup
1. Go to
developers.mtn.com
2. Sign up → My Apps → Create New App → Subscribe to SMS API
3. Copy your API Key, API Secret, Subscription Key
4. Add to your .env file:
MTN_API_KEY=your_key
MTN_API_SECRET=your_secret
MTN_SUBSCRIPTION_KEY=your_subscription_key
5. Change NODE_ENV=production in .env to enable real SMS sending
(In development mode, SMS messages are logged to the console only)
---
## All API Endpoints
### Auth (/api/auth)
| POST | /patient/register | Register patient |
| POST | /patient/login | Patient login |
| POST | /staff/login | Staff login |
| POST | /admin/login | Admin login |
| POST | /facility/register | Register new facility |
| POST | /otp/send | Send OTP via SMS |
| POST | /otp/verify | Verify OTP |
| POST | /password/reset | Reset password |
| GET | /me | Get current profile |
### Drugs (/api/drugs)
| GET | / | All drugs |
| GET | /search?q= | Autocomplete search |
| GET | …