@victusvinceere/saas-core 0.1.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 (64) hide show
  1. package/dist/auth/index.d.mts +40 -0
  2. package/dist/auth/index.d.ts +40 -0
  3. package/dist/auth/index.js +147 -0
  4. package/dist/auth/index.js.map +1 -0
  5. package/dist/auth/index.mjs +111 -0
  6. package/dist/auth/index.mjs.map +1 -0
  7. package/dist/authorization/index.d.mts +78 -0
  8. package/dist/authorization/index.d.ts +78 -0
  9. package/dist/authorization/index.js +137 -0
  10. package/dist/authorization/index.js.map +1 -0
  11. package/dist/authorization/index.mjs +104 -0
  12. package/dist/authorization/index.mjs.map +1 -0
  13. package/dist/components/auth/index.d.mts +26 -0
  14. package/dist/components/auth/index.d.ts +26 -0
  15. package/dist/components/auth/index.js +733 -0
  16. package/dist/components/auth/index.js.map +1 -0
  17. package/dist/components/auth/index.mjs +696 -0
  18. package/dist/components/auth/index.mjs.map +1 -0
  19. package/dist/components/dashboard/index.d.mts +32 -0
  20. package/dist/components/dashboard/index.d.ts +32 -0
  21. package/dist/components/dashboard/index.js +440 -0
  22. package/dist/components/dashboard/index.js.map +1 -0
  23. package/dist/components/dashboard/index.mjs +401 -0
  24. package/dist/components/dashboard/index.mjs.map +1 -0
  25. package/dist/components/ui/index.d.mts +351 -0
  26. package/dist/components/ui/index.d.ts +351 -0
  27. package/dist/components/ui/index.js +14342 -0
  28. package/dist/components/ui/index.js.map +1 -0
  29. package/dist/components/ui/index.mjs +14173 -0
  30. package/dist/components/ui/index.mjs.map +1 -0
  31. package/dist/config/index.d.mts +45 -0
  32. package/dist/config/index.d.ts +45 -0
  33. package/dist/config/index.js +71 -0
  34. package/dist/config/index.js.map +1 -0
  35. package/dist/config/index.mjs +44 -0
  36. package/dist/config/index.mjs.map +1 -0
  37. package/dist/hooks/index.d.mts +20 -0
  38. package/dist/hooks/index.d.ts +20 -0
  39. package/dist/hooks/index.js +103 -0
  40. package/dist/hooks/index.js.map +1 -0
  41. package/dist/hooks/index.mjs +65 -0
  42. package/dist/hooks/index.mjs.map +1 -0
  43. package/dist/index.d.mts +21 -0
  44. package/dist/index.d.ts +21 -0
  45. package/dist/index.js +459 -0
  46. package/dist/index.js.map +1 -0
  47. package/dist/index.mjs +401 -0
  48. package/dist/index.mjs.map +1 -0
  49. package/dist/prisma/index.d.mts +11 -0
  50. package/dist/prisma/index.d.ts +11 -0
  51. package/dist/prisma/index.js +46 -0
  52. package/dist/prisma/index.js.map +1 -0
  53. package/dist/prisma/index.mjs +20 -0
  54. package/dist/prisma/index.mjs.map +1 -0
  55. package/dist/providers/index.d.mts +37 -0
  56. package/dist/providers/index.d.ts +37 -0
  57. package/dist/providers/index.js +97 -0
  58. package/dist/providers/index.js.map +1 -0
  59. package/dist/providers/index.mjs +69 -0
  60. package/dist/providers/index.mjs.map +1 -0
  61. package/dist/sidebar-ttX_iZ40.d.mts +22 -0
  62. package/dist/sidebar-ttX_iZ40.d.ts +22 -0
  63. package/package.json +122 -0
  64. package/prisma/schema.prisma +106 -0
