hey-pharmacist-ecommerce 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +53 -19
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,16 +1,17 @@
1
- # Hey Pharmacist E-commerce Package
1
+ # Hey Pharmacist Ecommerce
2
2
 
3
- A multi-tenant e-commerce package for Next.js applications with stunning design and full functionality.
3
+ Production‑ready, multitenant ecommerce UI + API adapter for Next.js. It ships with end‑to‑end flows (browse, cart, checkout, orders), robust authentication, typed SDKs, and a polished pharmacist‑grade UX. Drop it into a Next.js app, point it at your API, and ship a beautiful store in hours—not weeks.
4
4
 
5
- ## Features
5
+ ## Highlights
6
6
 
7
- - 🛒 **Complete E-commerce Flow**: Shop, cart, checkout, orders
8
- - 🎨 **Stunning Design**: Modern UI with smooth animations
9
- - 🔐 **Authentication**: Login, register, profile management
10
- - 💳 **Stripe Integration**: Secure payment processing
11
- - 🏪 **Multi-tenant**: Single package, multiple stores
12
- - 📱 **Responsive**: Works on all devices
13
- - **Fast**: Optimized for performance
7
+ - 🛒 **Complete flows**: Shop, product details, wishlist, cart, checkout, orders (history + current)
8
+ - 🔐 **Auth built‑in**: Sign up/in, profile, token persistence, background rehydration
9
+ - 💳 **Payments**: Card/Cash/Credit modes; Stripe‑ready checkout handoff
10
+ - 🧩 **Typed API adapters**: Generated axios SDK under `src/lib/Apis` with bearer + store key headers
11
+ - 🎨 **Themeable**: Brand colors + configurable header gradient via `EcommerceConfig`
12
+ - 🧠 **Smart UX**: Skeletons, optimistic UI, searchable overflow filters, and mobile‑first layouts
13
+ - 🧱 **Composable**: Use our screens, or import atomic components and hooks
14
+ - ⚡ **Production‑grade**: Tree‑shakable build, types, sourcemaps, React 18, Next 14
14
15
 
15
16
  ## Installation
16
17
 
@@ -20,7 +21,7 @@ npm install hey-pharmacist-ecommerce react-hook-form @hookform/resolvers
20
21
 
21
22
  ## Quick Start
22
23
 
23
- ### 1. Configure Your Store
24
+ ### 1) Configure your store
24
25
 
25
26
  Create a config file for your store:
26
27
 
@@ -40,7 +41,7 @@ export const ecommerceConfig = {
40
41
  };
41
42
  ```
42
43
 
43
- ### 2. Wrap Your App
44
+ ### 2) Wrap your app
44
45
 
45
46
  ```tsx
46
47
  // app/layout.tsx
@@ -64,7 +65,7 @@ export default function RootLayout({
64
65
  }
65
66
  ```
66
67
 
67
- ### 3. Use the Screens
68
+ ### 3) Use the screens
68
69
 
69
70
  ```tsx
70
71
  // app/shop/page.tsx
@@ -75,7 +76,7 @@ export default function ShopPage() {
75
76
  }
76
77
  ```
77
78
 
78
- ## Available Screens
79
+ ## Available screens
79
80
 
80
81
  - `<ShopScreen />` - Product listing with filters
81
82
  - `<ProductDetailScreen />` - Individual product page
@@ -87,9 +88,26 @@ export default function ShopPage() {
87
88
  - `<OrdersScreen />` - Order history
88
89
  - `<CurrentOrdersScreen />` - Active orders
89
90
 
90
- ## Customization
91
+ ## Theming and customization
91
92
 
92
- The package uses CSS variables for theming. Your colors are automatically applied throughout the interface.
93
+ The package exposes CSS variables for theme colors and a dynamic header gradient. Update via `EcommerceConfig`:
94
+
95
+ ```ts
96
+ headerGradient?: { from: string; via: string; to: string } // hex colors
97
+ ```
98
+
99
+ Under the hood, `ThemeProvider` sets `--color-<brand>-<shade>` and:
100
+
101
+ ```css
102
+ from: rgb(var(--header-from));
103
+ via: rgb(var(--header-via));
104
+ to: rgb(var(--header-to));
105
+ ```
106
+
107
+ Update colors/gradient at runtime and the UI updates automatically.
108
+
109
+ ### Using individual components
110
+ You can import components like `Header`, `Footer`, `ProductCard`, `OrderCard`, and UI primitives (`Button`, `Input`, `Modal`, etc.) for bespoke pages.
93
111
 
94
112
  ## Requirements
95
113
 
@@ -97,9 +115,19 @@ The package uses CSS variables for theming. Your colors are automatically applie
97
115
  - Next.js 14+
98
116
  - react-hook-form 7+
99
117
 
100
- ## Local Development & Testing
118
+ ## Architecture
119
+
120
+ - Screens (page‑level flows) under `src/screens`
121
+ - Providers for Auth, Cart, Wishlist, Theme under `src/providers`
122
+ - Hooks for products, orders, wishlist, addresses under `src/hooks`
123
+ - Generated API SDK under `src/lib/Apis` (axios + typed models)
124
+ - API adapter bridge under `src/lib/api-adapter`
125
+
126
+ Auth persists access token using `localStorage` and rehydrates on load. Requests attach `x-store-key` and `Authorization: Bearer` automatically.
101
127
 
102
- ### Testing Locally Before Publishing
128
+ ## Local development & testing
129
+
130
+ ### Testing locally before publishing
103
131
 
104
132
  You can test the package locally in your frontend project using npm link:
105
133
 
@@ -203,6 +231,12 @@ npm version patch # or minor, or major
203
231
  npm publish
204
232
  ```
205
233
 
234
+ ## Troubleshooting
235
+
236
+ - Types not emitted: ensure `tsup` dts is enabled and `tsconfig` does not use incremental for dts build.
237
+ - 401 after refresh: confirm `AuthProvider` calls `setAuthToken` on login/register and that `initializeApiAdapter` runs at app boot.
238
+ - Filters not working server‑side: pass `orderStatus` and `paymentStatus` to `useOrders` to forward to `getAllOrders`.
239
+
206
240
  ## License
207
241
 
208
- MIT# hey-pharmacist-customer
242
+ MIT
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hey-pharmacist-ecommerce",
3
- "version": "1.0.6",
4
- "description": "Multi-tenant e-commerce package for Next.js",
3
+ "version": "1.0.7",
4
+ "description": "Production-ready, multi-tenant ecommerce UI + API adapter for Next.js with auth, carts, checkout, orders, theming, and pharmacist-focused UX.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
7
7
  "types": "dist/index.d.ts",