@aditokmo/create-react-project 0.2.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 (82) hide show
  1. package/README.md +150 -0
  2. package/dist/index.js +129 -0
  3. package/dist/installers.js +30 -0
  4. package/dist/mapper.js +28 -0
  5. package/dist/packages.js +62 -0
  6. package/dist/questions.js +123 -0
  7. package/dist/types.js +1 -0
  8. package/dist/utils.js +101 -0
  9. package/package.json +65 -0
  10. package/templates/base/README.md +73 -0
  11. package/templates/base/eslint.config.js +23 -0
  12. package/templates/base/index.html +15 -0
  13. package/templates/base/package.json +14 -0
  14. package/templates/base/public/vite.svg +1 -0
  15. package/templates/base/src/App.tsx +9 -0
  16. package/templates/base/src/api/api.ts +29 -0
  17. package/templates/base/src/api/http.ts +27 -0
  18. package/templates/base/src/api/index.ts +2 -0
  19. package/templates/base/src/assets/react.svg +1 -0
  20. package/templates/base/src/layout/AuthLayout.tsx +0 -0
  21. package/templates/base/src/layout/MainLayout.tsx +0 -0
  22. package/templates/base/src/layout/index.ts +2 -0
  23. package/templates/base/src/main.tsx +9 -0
  24. package/templates/base/src/modules/auth/components/AuthForm.tsx +5 -0
  25. package/templates/base/src/modules/auth/hooks/useAuth.ts +55 -0
  26. package/templates/base/src/modules/auth/pages/ForgotPassword.tsx +5 -0
  27. package/templates/base/src/modules/auth/pages/Login.tsx +5 -0
  28. package/templates/base/src/modules/auth/pages/Register.tsx +5 -0
  29. package/templates/base/src/modules/auth/pages/index.ts +3 -0
  30. package/templates/base/src/modules/auth/services/auth.service.ts +17 -0
  31. package/templates/base/src/modules/auth/services/endpoint.ts +10 -0
  32. package/templates/base/src/modules/auth/services/index.ts +3 -0
  33. package/templates/base/src/modules/auth/services/oauth.service.ts +1 -0
  34. package/templates/base/src/modules/auth/services/password.service.ts +1 -0
  35. package/templates/base/src/modules/auth/types/auth.types.ts +3 -0
  36. package/templates/base/src/modules/auth/types/index.ts +3 -0
  37. package/templates/base/src/modules/auth/types/oauth.types.ts +1 -0
  38. package/templates/base/src/modules/auth/types/password.types.ts +1 -0
  39. package/templates/base/src/modules/common/pages/NotFound.tsx +14 -0
  40. package/templates/base/src/modules/common/pages/index.ts +1 -0
  41. package/templates/base/src/utils/api-error-handler.ts +25 -0
  42. package/templates/base/tsconfig.app.json +32 -0
  43. package/templates/base/tsconfig.json +13 -0
  44. package/templates/base/tsconfig.node.json +26 -0
  45. package/templates/base/vite-env.d.ts +1 -0
  46. package/templates/base/vite.config.ts +18 -0
  47. package/templates/hooks/index.ts +0 -0
  48. package/templates/hooks/useDebounce.ts +1 -0
  49. package/templates/hooks/useTheme.ts +1 -0
  50. package/templates/hooks/useThrottle.ts +1 -0
  51. package/templates/hooks/useWebStorage.ts +1 -0
  52. package/templates/router/react-router/src/components/ProtectedRoute.tsx +20 -0
  53. package/templates/router/react-router/src/components/PublicRoute.tsx +20 -0
  54. package/templates/router/react-router/src/modules/auth/routes/index.tsx +21 -0
  55. package/templates/router/react-router/src/routes/AppRoutes.tsx +18 -0
  56. package/templates/router/react-router/src/routes/index.ts +3 -0
  57. package/templates/router/tanstack-router/src/providers/TanstackRouterProvider.tsx +14 -0
  58. package/templates/router/tanstack-router/src/routes/__root.tsx +13 -0
  59. package/templates/router/tanstack-router/src/routes/_protected/index.tsx +10 -0
  60. package/templates/router/tanstack-router/src/routes/_protected.tsx +18 -0
  61. package/templates/router/tanstack-router/src/routes/_public/forgot-password.tsx +6 -0
  62. package/templates/router/tanstack-router/src/routes/_public/login.tsx +6 -0
  63. package/templates/router/tanstack-router/src/routes/_public/register.tsx +6 -0
  64. package/templates/router/tanstack-router/src/routes/_public.tsx +13 -0
  65. package/templates/state/react-query/src/hook/useAuth.ts +43 -0
  66. package/templates/state/react-query/src/provider/ReactQueryProvider.tsx +22 -0
  67. package/templates/state/react-query/src/provider/index.ts +1 -0
  68. package/templates/state/zustand/src/auth/useAuthStore.ts +29 -0
  69. package/templates/state/zustand/src/index.ts +2 -0
  70. package/templates/state/zustand/src/theme/useThemeStore.ts +27 -0
  71. package/templates/styles/css/src/404.css +101 -0
  72. package/templates/styles/css/src/main.css +70 -0
  73. package/templates/styles/css/src/variables.css +15 -0
  74. package/templates/styles/scss/src/404.scss +103 -0
  75. package/templates/styles/scss/src/_index.scss +2 -0
  76. package/templates/styles/scss/src/_mixins.scss +27 -0
  77. package/templates/styles/scss/src/_variables.scss +28 -0
  78. package/templates/styles/scss/src/main.scss +20 -0
  79. package/templates/styles/tailwind/config/_vite.config.ts +14 -0
  80. package/templates/styles/tailwind/src/404.css +98 -0
  81. package/templates/styles/tailwind/src/main.css +123 -0
  82. package/templates/ui/shadcn/src/components/ui/button.tsx +62 -0