@@ -0,0 +1,97 @@
1
+ "use client";
2
+ "use strict";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/providers/index.ts
22
+ var providers_exports = {};
23
+ __export(providers_exports, {
24
+ SaasKitProvider: () => SaasKitProvider,
25
+ SessionProvider: () => SessionProvider,
26
+ ThemeProvider: () => ThemeProvider
27
+ });
28
+ module.exports = __toCommonJS(providers_exports);
29
+
30
+ // src/providers/session-provider.tsx
31
+ var import_react = require("next-auth/react");
32
+ var import_jsx_runtime = require("react/jsx-runtime");
33
+ function SessionProvider({ children }) {
34
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.SessionProvider, { children });
35
+ }
36
+
37
+ // src/providers/theme-provider.tsx
38
+ var import_next_themes = require("next-themes");
39
+ var import_jsx_runtime2 = require("react/jsx-runtime");
40
+ function ThemeProvider({
41
+ children,
42
+ attribute = "class",
43
+ defaultTheme = "system",
44
+ enableSystem = true,
45
+ disableTransitionOnChange = false,
46
+ storageKey = "saas-kit-theme"
47
+ }) {
48
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
49
+ import_next_themes.ThemeProvider,
50
+ {
51
+ attribute,
52
+ defaultTheme,
53
+ enableSystem,
54
+ disableTransitionOnChange,
55
+ storageKey,
56
+ children
57
+ }
58
+ );
59
+ }
60
+
61
+ // src/providers/saas-kit-provider.tsx
62
+ var import_sonner = require("sonner");
63
+ var import_jsx_runtime3 = require("react/jsx-runtime");
64
+ function SaasKitProvider({
65
+ children,
66
+ theme = {},
67
+ toaster = {}
68
+ }) {
69
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(SessionProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
70
+ ThemeProvider,
71
+ {
72
+ attribute: theme.attribute || "class",
73
+ defaultTheme: theme.defaultTheme || "system",
74
+ enableSystem: theme.enableSystem ?? true,
75
+ disableTransitionOnChange: theme.disableTransitionOnChange ?? false,
76
+ storageKey: theme.storageKey || "saas-kit-theme",
77
+ children: [
78
+ children,
79
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
80
+ import_sonner.Toaster,
81
+ {
82
+ position: toaster.position || "bottom-right",
83
+ richColors: toaster.richColors ?? true,
84
+ closeButton: toaster.closeButton ?? true
85
+ }
86
+ )
87
+ ]
88
+ }
89
+ ) });
90
+ }
91
+ // Annotate the CommonJS export names for ESM import in node:
92
+ 0 && (module.exports = {
93
+ SaasKitProvider,
94
+ SessionProvider,
95
+ ThemeProvider
96
+ });
97
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/providers/index.ts","../../src/providers/session-provider.tsx","../../src/providers/theme-provider.tsx","../../src/providers/saas-kit-provider.tsx"],"sourcesContent":["export { SessionProvider } from \"./session-provider\";\nexport type { SessionProviderProps } from \"./session-provider\";\n\nexport { ThemeProvider } from \"./theme-provider\";\nexport type { ThemeProviderProps } from \"./theme-provider\";\n\nexport { SaasKitProvider } from \"./saas-kit-provider\";\nexport type { SaasKitProviderProps } from \"./saas-kit-provider\";\n","\"use client\";\n\nimport { SessionProvider as NextAuthSessionProvider } from \"next-auth/react\";\nimport { type ReactNode } from \"react\";\n\nexport interface SessionProviderProps {\n children: ReactNode;\n}\n\nexport function SessionProvider({ children }: SessionProviderProps) {\n return <NextAuthSessionProvider>{children}</NextAuthSessionProvider>;\n}\n","\"use client\";\n\nimport { ThemeProvider as NextThemesProvider } from \"next-themes\";\nimport type { ThemeProviderProps as NextThemeProviderProps } from \"next-themes\";\nimport { type ReactNode } from \"react\";\n\nexport interface ThemeProviderProps {\n children: ReactNode;\n attribute?: NextThemeProviderProps[\"attribute\"];\n defaultTheme?: string;\n enableSystem?: boolean;\n disableTransitionOnChange?: boolean;\n storageKey?: string;\n}\n\nexport function ThemeProvider({\n children,\n attribute = \"class\",\n defaultTheme = \"system\",\n enableSystem = true,\n disableTransitionOnChange = false,\n storageKey = \"saas-kit-theme\",\n}: ThemeProviderProps) {\n return (\n <NextThemesProvider\n attribute={attribute}\n defaultTheme={defaultTheme}\n enableSystem={enableSystem}\n disableTransitionOnChange={disableTransitionOnChange}\n storageKey={storageKey}\n >\n {children}\n </NextThemesProvider>\n );\n}\n","\"use client\";\n\nimport { type ReactNode } from \"react\";\nimport { SessionProvider } from \"./session-provider\";\nimport { ThemeProvider } from \"./theme-provider\";\nimport { Toaster } from \"sonner\";\n\nexport interface SaasKitProviderProps {\n children: ReactNode;\n theme?: {\n attribute?: \"class\" | \"data-theme\";\n defaultTheme?: string;\n enableSystem?: boolean;\n disableTransitionOnChange?: boolean;\n storageKey?: string;\n };\n toaster?: {\n position?:\n | \"top-left\"\n | \"top-right\"\n | \"bottom-left\"\n | \"bottom-right\"\n | \"top-center\"\n | \"bottom-center\";\n richColors?: boolean;\n closeButton?: boolean;\n };\n}\n\nexport function SaasKitProvider({\n children,\n theme = {},\n toaster = {},\n}: SaasKitProviderProps) {\n return (\n <SessionProvider>\n <ThemeProvider\n attribute={theme.attribute || \"class\"}\n defaultTheme={theme.defaultTheme || \"system\"}\n enableSystem={theme.enableSystem ?? true}\n disableTransitionOnChange={theme.disableTransitionOnChange ?? false}\n storageKey={theme.storageKey || \"saas-kit-theme\"}\n >\n {children}\n <Toaster\n position={toaster.position || \"bottom-right\"}\n richColors={toaster.richColors ?? true}\n closeButton={toaster.closeButton ?? true}\n />\n </ThemeProvider>\n </SessionProvider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEA,mBAA2D;AAQlD;AADF,SAAS,gBAAgB,EAAE,SAAS,GAAyB;AAClE,SAAO,4CAAC,aAAAA,iBAAA,EAAyB,UAAS;AAC5C;;;ACTA,yBAAoD;AAsBhD,IAAAC,sBAAA;AATG,SAAS,cAAc;AAAA,EAC5B;AAAA,EACA,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,eAAe;AAAA,EACf,4BAA4B;AAAA,EAC5B,aAAa;AACf,GAAuB;AACrB,SACE;AAAA,IAAC,mBAAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MAEC;AAAA;AAAA,EACH;AAEJ;;;AC7BA,oBAAwB;AA+BlB,IAAAC,sBAAA;AAPC,SAAS,gBAAgB;AAAA,EAC9B;AAAA,EACA,QAAQ,CAAC;AAAA,EACT,UAAU,CAAC;AACb,GAAyB;AACvB,SACE,6CAAC,mBACC;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,MAAM,aAAa;AAAA,MAC9B,cAAc,MAAM,gBAAgB;AAAA,MACpC,cAAc,MAAM,gBAAgB;AAAA,MACpC,2BAA2B,MAAM,6BAA6B;AAAA,MAC9D,YAAY,MAAM,cAAc;AAAA,MAE/B;AAAA;AAAA,QACD;AAAA,UAAC;AAAA;AAAA,YACC,UAAU,QAAQ,YAAY;AAAA,YAC9B,YAAY,QAAQ,cAAc;AAAA,YAClC,aAAa,QAAQ,eAAe;AAAA;AAAA,QACtC;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;","names":["NextAuthSessionProvider","import_jsx_runtime","NextThemesProvider","import_jsx_runtime"]}
@@ -0,0 +1,69 @@
1
+ "use client";
2
+
3
+ // src/providers/session-provider.tsx
4
+ import { SessionProvider as NextAuthSessionProvider } from "next-auth/react";
5
+ import { jsx } from "react/jsx-runtime";
6
+ function SessionProvider({ children }) {
7
+ return /* @__PURE__ */ jsx(NextAuthSessionProvider, { children });
8
+ }
9
+
10
+ // src/providers/theme-provider.tsx
11
+ import { ThemeProvider as NextThemesProvider } from "next-themes";
12
+ import { jsx as jsx2 } from "react/jsx-runtime";
13
+ function ThemeProvider({
14
+ children,
15
+ attribute = "class",
16
+ defaultTheme = "system",
17
+ enableSystem = true,
18
+ disableTransitionOnChange = false,
19
+ storageKey = "saas-kit-theme"
20
+ }) {
21
+ return /* @__PURE__ */ jsx2(
22
+ NextThemesProvider,
23
+ {
24
+ attribute,
25
+ defaultTheme,
26
+ enableSystem,
27
+ disableTransitionOnChange,
28
+ storageKey,
29
+ children
30
+ }
31
+ );
32
+ }
33
+
34
+ // src/providers/saas-kit-provider.tsx
35
+ import { Toaster } from "sonner";
36
+ import { jsx as jsx3, jsxs } from "react/jsx-runtime";
37
+ function SaasKitProvider({
38
+ children,
39
+ theme = {},
40
+ toaster = {}
41
+ }) {
42
+ return /* @__PURE__ */ jsx3(SessionProvider, { children: /* @__PURE__ */ jsxs(
43
+ ThemeProvider,
44
+ {
45
+ attribute: theme.attribute || "class",
46
+ defaultTheme: theme.defaultTheme || "system",
47
+ enableSystem: theme.enableSystem ?? true,
48
+ disableTransitionOnChange: theme.disableTransitionOnChange ?? false,
49
+ storageKey: theme.storageKey || "saas-kit-theme",
50
+ children: [
51
+ children,
52
+ /* @__PURE__ */ jsx3(
53
+ Toaster,
54
+ {
55
+ position: toaster.position || "bottom-right",
56
+ richColors: toaster.richColors ?? true,
57
+ closeButton: toaster.closeButton ?? true
58
+ }
59
+ )
60
+ ]
61
+ }
62
+ ) });
63
+ }
64
+ export {
65
+ SaasKitProvider,
66
+ SessionProvider,
67
+ ThemeProvider
68
+ };
69
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/providers/session-provider.tsx","../../src/providers/theme-provider.tsx","../../src/providers/saas-kit-provider.tsx"],"sourcesContent":["\"use client\";\n\nimport { SessionProvider as NextAuthSessionProvider } from \"next-auth/react\";\nimport { type ReactNode } from \"react\";\n\nexport interface SessionProviderProps {\n children: ReactNode;\n}\n\nexport function SessionProvider({ children }: SessionProviderProps) {\n return <NextAuthSessionProvider>{children}</NextAuthSessionProvider>;\n}\n","\"use client\";\n\nimport { ThemeProvider as NextThemesProvider } from \"next-themes\";\nimport type { ThemeProviderProps as NextThemeProviderProps } from \"next-themes\";\nimport { type ReactNode } from \"react\";\n\nexport interface ThemeProviderProps {\n children: ReactNode;\n attribute?: NextThemeProviderProps[\"attribute\"];\n defaultTheme?: string;\n enableSystem?: boolean;\n disableTransitionOnChange?: boolean;\n storageKey?: string;\n}\n\nexport function ThemeProvider({\n children,\n attribute = \"class\",\n defaultTheme = \"system\",\n enableSystem = true,\n disableTransitionOnChange = false,\n storageKey = \"saas-kit-theme\",\n}: ThemeProviderProps) {\n return (\n <NextThemesProvider\n attribute={attribute}\n defaultTheme={defaultTheme}\n enableSystem={enableSystem}\n disableTransitionOnChange={disableTransitionOnChange}\n storageKey={storageKey}\n >\n {children}\n </NextThemesProvider>\n );\n}\n","\"use client\";\n\nimport { type ReactNode } from \"react\";\nimport { SessionProvider } from \"./session-provider\";\nimport { ThemeProvider } from \"./theme-provider\";\nimport { Toaster } from \"sonner\";\n\nexport interface SaasKitProviderProps {\n children: ReactNode;\n theme?: {\n attribute?: \"class\" | \"data-theme\";\n defaultTheme?: string;\n enableSystem?: boolean;\n disableTransitionOnChange?: boolean;\n storageKey?: string;\n };\n toaster?: {\n position?:\n | \"top-left\"\n | \"top-right\"\n | \"bottom-left\"\n | \"bottom-right\"\n | \"top-center\"\n | \"bottom-center\";\n richColors?: boolean;\n closeButton?: boolean;\n };\n}\n\nexport function SaasKitProvider({\n children,\n theme = {},\n toaster = {},\n}: SaasKitProviderProps) {\n return (\n <SessionProvider>\n <ThemeProvider\n attribute={theme.attribute || \"class\"}\n defaultTheme={theme.defaultTheme || \"system\"}\n enableSystem={theme.enableSystem ?? true}\n disableTransitionOnChange={theme.disableTransitionOnChange ?? false}\n storageKey={theme.storageKey || \"saas-kit-theme\"}\n >\n {children}\n <Toaster\n position={toaster.position || \"bottom-right\"}\n richColors={toaster.richColors ?? true}\n closeButton={toaster.closeButton ?? true}\n />\n </ThemeProvider>\n </SessionProvider>\n );\n}\n"],"mappings":";;;AAEA,SAAS,mBAAmB,+BAA+B;AAQlD;AADF,SAAS,gBAAgB,EAAE,SAAS,GAAyB;AAClE,SAAO,oBAAC,2BAAyB,UAAS;AAC5C;;;ACTA,SAAS,iBAAiB,0BAA0B;AAsBhD,gBAAAA,YAAA;AATG,SAAS,cAAc;AAAA,EAC5B;AAAA,EACA,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,eAAe;AAAA,EACf,4BAA4B;AAAA,EAC5B,aAAa;AACf,GAAuB;AACrB,SACE,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MAEC;AAAA;AAAA,EACH;AAEJ;;;AC7BA,SAAS,eAAe;AA+BlB,SAQE,OAAAC,MARF;AAPC,SAAS,gBAAgB;AAAA,EAC9B;AAAA,EACA,QAAQ,CAAC;AAAA,EACT,UAAU,CAAC;AACb,GAAyB;AACvB,SACE,gBAAAA,KAAC,mBACC;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,MAAM,aAAa;AAAA,MAC9B,cAAc,MAAM,gBAAgB;AAAA,MACpC,cAAc,MAAM,gBAAgB;AAAA,MACpC,2BAA2B,MAAM,6BAA6B;AAAA,MAC9D,YAAY,MAAM,cAAc;AAAA,MAE/B;AAAA;AAAA,QACD,gBAAAA;AAAA,UAAC;AAAA;AAAA,YACC,UAAU,QAAQ,YAAY;AAAA,YAC9B,YAAY,QAAQ,cAAc;AAAA,YAClC,aAAa,QAAQ,eAAe;AAAA;AAAA,QACtC;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;","names":["jsx","jsx"]}
@@ -0,0 +1,22 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { LucideIcon } from 'lucide-react';
3
+
4
+ interface SidebarNavItem {
5
+ title: string;
6
+ href: string;
7
+ icon: LucideIcon;
8
+ disabled?: boolean;
9
+ badge?: string;
10
+ }
11
+ interface SidebarNavGroup {
12
+ title: string;
13
+ items: SidebarNavItem[];
14
+ }
15
+ interface SidebarProps {
16
+ config: SidebarNavGroup[];
17
+ siteName?: string;
18
+ logo?: React.ReactNode;
19
+ }
20
+ declare function Sidebar({ config, siteName, logo }: SidebarProps): react_jsx_runtime.JSX.Element;
21
+
22
+ export { type SidebarNavGroup as S, Sidebar as a, type SidebarNavItem as b, type SidebarProps as c };
@@ -0,0 +1,22 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { LucideIcon } from 'lucide-react';
3
+
4
+ interface SidebarNavItem {
5
+ title: string;
6
+ href: string;
7
+ icon: LucideIcon;
8
+ disabled?: boolean;
9
+ badge?: string;
10
+ }
11
+ interface SidebarNavGroup {
12
+ title: string;
13
+ items: SidebarNavItem[];
14
+ }
15
+ interface SidebarProps {
16
+ config: SidebarNavGroup[];
17
+ siteName?: string;
18
+ logo?: React.ReactNode;
19
+ }
20
+ declare function Sidebar({ config, siteName, logo }: SidebarProps): react_jsx_runtime.JSX.Element;
21
+
22
+ export { type SidebarNavGroup as S, Sidebar as a, type SidebarNavItem as b, type SidebarProps as c };
package/package.json ADDED
@@ -0,0 +1,122 @@
1
+ {
2
+ "name": "@victusvinceere/saas-core",
3
+ "version": "0.1.0",
4
+ "description": "Core authentication, authorization, and UI components for SaaS Kit",
5
+ "main": "./dist/index.js",
6
+ "module": "./dist/index.mjs",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.mjs",
12
+ "require": "./dist/index.js"
13
+ },
14
+ "./auth": {
15
+ "types": "./dist/auth/index.d.ts",
16
+ "import": "./dist/auth/index.mjs",
17
+ "require": "./dist/auth/index.js"
18
+ },
19
+ "./authorization": {
20
+ "types": "./dist/authorization/index.d.ts",
21
+ "import": "./dist/authorization/index.mjs",
22
+ "require": "./dist/authorization/index.js"
23
+ },
24
+ "./components/ui": {
25
+ "types": "./dist/components/ui/index.d.ts",
26
+ "import": "./dist/components/ui/index.mjs",
27
+ "require": "./dist/components/ui/index.js"
28
+ },
29
+ "./components/dashboard": {
30
+ "types": "./dist/components/dashboard/index.d.ts",
31
+ "import": "./dist/components/dashboard/index.mjs",
32
+ "require": "./dist/components/dashboard/index.js"
33
+ },
34
+ "./components/auth": {
35
+ "types": "./dist/components/auth/index.d.ts",
36
+ "import": "./dist/components/auth/index.mjs",
37
+ "require": "./dist/components/auth/index.js"
38
+ },
39
+ "./providers": {
40
+ "types": "./dist/providers/index.d.ts",
41
+ "import": "./dist/providers/index.mjs",
42
+ "require": "./dist/providers/index.js"
43
+ },
44
+ "./hooks": {
45
+ "types": "./dist/hooks/index.d.ts",
46
+ "import": "./dist/hooks/index.mjs",
47
+ "require": "./dist/hooks/index.js"
48
+ },
49
+ "./config": {
50
+ "types": "./dist/config/index.d.ts",
51
+ "import": "./dist/config/index.mjs",
52
+ "require": "./dist/config/index.js"
53
+ },
54
+ "./prisma": {
55
+ "types": "./dist/prisma/index.d.ts",
56
+ "import": "./dist/prisma/index.mjs",
57
+ "require": "./dist/prisma/index.js"
58
+ },
59
+ "./styles.css": "./dist/styles.css"
60
+ },
61
+ "files": [
62
+ "dist",
63
+ "prisma"
64
+ ],
65
+ "scripts": {
66
+ "build": "tsup",
67
+ "dev": "tsup --watch",
68
+ "typecheck": "tsc --noEmit",
69
+ "clean": "rm -rf dist"
70
+ },
71
+ "peerDependencies": {
72
+ "next": ">=15.0.0",
73
+ "next-auth": ">=5.0.0-beta.0",
74
+ "react": ">=19.0.0",
75
+ "react-dom": ">=19.0.0"
76
+ },
77
+ "dependencies": {
78
+ "@auth/prisma-adapter": "^2.11.1",
79
+ "@radix-ui/react-alert-dialog": "^1.1.15",
80
+ "@radix-ui/react-avatar": "^1.1.11",
81
+ "@radix-ui/react-checkbox": "^1.3.3",
82
+ "@radix-ui/react-collapsible": "^1.1.12",
83
+ "@radix-ui/react-dialog": "^1.1.15",
84
+ "@radix-ui/react-dropdown-menu": "^2.1.16",
85
+ "@radix-ui/react-label": "^2.1.8",
86
+ "@radix-ui/react-popover": "^1.1.15",
87
+ "@radix-ui/react-select": "^2.2.6",
88
+ "@radix-ui/react-separator": "^1.1.8",
89
+ "@radix-ui/react-slot": "^1.2.4",
90
+ "@radix-ui/react-switch": "^1.2.6",
91
+ "@radix-ui/react-tabs": "^1.1.13",
92
+ "@radix-ui/react-toggle": "^1.1.10",
93
+ "@radix-ui/react-toggle-group": "^1.1.11",
94
+ "@radix-ui/react-tooltip": "^1.2.8",
95
+ "class-variance-authority": "^0.7.1",
96
+ "clsx": "^2.1.1",
97
+ "lucide-react": "^0.562.0",
98
+ "next-themes": "^0.4.6",
99
+ "sonner": "^2.0.7",
100
+ "tailwind-merge": "^3.4.0",
101
+ "vaul": "^1.1.2",
102
+ "zod": "^4.2.1"
103
+ },
104
+ "devDependencies": {
105
+ "@prisma/client": "^5.22.0",
106
+ "@types/node": "^20",
107
+ "@types/react": "^19",
108
+ "@types/react-dom": "^19",
109
+ "prisma": "^5.22.0",
110
+ "tsup": "^8.0.2",
111
+ "typescript": "^5"
112
+ },
113
+ "keywords": [
114
+ "saas",
115
+ "auth",
116
+ "next-auth",
117
+ "shadcn",
118
+ "tailwind",
119
+ "react"
120
+ ],
121
+ "license": "MIT"
122
+ }
@@ -0,0 +1,106 @@
1
+ // Core Prisma Schema for SaaS Kit
2
+ // Contains base models for authentication and user management
3
+
4
+ generator client {
5
+ provider = "prisma-client-js"
6
+ }
7
+
8
+ datasource db {
9
+ provider = "postgresql"
10
+ url = env("DATABASE_URL")
11
+ }
12
+
13
+ // ==================== ENUMS ====================
14
+
15
+ enum Role {
16
+ USER
17
+ MODERATOR
18
+ ADMIN
19
+ SUPER_ADMIN
20
+ }
21
+
22
+ // ==================== AUTH MODELS (NextAuth v5) ====================
23
+
24
+ model User {
25
+ id String @id @default(cuid())
26
+ name String?
27
+ email String @unique
28
+ emailVerified DateTime?
29
+ image String?
30
+ role Role @default(USER)
31
+ createdAt DateTime @default(now())
32
+ updatedAt DateTime @updatedAt
33
+
34
+ // Relations
35
+ accounts Account[]
36
+ sessions Session[]
37
+ preferences UserPreferences?
38
+
39
+ @@map("users")
40
+ }
41
+
42
+ model Account {
43
+ id String @id @default(cuid())
44
+ userId String @map("user_id")
45
+ type String
46
+ provider String
47
+ providerAccountId String @map("provider_account_id")
48
+ refresh_token String? @db.Text
49
+ access_token String? @db.Text
50
+ expires_at Int?
51
+ token_type String?
52
+ scope String?
53
+ id_token String? @db.Text
54
+ session_state String?
55
+
56
+ user User @relation(fields: [userId], references: [id], onDelete: Cascade)
57
+
58
+ @@unique([provider, providerAccountId])
59
+ @@map("accounts")
60
+ }
61
+
62
+ model Session {
63
+ id String @id @default(cuid())
64
+ sessionToken String @unique @map("session_token")
65
+ userId String @map("user_id")
66
+ expires DateTime
67
+
68
+ user User @relation(fields: [userId], references: [id], onDelete: Cascade)
69
+
70
+ @@map("sessions")
71
+ }
72
+
73
+ model VerificationToken {
74
+ identifier String
75
+ token String
76
+ expires DateTime
77
+
78
+ @@unique([identifier, token])
79
+ @@map("verification_tokens")
80
+ }
81
+
82
+ // ==================== USER PREFERENCES ====================
83
+
84
+ model UserPreferences {
85
+ id String @id @default(cuid())
86
+ userId String @unique @map("user_id")
87
+
88
+ // Email notifications
89
+ emailMarketing Boolean @default(true) @map("email_marketing")
90
+ emailProductUpdates Boolean @default(true) @map("email_product_updates")
91
+ emailSecurityAlerts Boolean @default(true) @map("email_security_alerts")
92
+
93
+ // Push notifications
94
+ pushNotifications Boolean @default(false) @map("push_notifications")
95
+
96
+ // Preferences
97
+ theme String @default("system") // light, dark, system
98
+ language String @default("en")
99
+
100
+ createdAt DateTime @default(now()) @map("created_at")
101
+ updatedAt DateTime @updatedAt @map("updated_at")
102
+
103
+ user User @relation(fields: [userId], references: [id], onDelete: Cascade)
104
+
105
+ @@map("user_preferences")
106
+ }