pharmacy-erp 1.0.0

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 (137) hide show
  1. package/.env.example +34 -0
  2. package/LICENSE +21 -0
  3. package/README.md +479 -0
  4. package/backend/Dockerfile +44 -0
  5. package/backend/app/__init__.py +1 -0
  6. package/backend/app/core/__init__.py +1 -0
  7. package/backend/app/core/audit.py +33 -0
  8. package/backend/app/core/config.py +16 -0
  9. package/backend/app/core/database.py +26 -0
  10. package/backend/app/core/deps.py +49 -0
  11. package/backend/app/core/exceptions.py +43 -0
  12. package/backend/app/core/security.py +32 -0
  13. package/backend/app/main.py +54 -0
  14. package/backend/app/modules/__init__.py +0 -0
  15. package/backend/app/modules/admin/__init__.py +1 -0
  16. package/backend/app/modules/admin/models.py +15 -0
  17. package/backend/app/modules/admin/router.py +353 -0
  18. package/backend/app/modules/auth/__init__.py +0 -0
  19. package/backend/app/modules/auth/models.py +16 -0
  20. package/backend/app/modules/auth/router.py +73 -0
  21. package/backend/app/modules/auth/schemas.py +29 -0
  22. package/backend/app/modules/cash_sessions/__init__.py +0 -0
  23. package/backend/app/modules/cash_sessions/models.py +19 -0
  24. package/backend/app/modules/cash_sessions/router.py +85 -0
  25. package/backend/app/modules/cash_sessions/schemas.py +31 -0
  26. package/backend/app/modules/customers/__init__.py +0 -0
  27. package/backend/app/modules/customers/models.py +37 -0
  28. package/backend/app/modules/customers/router.py +296 -0
  29. package/backend/app/modules/customers/schemas.py +72 -0
  30. package/backend/app/modules/inventory/__init__.py +0 -0
  31. package/backend/app/modules/inventory/models.py +16 -0
  32. package/backend/app/modules/inventory/router.py +150 -0
  33. package/backend/app/modules/inventory/schemas.py +24 -0
  34. package/backend/app/modules/medicines/__init__.py +0 -0
  35. package/backend/app/modules/medicines/models.py +54 -0
  36. package/backend/app/modules/medicines/router.py +631 -0
  37. package/backend/app/modules/medicines/schemas.py +153 -0
  38. package/backend/app/modules/medicines/template_generator.py +118 -0
  39. package/backend/app/modules/notifications/__init__.py +1 -0
  40. package/backend/app/modules/notifications/models.py +15 -0
  41. package/backend/app/modules/notifications/router.py +89 -0
  42. package/backend/app/modules/notifications/schemas.py +22 -0
  43. package/backend/app/modules/organizations/__init__.py +0 -0
  44. package/backend/app/modules/organizations/models.py +16 -0
  45. package/backend/app/modules/organizations/router.py +49 -0
  46. package/backend/app/modules/organizations/schemas.py +31 -0
  47. package/backend/app/modules/reports/__init__.py +0 -0
  48. package/backend/app/modules/reports/router.py +409 -0
  49. package/backend/app/modules/roles/__init__.py +1 -0
  50. package/backend/app/modules/roles/models.py +43 -0
  51. package/backend/app/modules/roles/router.py +89 -0
  52. package/backend/app/modules/roles/schemas.py +55 -0
  53. package/backend/app/modules/sales/__init__.py +0 -0
  54. package/backend/app/modules/sales/models.py +44 -0
  55. package/backend/app/modules/sales/router.py +63 -0
  56. package/backend/app/modules/sales/schemas.py +42 -0
  57. package/backend/app/modules/sales/service.py +128 -0
  58. package/backend/app/modules/suppliers/__init__.py +0 -0
  59. package/backend/app/modules/suppliers/models.py +14 -0
  60. package/backend/app/modules/suppliers/router.py +56 -0
  61. package/backend/app/modules/suppliers/schemas.py +27 -0
  62. package/backend/app/modules/users/__init__.py +0 -0
  63. package/backend/app/modules/users/router.py +74 -0
  64. package/backend/app/seed.py +275 -0
  65. package/backend/data/.gitkeep +1 -0
  66. package/backend/requirements.txt +17 -0
  67. package/bin/cli.js +288 -0
  68. package/docker-compose.dev.yml +42 -0
  69. package/docker-compose.yml +59 -0
  70. package/frontend/Dockerfile +56 -0
  71. package/frontend/next.config.ts +19 -0
  72. package/frontend/package.json +60 -0
  73. package/frontend/pnpm-lock.yaml +5678 -0
  74. package/frontend/pnpm-workspace.yaml +6 -0
  75. package/frontend/postcss.config.mjs +6 -0
  76. package/frontend/public/logo.png +0 -0
  77. package/frontend/src/app/[locale]/(app)/admin/page.tsx +1426 -0
  78. package/frontend/src/app/[locale]/(app)/catalog/products/[id]/page.tsx +505 -0
  79. package/frontend/src/app/[locale]/(app)/catalog/products/page.tsx +753 -0
  80. package/frontend/src/app/[locale]/(app)/customers/[id]/page.tsx +500 -0
  81. package/frontend/src/app/[locale]/(app)/customers/page.tsx +538 -0
  82. package/frontend/src/app/[locale]/(app)/dashboard/page.tsx +175 -0
  83. package/frontend/src/app/[locale]/(app)/inventory/page.tsx +765 -0
  84. package/frontend/src/app/[locale]/(app)/layout.tsx +60 -0
  85. package/frontend/src/app/[locale]/(app)/purchasing/page.tsx +1 -0
  86. package/frontend/src/app/[locale]/(app)/reports/page.tsx +794 -0
  87. package/frontend/src/app/[locale]/(app)/sales/page.tsx +296 -0
  88. package/frontend/src/app/[locale]/(auth)/login/page.tsx +100 -0
  89. package/frontend/src/app/[locale]/(pos)/layout.tsx +33 -0
  90. package/frontend/src/app/[locale]/(pos)/pos/page.tsx +463 -0
  91. package/frontend/src/app/[locale]/(pos)/pos/pos-data.ts +89 -0
  92. package/frontend/src/app/[locale]/layout.tsx +30 -0
  93. package/frontend/src/app/[locale]/page.tsx +6 -0
  94. package/frontend/src/app/globals.css +77 -0
  95. package/frontend/src/app/layout.tsx +23 -0
  96. package/frontend/src/app/print.css +18 -0
  97. package/frontend/src/components/pos/CartPanel.tsx +525 -0
  98. package/frontend/src/components/pos/CashSessionGuard.tsx +255 -0
  99. package/frontend/src/components/pos/CloseSessionModal.tsx +160 -0
  100. package/frontend/src/components/pos/PaymentModal.tsx +266 -0
  101. package/frontend/src/components/pos/PaymentSettingsModal.tsx +472 -0
  102. package/frontend/src/components/pos/ProductCatalog.tsx +140 -0
  103. package/frontend/src/components/pos/SaleReceipt.tsx +133 -0
  104. package/frontend/src/components/ui/badge.tsx +28 -0
  105. package/frontend/src/components/ui/bulk-import-modal.tsx +400 -0
  106. package/frontend/src/components/ui/button.tsx +60 -0
  107. package/frontend/src/components/ui/card.tsx +13 -0
  108. package/frontend/src/components/ui/confirm-dialog.tsx +50 -0
  109. package/frontend/src/components/ui/input.tsx +32 -0
  110. package/frontend/src/components/ui/notification-center.tsx +228 -0
  111. package/frontend/src/components/ui/select.tsx +59 -0
  112. package/frontend/src/components/ui/sidebar.tsx +91 -0
  113. package/frontend/src/components/ui/slide-over.tsx +43 -0
  114. package/frontend/src/components/ui/stat-card.tsx +40 -0
  115. package/frontend/src/components/ui/switch.tsx +38 -0
  116. package/frontend/src/components/ui/topbar.tsx +97 -0
  117. package/frontend/src/i18n/request.ts +13 -0
  118. package/frontend/src/i18n/routing.ts +9 -0
  119. package/frontend/src/lib/api.ts +240 -0
  120. package/frontend/src/lib/constants.ts +30 -0
  121. package/frontend/src/lib/utils.ts +32 -0
  122. package/frontend/src/messages/ar.json +106 -0
  123. package/frontend/src/messages/en.json +106 -0
  124. package/frontend/src/middleware.ts +8 -0
  125. package/frontend/src/store/app-store.ts +37 -0
  126. package/frontend/src/store/auth-store.ts +52 -0
  127. package/frontend/src/store/payment-methods-store.ts +144 -0
  128. package/frontend/src/store/pos-store.ts +344 -0
  129. package/frontend/tailwind.config.ts +85 -0
  130. package/frontend/tsconfig.json +27 -0
  131. package/img/backgraund-logo.png +0 -0
  132. package/img/full-logo.png +0 -0
  133. package/img/logo.png +0 -0
  134. package/nginx/nginx.conf +67 -0
  135. package/package.json +88 -0
  136. package/start.bat +90 -0
  137. package/start.sh +64 -0