@@ -0,0 +1,98 @@
1
+ .not-found-wrapper {
2
+ display: flex;
3
+ flex-direction: column;
4
+ align-items: center;
5
+ justify-content: center;
6
+ min-height: 100vh;
7
+ padding: 20px;
8
+ text-align: center;
9
+ background: #e6edfc;
10
+ }
11
+
12
+ .not-found-content {
13
+ padding: 100px 70px;
14
+ background: #fff;
15
+ max-width: 700px;
16
+ width: 100%;
17
+ display: flex;
18
+ flex-direction: column;
19
+ justify-content: center;
20
+ align-items: center;
21
+ border-radius: 24px;
22
+ box-shadow: 0px 0px 14px -14px rgba(0, 0, 0, 0.75);
23
+ }
24
+
25
+ .not-found-content span {
26
+ color: #666666;
27
+ font-weight: 700;
28
+ font-size: 6rem;
29
+ line-height: 1;
30
+ }
31
+
32
+ .not-found-content h1 {
33
+ font-size: 2.5rem;
34
+ font-weight: 600;
35
+ margin: 0;
36
+ color: #111111;
37
+ }
38
+
39
+ .not-found-content p {
40
+ font-size: 1rem;
41
+ color: #666666;
42
+ max-width: 360px;
43
+ width: 100%;
44
+ margin: 10px 0;
45
+ }
46
+
47
+ .not-found-content a {
48
+ font-size: 0.9rem;
49
+ color: #fff;
50
+ background-color: #37538a;
51
+ padding: 10px 30px;
52
+ margin-top: 20px;
53
+ border-radius: 10px;
54
+ transition: 0.2s;
55
+ cursor: pointer;
56
+ text-decoration: none;
57
+ display: inline-block;
58
+ }
59
+
60
+ .not-found-content a:hover {
61
+ background: #263c67;
62
+ }
63
+
64
+ @media (max-width: 768px) {
65
+ .not-found-content {
66
+ padding: 60px 40px;
67
+ max-width: 90%;
68
+ }
69
+ .not-found-content span {
70
+ font-size: 4.5rem;
71
+ margin-bottom: 20px;
72
+ }
73
+ .not-found-content h1 {
74
+ font-size: 2rem;
75
+ }
76
+ }
77
+
78
+ @media (max-width: 480px) {
79
+ .not-found-content {
80
+ padding: 40px 20px;
81
+ border-radius: 16px;
82
+ }
83
+ .not-found-content span {
84
+ font-size: 3.5rem;
85
+ margin-bottom: 20px;
86
+ }
87
+ .not-found-content h1 {
88
+ font-size: 1.5rem;
89
+ }
90
+ .not-found-content p {
91
+ font-size: 0.9rem;
92
+ }
93
+ .not-found-content a {
94
+ width: 100%;
95
+ box-sizing: border-box;
96
+ text-align: center;
97
+ }
98
+ }
@@ -0,0 +1,123 @@
1
+ @import "tailwindcss";
2
+ @import "tw-animate-css";
3
+
4
+ @custom-variant dark (&:is(.dark *));
5
+
6
+ @theme inline {
7
+ --radius-sm: calc(var(--radius) - 4px);
8
+ --radius-md: calc(var(--radius) - 2px);
9
+ --radius-lg: var(--radius);
10
+ --radius-xl: calc(var(--radius) + 4px);
11
+ --radius-2xl: calc(var(--radius) + 8px);
12
+ --radius-3xl: calc(var(--radius) + 12px);
13
+ --radius-4xl: calc(var(--radius) + 16px);
14
+ --color-background: var(--background);
15
+ --color-foreground: var(--foreground);
16
+ --color-card: var(--card);
17
+ --color-card-foreground: var(--card-foreground);
18
+ --color-popover: var(--popover);
19
+ --color-popover-foreground: var(--popover-foreground);
20
+ --color-primary: var(--primary);
21
+ --color-primary-foreground: var(--primary-foreground);
22
+ --color-secondary: var(--secondary);
23
+ --color-secondary-foreground: var(--secondary-foreground);
24
+ --color-muted: var(--muted);
25
+ --color-muted-foreground: var(--muted-foreground);
26
+ --color-accent: var(--accent);
27
+ --color-accent-foreground: var(--accent-foreground);
28
+ --color-destructive: var(--destructive);
29
+ --color-border: var(--border);
30
+ --color-input: var(--input);
31
+ --color-ring: var(--ring);
32
+ --color-chart-1: var(--chart-1);
33
+ --color-chart-2: var(--chart-2);
34
+ --color-chart-3: var(--chart-3);
35
+ --color-chart-4: var(--chart-4);
36
+ --color-chart-5: var(--chart-5);
37
+ --color-sidebar: var(--sidebar);
38
+ --color-sidebar-foreground: var(--sidebar-foreground);
39
+ --color-sidebar-primary: var(--sidebar-primary);
40
+ --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
41
+ --color-sidebar-accent: var(--sidebar-accent);
42
+ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
43
+ --color-sidebar-border: var(--sidebar-border);
44
+ --color-sidebar-ring: var(--sidebar-ring);
45
+ }
46
+
47
+ :root {
48
+ --radius: 0.625rem;
49
+ --background: oklch(1 0 0);
50
+ --foreground: oklch(0.145 0 0);
51
+ --card: oklch(1 0 0);
52
+ --card-foreground: oklch(0.145 0 0);
53
+ --popover: oklch(1 0 0);
54
+ --popover-foreground: oklch(0.145 0 0);
55
+ --primary: oklch(0.205 0 0);
56
+ --primary-foreground: oklch(0.985 0 0);
57
+ --secondary: oklch(0.97 0 0);
58
+ --secondary-foreground: oklch(0.205 0 0);
59
+ --muted: oklch(0.97 0 0);
60
+ --muted-foreground: oklch(0.556 0 0);
61
+ --accent: oklch(0.97 0 0);
62
+ --accent-foreground: oklch(0.205 0 0);
63
+ --destructive: oklch(0.577 0.245 27.325);
64
+ --border: oklch(0.922 0 0);
65
+ --input: oklch(0.922 0 0);
66
+ --ring: oklch(0.708 0 0);
67
+ --chart-1: oklch(0.646 0.222 41.116);
68
+ --chart-2: oklch(0.6 0.118 184.704);
69
+ --chart-3: oklch(0.398 0.07 227.392);
70
+ --chart-4: oklch(0.828 0.189 84.429);
71
+ --chart-5: oklch(0.769 0.188 70.08);
72
+ --sidebar: oklch(0.985 0 0);
73
+ --sidebar-foreground: oklch(0.145 0 0);
74
+ --sidebar-primary: oklch(0.205 0 0);
75
+ --sidebar-primary-foreground: oklch(0.985 0 0);
76
+ --sidebar-accent: oklch(0.97 0 0);
77
+ --sidebar-accent-foreground: oklch(0.205 0 0);
78
+ --sidebar-border: oklch(0.922 0 0);
79
+ --sidebar-ring: oklch(0.708 0 0);
80
+ }
81
+
82
+ .dark {
83
+ --background: oklch(0.145 0 0);
84
+ --foreground: oklch(0.985 0 0);
85
+ --card: oklch(0.205 0 0);
86
+ --card-foreground: oklch(0.985 0 0);
87
+ --popover: oklch(0.205 0 0);
88
+ --popover-foreground: oklch(0.985 0 0);
89
+ --primary: oklch(0.922 0 0);
90
+ --primary-foreground: oklch(0.205 0 0);
91
+ --secondary: oklch(0.269 0 0);
92
+ --secondary-foreground: oklch(0.985 0 0);
93
+ --muted: oklch(0.269 0 0);
94
+ --muted-foreground: oklch(0.708 0 0);
95
+ --accent: oklch(0.269 0 0);
96
+ --accent-foreground: oklch(0.985 0 0);
97
+ --destructive: oklch(0.704 0.191 22.216);
98
+ --border: oklch(1 0 0 / 10%);
99
+ --input: oklch(1 0 0 / 15%);
100
+ --ring: oklch(0.556 0 0);
101
+ --chart-1: oklch(0.488 0.243 264.376);
102
+ --chart-2: oklch(0.696 0.17 162.48);
103
+ --chart-3: oklch(0.769 0.188 70.08);
104
+ --chart-4: oklch(0.627 0.265 303.9);
105
+ --chart-5: oklch(0.645 0.246 16.439);
106
+ --sidebar: oklch(0.205 0 0);
107
+ --sidebar-foreground: oklch(0.985 0 0);
108
+ --sidebar-primary: oklch(0.488 0.243 264.376);
109
+ --sidebar-primary-foreground: oklch(0.985 0 0);
110
+ --sidebar-accent: oklch(0.269 0 0);
111
+ --sidebar-accent-foreground: oklch(0.985 0 0);
112
+ --sidebar-border: oklch(1 0 0 / 10%);
113
+ --sidebar-ring: oklch(0.556 0 0);
114
+ }
115
+
116
+ @layer base {
117
+ * {
118
+ @apply border-border outline-ring/50;
119
+ }
120
+ body {
121
+ @apply bg-background text-foreground;
122
+ }
123
+ }
@@ -0,0 +1,62 @@
1
+ import * as React from "react"
2
+ import { Slot } from "@radix-ui/react-slot"
3
+ import { cva, type VariantProps } from "class-variance-authority"
4
+
5
+ import { cn } from "@/lib/utils"
6
+
7
+ const buttonVariants = cva(
8
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
9
+ {
10
+ variants: {
11
+ variant: {
12
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
13
+ destructive:
14
+ "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
15
+ outline:
16
+ "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
17
+ secondary:
18
+ "bg-secondary text-secondary-foreground hover:bg-secondary/80",
19
+ ghost:
20
+ "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
21
+ link: "text-primary underline-offset-4 hover:underline",
22
+ },
23
+ size: {
24
+ default: "h-9 px-4 py-2 has-[>svg]:px-3",
25
+ sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
26
+ lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
27
+ icon: "size-9",
28
+ "icon-sm": "size-8",
29
+ "icon-lg": "size-10",
30
+ },
31
+ },
32
+ defaultVariants: {
33
+ variant: "default",
34
+ size: "default",
35
+ },
36
+ }
37
+ )
38
+
39
+ function Button({
40
+ className,
41
+ variant = "default",
42
+ size = "default",
43
+ asChild = false,
44
+ ...props
45
+ }: React.ComponentProps<"button"> &
46
+ VariantProps<typeof buttonVariants> & {
47
+ asChild?: boolean
48
+ }) {
49
+ const Comp = asChild ? Slot : "button"
50
+
51
+ return (
52
+ <Comp
53
+ data-slot="button"
54
+ data-variant={variant}
55
+ data-size={size}
56
+ className={cn(buttonVariants({ variant, size, className }))}
57
+ {...props}
58
+ />
59
+ )
60
+ }
61
+
62
+ export { Button, buttonVariants }