PharmaLink is a pharmacy management web application built for Rwanda's pharmacy network. It allows users to search for medicines, find pharmacies that have them in stock, place orders, and pay online via Stripe. Staff can manage inventory and orders, while admins have full control over users, pharmacies, medicines, inventories, orders, and payments.
| Service | Platform | URL |
|---|---|---|
| Frontend | Vercel | https://pharmalinkrwanda.vercel.app |
| Backend | Render | https://pharmalink-16j6.onrender.com/api/v1 |
Note: The backend is hosted on Render's free tier and may take 30–60 seconds to wake up after a period of inactivity. If the app feels slow on first load, wait a moment and try again.
- Users — sign up, log in, search medicines by name, view pharmacies and their inventory, place orders, pay via Stripe, and manage their profile
- Staff — manage inventory for their pharmacy, view and update orders and payments
- Admins — full CRUD access to users, pharmacies, medicines, inventories, orders, and payments via a dedicated dashboard
Frontend
- React + React Router
- Vite
- Axios
- Stripe.js
Backend
- Node.js + Express
- MongoDB + Mongoose (MongoDB Atlas)
- Stripe (payments)
- JWT (authentication)
- Helmet, CORS, rate limiting, XSS protection
Make sure you have the following installed on your machine before running the project locally:
- A MongoDB Atlas account with a cluster set up
- A Stripe account for handling payment
- git clone https://github.com/ralphishimwe/PharmaLink.git
- cd PharmaLink
- npm install
This project requires environment variables to run locally and in production.
A full list of required variables and their values can be found here - Copy and paste all the variables and their values inside your new config.env file: Link: https://docs.google.com/document/d/12wauGNtxjV_gk5iVCyqENEll6J2fbAUdMebQ1tSjSmY/edit?usp=sharing
- npm start
The backend will run on http://localhost:9000.
- cd frontend
- npm install
- npm run dev
The app will open at http://localhost:5173.
To allow to test the application without creating privileged accounts:
Use the following credentials to log in as an admin:
Email: admin@pharmalink.test Password: Admin1234
Use the following credentials to log in as a staff/facilitator:
Email: staff@pharmalink.test Password: Staff1234
Note: Only admins can create new staff or admin accounts. Use the provided credentials for testing.
The frontend and backend were deployed on two separate platforms.
- Push code to GitHub
- Import the repo on Vercel
- Set the Root Directory to
frontendin Vercel project settings - Add this environment variable in the Vercel dashboard under Settings → Environment Variables: VITE_API_URL = https://pharmalink-16j6.onrender.com/api/v1
- Deploy — Vercel rebuilds automatically on every push
- Create a new Web Service on Render pointing to repository
- Set the Root Directory to the repo root (where
server.jslives) - Set Build Command to
npm installand Start Command tonpm start - Add all variables from your
config.envas environment variables in the Render dashboard, plus: FRONTEND_URL = https://pharmalinkrwanda.vercel.app NODE_ENV = production - Render redeploys automatically on every push to your connected branch
├── app.js # Express app setup (CORS, middleware, routes)
├── server.js # Server entry point and MongoDB connection
├── config.env # Environment variables (not committed to git)
├── controllers/ # Route handler logic
├── models/ # Mongoose schemas
├── routes/ # Express route definitions
├── services/ # Stripe and payment provider logic
├── utils/ # Helper utilities
└── frontend/
├── src/
│ ├── pages/ # React page components
│ ├── components/ # Shared UI components (Navbar, Layout, etc.)
│ ├── context/ # Auth context (React Context API)
│ ├── styles/ # CSS files
│ └── utils/api.js # Axios instance (central API config)
├── public/
│ └── medicines/ # Medicine images served statically
├── .env # Local dev environment variables (not committed)
├── .env.production # Production environment variables (Vercel build)
└── vercel.json # SPA routing config for Vercel
| Role | Access |
|---|---|
| User | Search medicines, view pharmacies, place orders, pay, manage profile |
| Staff | Manage pharmacy inventory, view and update orders and payments |
| Admin | Full dashboard — CRUD on all resources |