@@ -0,0 +1,56 @@
1
+ FROM node:18-alpine AS base
2
+
3
+ LABEL org.opencontainers.image.title="Pharmacy ERP Frontend"
4
+ LABEL org.opencontainers.image.description="Next.js frontend for Pharmacy ERP & POS System"
5
+ LABEL org.opencontainers.image.source="https://github.com/omersx/pharmacy-erp"
6
+ LABEL org.opencontainers.image.licenses="MIT"
7
+
8
+ # ── Install dependencies only when needed ───────────────
9
+ FROM base AS deps
10
+ RUN apk add --no-cache libc6-compat
11
+ WORKDIR /app
12
+
13
+ # Install pnpm
14
+ RUN npm install -g pnpm
15
+
16
+ COPY package.json pnpm-lock.yaml* ./
17
+ RUN pnpm install --frozen-lockfile
18
+
19
+ # ── Build the source code ──────────────────────────────
20
+ FROM base AS builder
21
+ WORKDIR /app
22
+ RUN npm install -g pnpm
23
+ COPY --from=deps /app/node_modules ./node_modules
24
+ COPY . .
25
+
26
+ # Disable telemetry during build
27
+ ENV NEXT_TELEMETRY_DISABLED=1
28
+
29
+ RUN pnpm run build
30
+
31
+ # ── Production image ───────────────────────────────────
32
+ FROM base AS runner
33
+ WORKDIR /app
34
+
35
+ ENV NODE_ENV=production
36
+ ENV NEXT_TELEMETRY_DISABLED=1
37
+
38
+ RUN addgroup --system --gid 1001 nodejs
39
+ RUN adduser --system --uid 1001 nextjs
40
+
41
+ COPY --from=builder /app/public ./public
42
+ COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
43
+ COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
44
+
45
+ USER nextjs
46
+
47
+ EXPOSE 3000
48
+
49
+ ENV PORT=3000
50
+ ENV HOSTNAME="0.0.0.0"
51
+
52
+ # Health check
53
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
54
+ CMD wget --no-verbose --tries=1 --spider http://localhost:3000/ || exit 1
55
+
56
+ CMD ["node", "server.js"]
@@ -0,0 +1,19 @@
1
+ import createNextIntlPlugin from 'next-intl/plugin';
2
+ import type { NextConfig } from 'next';
3
+
4
+ const withNextIntl = createNextIntlPlugin('./src/i18n/request.ts');
5
+
6
+ const nextConfig: NextConfig = {
7
+ output: 'standalone',
8
+ reactStrictMode: true,
9
+ async rewrites() {
10
+ return [
11
+ {
12
+ source: '/api/v1/:path*',
13
+ destination: 'http://localhost:8000/api/v1/:path*'
14
+ }
15
+ ];
16
+ }
17
+ };
18
+
19
+ export default withNextIntl(nextConfig);
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "pharmacy-erp-frontend",
3
+ "version": "1.0.0",
4
+ "private": true,
5
+ "scripts": {
6
+ "dev": "next dev --port 3000",
7
+ "build": "next build",
8
+ "start": "next start",
9
+ "lint": "next lint",
10
+ "type-check": "tsc --noEmit"
11
+ },
12
+ "dependencies": {
13
+ "@radix-ui/react-avatar": "^1.1.1",
14
+ "@radix-ui/react-dialog": "^1.1.2",
15
+ "@radix-ui/react-dropdown-menu": "^2.1.2",
16
+ "@radix-ui/react-popover": "^1.1.23",
17
+ "@radix-ui/react-scroll-area": "^1.2.1",
18
+ "@radix-ui/react-select": "^2.1.2",
19
+ "@radix-ui/react-separator": "^1.1.0",
20
+ "@radix-ui/react-slot": "^1.1.0",
21
+ "@radix-ui/react-switch": "^1.1.1",
22
+ "@radix-ui/react-tabs": "^1.1.1",
23
+ "@radix-ui/react-tooltip": "^1.1.4",
24
+ "class-variance-authority": "^0.7.1",
25
+ "clsx": "^2.1.1",
26
+ "date-fns": "^4.1.0",
27
+ "framer-motion": "^13.1.0",
28
+ "jspdf": "^4.2.1",
29
+ "jspdf-autotable": "^5.0.8",
30
+ "lucide-react": "^0.468.0",
31
+ "next": "^15.1.0",
32
+ "next-intl": "^3.26.3",
33
+ "papaparse": "^5.5.4",
34
+ "react": "^19.0.0",
35
+ "react-dom": "^19.0.0",
36
+ "react-hot-toast": "^2.4.1",
37
+ "recharts": "^2.15.0",
38
+ "tailwind-merge": "^2.5.5",
39
+ "xlsx": "^0.18.5",
40
+ "zustand": "^5.0.2"
41
+ },
42
+ "devDependencies": {
43
+ "@types/node": "^22.0.0",
44
+ "@types/papaparse": "^5.5.2",
45
+ "@types/react": "^19.0.0",
46
+ "@types/react-dom": "^19.0.0",
47
+ "autoprefixer": "^10.4.20",
48
+ "eslint": "^9.0.0",
49
+ "eslint-config-next": "^15.1.0",
50
+ "postcss": "^8.4.49",
51
+ "tailwindcss": "^3.4.17",
52
+ "typescript": "^5.7.0"
53
+ },
54
+ "pnpm": {
55
+ "onlyBuiltDependencies": [
56
+ "sharp",
57
+ "unrs-resolver"
58
+ ]
59
+ }
60
+ }