All-in-one image for Pharmacy ERP (Frontend, Backend & Proxy)
1.0K
A modern, open-source Pharmacy ERP & Point of Sale system built for independent pharmacies, chains, and hospitals.
Full Arabic (RTL) & English support · Designed for the Gulf/MENA market
Features · Quick Start · Screenshots · Architecture · API Docs · Docker · Contributing
🏪 Point of Sale
|
💊 Medicine Management
|
📦 Inventory & Purchasing
|
💰 Sales & Cash Management
|
📊 Reports & Analytics
|
🌍 Enterprise Features
|
Coming soon — Screenshots of the Dashboard, POS, Inventory, and Reports pages will be added here.
Want to see the app in action? Follow the Quick Start guide to run it locally in under 5 minutes!
| Tool | Version | Download |
|---|---|---|
| Node.js | 18+ | nodejs.org |
| pnpm | 9+ | npm install -g pnpm |
| Python | 3.12+ | python.org |
The easiest way to scaffold and start the project is using our interactive CLI:
# 1. Scaffold the project (clones, installs, and seeds data automatically)
npx pharmacy-erp init
# 2. Enter the directory
cd pharmacy-erp
# 3. Start the application
npx pharmacy-erp start
If you prefer to clone manually, you can use our built-in setup scripts.
git clone https://github.com/omersx/pharmacy-erp.git
cd pharmacy-erp
start.bat
git clone https://github.com/omersx/pharmacy-erp.git
cd pharmacy-erp
chmod +x start.sh
./start.sh
# 1. Clone the repository
git clone https://github.com/omersx/pharmacy-erp.git
cd pharmacy-erp
# 2. Install root dependencies (concurrently)
pnpm install
# 3. Setup frontend
pnpm run setup:frontend
# 4. Setup backend (auto-detects Windows/Linux/macOS)
pnpm run setup:backend
# 5. Configure environment
cp .env.example .env # Linux/macOS
# copy .env.example .env # Windows
# 6. Seed demo data
pnpm run seed
# 7. Start development servers
pnpm dev
| Service | URL |
|---|---|
| 🌐 Frontend | http://localhost:3000 |
| 🔧 Backend API | http://localhost:8000 |
| 📚 API Docs (Swagger) | http://localhost:8000/docs |
| Role | Username / Email | Password |
|---|---|---|
| Super Admin | admin or [email protected] | admin or admin123 |
⚠️ Change the default credentials before deploying to production!
graph TB
subgraph Client
A[Browser] -->|HTTP/HTTPS| B[Next.js Frontend]
end
subgraph Frontend["Frontend — Next.js 15"]
B --> C[App Router]
C --> D[POS Module]
C --> E[ERP Dashboard]
C --> F[Auth Pages]
B --> G[Zustand Store]
B --> H[next-intl i18n]
end
subgraph Backend["Backend — FastAPI"]
I[API Gateway] --> J[Auth & RBAC]
I --> K[Medicines]
I --> L[Inventory]
I --> M[Sales & POS]
I --> N[Purchases]
I --> O[Customers]
I --> P[Cash Sessions]
I --> Q[Reports]
I --> R[Admin & Audit]
end
subgraph Data["Data Layer"]
S[(SQLite / PostgreSQL)]
end
B -->|REST API| I
J --> S
K --> S
L --> S
M --> S
N --> S
O --> S
P --> S
Q --> S
R --> S
pharmacy-erp/
├── frontend/ # Next.js 15 (App Router)
│ ├── src/
│ │ ├── app/ # Routes & pages
│ │ │ └── [locale]/ # i18n routing (en, ar)
│ │ │ ├── (app)/ # ERP dashboard pages
│ │ │ ├── (auth)/ # Login / register
│ │ │ └── (pos)/ # Point of Sale
│ │ ├── components/ # Reusable UI components
│ │ │ ├── ui/ # Base components (Radix UI)
│ │ │ └── pos/ # POS-specific components
│ │ ├── lib/ # API client, utilities
│ │ ├── store/ # Zustand state stores
│ │ ├── messages/ # i18n translations (en.json, ar.json)
│ │ └── i18n/ # i18n configuration
│ ├── Dockerfile
│ └── package.json
│
├── backend/ # FastAPI (Python 3.12)
│ ├── app/
│ │ ├── core/ # Config, database, security, exceptions
│ │ ├── modules/ # Business logic modules
│ │ │ ├── auth/ # Authentication & JWT
│ │ │ ├── users/ # User management
│ │ │ ├── roles/ # RBAC roles & permissions
│ │ │ ├── organizations/# Branch management
│ │ │ ├── medicines/ # Product catalog & batches
│ │ │ ├── inventory/ # Stock movements & ledger
│ │ │ ├── sales/ # Invoices, returns, held sales
│ │ │ ├── purchases/ # Purchase orders
│ │ │ ├── suppliers/ # Supplier management
│ │ │ ├── customers/ # Customer & credit management
│ │ │ ├── cash_sessions/# Cash register sessions
│ │ │ ├── reports/ # Analytics & reporting
│ │ │ ├── notifications/# System notifications
│ │ │ └── admin/ # Audit logs & admin tools
│ │ ├── main.py # FastAPI application entry
│ │ └── seed.py # Demo data seeder
│ ├── Dockerfile
│ └── requirements.txt
│
├── nginx/ # Nginx reverse proxy config
├── img/ # Logo and brand assets
├── docker-compose.yml # Production deployment
├── package.json # Root orchestration scripts
├── start.bat # One-click setup (Windows)
├── start.sh # One-click setup (Linux/macOS)
├── .env.example # Environment template
└── README.md
| Layer | Technologies |
|---|---|
| Frontend | Next.js 15 · React 19 · TypeScript · Tailwind CSS |
| UI Components | Radix UI · Lucide Icons · Framer Motion · Recharts |
| State & i18n | Zustand · next-intl |
| Backend | FastAPI · Python 3.12 · Pydantic v2 · SQLAlchemy 2 |
| Database | SQLite (dev) · PostgreSQL (production) |
| Auth | JWT (httpOnly cookies) · Argon2 password hashing |
| DevOps | Docker · Nginx · Uvicorn |
Once the backend is running, interactive API documentation is available at:
| Format | URL |
|---|---|
| Swagger UI | http://localhost:8000/docs |
| ReDoc | http://localhost:8000/redoc |
| Endpoint Prefix | Module | Description |
|---|---|---|
/api/v1/auth | Authentication | Login, register, refresh tokens |
/api/v1/medicines | Medicines | CRUD, batches, categories, import |
/api/v1/inventory | Inventory | Stock movements, alerts, ledger |
/api/v1/sales | Sales | Invoices, returns, held sales |
/api/v1/cash-sessions | Cash Sessions | Open, close, X/Z reports |
/api/v1/customers | Customers | Customer management, credit |
/api/v1/suppliers | Suppliers | Supplier directory |
/api/v1/branches | Branches | Multi-branch management |
/api/v1/reports | Reports | Sales, inventory, profit analytics |
/api/v1/users | Users | User management |
/api/v1/roles | Roles | RBAC roles & permissions |
/api/v1/admin | Admin | Audit logs, system admin |
/api/v1/notifications | Notifications | System notifications |
The easiest way to run the entire system (Frontend, Backend, and Proxy) is using our official all-in-one image:
docker run -d \
--name pharmacy-erp \
-p 80:80 \
omersx/pharmacy-erp:latest
This starts the entire application on port 80. You can now access it at http://localhost.
docker compose -f docker-compose.dev.yml up --build
SECRET_KEY to a strong random value (32+ characters)APP_ENV=production and DEBUG=falseCORS_ORIGINS| Variable | Description | Default |
|---|---|---|
APP_NAME | Application name | Pharmacy ERP |
APP_ENV | Environment (development / production) | development |
DEBUG | Enable debug mode | true |
DATABASE_URL | Database connection string | sqlite+aiosqlite:///./data/pharmacy.db |
SECRET_KEY | JWT signing key (change in production!) | dev-secret-key-... |
ACCESS_TOKEN_EXPIRE_MINUTES | Access token TTL | 30 |
REFRESH_TOKEN_EXPIRE_DAYS | Refresh token TTL | 7 |
CORS_ORIGINS | Allowed CORS origins (comma-separated) | http://localhost:3000 |
NEXT_PUBLIC_API_URL | API URL for the frontend | http://localhost:8000/api/v1 |
REDIS_URL | Redis URL (optional, for production) | — |
UPLOAD_DIR | File upload directory | ./data/uploads |
MAX_UPLOAD_SIZE_MB | Max upload file size | 10 |
See .env.example for the full template.
Pharmacy ERP ships with complete support for:
| Language | Direction | Status |
|---|---|---|
| 🇬🇧 English | LTR (Left-to-Right) | ✅ Complete |
| 🇸🇦 العربية (Arabic) | RTL (Right-to-Left) | ✅ Complete |
Switch languages from any page — the entire UI, including layout direction, updates instantly.
Adding a new language:
frontend/src/messages/<locale>.jsonfrontend/src/i18n/ configurationWe love contributions! Whether it's fixing bugs, adding features, improving docs, or suggesting ideas — all contributions are welcome.
git checkout -b feature/amazing-featuregit commit -m 'feat: add amazing feature'git push origin feature/amazing-featurePlease read our Contributing Guide and Code of Conduct before getting started.
Have a feature idea? Open a feature request!
If this project helps you, give it a ⭐ on GitHub — it means a lot and helps others discover it!
This project is licensed under the MIT License — see the LICENSE file for details.
Built with ❤️ for pharmacies everywhere
Content type
Image
Digest
sha256:ad02f9bb5…
Size
172.3 MB
Last updated
2 months ago
docker pull omersx/pharmacy-erp