A modern, full-featured Pharmacy Management System built with Next.js (App Router), MySQL, and TypeScript.
It supports inventory, sales, purchases, employees, suppliers, and customer management with role-based dashboards for Admin and Pharmacist.
- Manage medicines, suppliers, purchases, employees, and customers
- Access sales reports, low stock alerts, and transaction analytics
- View real-time inventory
- Add new sales
- Add/search customers
- Secure login for Admin and Pharmacist roles using
emploginandemployeetables
- Add, update, and search medicines
- Track stock levels
- Record and view transactions
- Track purchases from suppliers and sales to customers
- Add and search customer data
- Add, update, and view suppliers
- View sales performance, low stock alerts, and top-selling medicines
- Admins can backup and restore the entire MySQL database
- Responsive design using Tailwind CSS
- Icons powered by Heroicons
- Clean, minimal dashboard experience
git clone https://github.com/jaiswalism/Elyxir.git
cd Elyxirnpm install- Create a new database or import
pharmacy_record.sqlin MySQL (e.g., pharmacy_record)
- customer
- emplogin
- employee
- meds
- purchase
- sales
- sales_items
- suppliers
Create a .env file in the root directory:
DB_HOST=localhost
DB_USER=your_mysql_user
DB_PASS=your_mysql_password
DB_NAME=pharmacy_record
DB_PORT=3306npm run devVisit http://localhost:3000 in your browser.
- Login with credentials from the emplogin table
- Role-based access for Admin and Pharmacist
- Secure session/cookie management for authentication
- Logout clears session state
| Table | Purpose |
|---|---|
customer |
Customer details |
emplogin |
Employee login credentials |
employee |
Employee info & designations |
meds |
Medicines inventory |
purchase |
Purchase transactions |
sales |
Sales transactions |
sales_items |
Items in each sale |
suppliers |
Supplier details |
- Educational/demo use only – not ready for production without hardening
- All table/column names match MySQL exactly (e.g.,
Med_ID,C_ID, etc.) - If you find a bug or have a feature request, open an issue or submit a PR!
If you find this project useful, give it a star! Your support means a lot.




