ta_data_mas 0.0.2

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 (219) hide show
  1. package/README.md +42 -0
  2. package/apps/api/.prettierrc +4 -0
  3. package/apps/api/README.md +98 -0
  4. package/apps/api/drizzle/0000_right_drax.sql +87 -0
  5. package/apps/api/drizzle/meta/0000_snapshot.json +588 -0
  6. package/apps/api/drizzle/meta/_journal.json +13 -0
  7. package/apps/api/drizzle.config.ts +12 -0
  8. package/apps/api/eslint.config.mjs +35 -0
  9. package/apps/api/nest-cli.json +8 -0
  10. package/apps/api/package.json +99 -0
  11. package/apps/api/src/app.controller.spec.ts +25 -0
  12. package/apps/api/src/app.controller.ts +9 -0
  13. package/apps/api/src/app.module.ts +37 -0
  14. package/apps/api/src/app.service.ts +8 -0
  15. package/apps/api/src/auth/auth.controller.ts +113 -0
  16. package/apps/api/src/auth/auth.module.ts +15 -0
  17. package/apps/api/src/auth/auth.service.ts +309 -0
  18. package/apps/api/src/auth/decorators/current-user-decorator.ts +10 -0
  19. package/apps/api/src/auth/decorators/require-org-role-decorator.ts +7 -0
  20. package/apps/api/src/auth/dto/login.dto.ts +10 -0
  21. package/apps/api/src/auth/dto/register.dto.ts +14 -0
  22. package/apps/api/src/auth/guards/jwt-auth-guard.ts +40 -0
  23. package/apps/api/src/auth/guards/org-role.guards.ts +60 -0
  24. package/apps/api/src/db/db.module.ts +9 -0
  25. package/apps/api/src/db/drizzle.service.ts +16 -0
  26. package/apps/api/src/db/schema/index.ts +6 -0
  27. package/apps/api/src/db/schema/organizations.ts +30 -0
  28. package/apps/api/src/db/schema/projects.ts +26 -0
  29. package/apps/api/src/db/schema/query-history.ts +16 -0
  30. package/apps/api/src/db/schema/storage-buckets.ts +17 -0
  31. package/apps/api/src/db/schema/storage-objects.ts +18 -0
  32. package/apps/api/src/db/schema/users.ts +14 -0
  33. package/apps/api/src/main.ts +51 -0
  34. package/apps/api/src/members/dto/invite-member-dto.ts +6 -0
  35. package/apps/api/src/members/dto/update-role.dto.ts +8 -0
  36. package/apps/api/src/members/invite.service.ts +147 -0
  37. package/apps/api/src/members/members.controller.ts +56 -0
  38. package/apps/api/src/members/members.module.ts +13 -0
  39. package/apps/api/src/members/members.service.ts +85 -0
  40. package/apps/api/src/orgs/dto/create-org.dto.ts +8 -0
  41. package/apps/api/src/orgs/orgs.controller.ts +27 -0
  42. package/apps/api/src/orgs/orgs.module.ts +12 -0
  43. package/apps/api/src/orgs/orgs.service.ts +86 -0
  44. package/apps/api/src/project-api/project-api.controller.ts +95 -0
  45. package/apps/api/src/project-api/project-api.module.ts +12 -0
  46. package/apps/api/src/project-api/project-api.service.ts +196 -0
  47. package/apps/api/src/project-api/project-key.guard.ts +45 -0
  48. package/apps/api/src/project-api/query-parser.ts +129 -0
  49. package/apps/api/src/project-auth/dto/magic-link.dto.ts +7 -0
  50. package/apps/api/src/project-auth/dto/signin.dto.ts +10 -0
  51. package/apps/api/src/project-auth/dto/signup.dto.ts +11 -0
  52. package/apps/api/src/project-auth/project-auth-dashboard.controller.ts +35 -0
  53. package/apps/api/src/project-auth/project-auth.controller.ts +111 -0
  54. package/apps/api/src/project-auth/project-auth.module.ts +13 -0
  55. package/apps/api/src/project-auth/project-auth.service.ts +440 -0
  56. package/apps/api/src/projects/dto/create-project.dto.ts +9 -0
  57. package/apps/api/src/projects/projects.controller.ts +34 -0
  58. package/apps/api/src/projects/projects.module.ts +12 -0
  59. package/apps/api/src/projects/projects.service.ts +136 -0
  60. package/apps/api/src/realtime/realtime-socket.type.ts +14 -0
  61. package/apps/api/src/realtime/realtime.controller.ts +63 -0
  62. package/apps/api/src/realtime/realtime.gateway.ts +150 -0
  63. package/apps/api/src/realtime/realtime.module.ts +14 -0
  64. package/apps/api/src/realtime/realtime.service.ts +101 -0
  65. package/apps/api/src/realtime/trigger.service.ts +95 -0
  66. package/apps/api/src/sql-editor/dto/execute-query.dto.ts +7 -0
  67. package/apps/api/src/sql-editor/sql-editor.controller.ts +28 -0
  68. package/apps/api/src/sql-editor/sql-editor.module.ts +12 -0
  69. package/apps/api/src/sql-editor/sql-editor.service.ts +154 -0
  70. package/apps/api/src/storage/project-storage.controller.ts +140 -0
  71. package/apps/api/src/storage/storage.controller.ts +118 -0
  72. package/apps/api/src/storage/storage.module.ts +15 -0
  73. package/apps/api/src/storage/storage.service.ts +191 -0
  74. package/apps/api/src/storage/uploadthing.ts +23 -0
  75. package/apps/api/src/table-editor/dto/alter-table.dto.ts +15 -0
  76. package/apps/api/src/table-editor/dto/create-table.dto.ts +54 -0
  77. package/apps/api/src/table-editor/table-editor.controller.ts +117 -0
  78. package/apps/api/src/table-editor/table-editor.module.ts +12 -0
  79. package/apps/api/src/table-editor/table-editor.service.ts +366 -0
  80. package/apps/api/test/app.e2e-spec.ts +29 -0
  81. package/apps/api/test/jest-e2e.json +9 -0
  82. package/apps/api/tsconfig.build.json +4 -0
  83. package/apps/api/tsconfig.json +25 -0
  84. package/apps/web/.env.example +12 -0
  85. package/apps/web/AGENTS.md +9 -0
  86. package/apps/web/CLAUDE.md +1 -0
  87. package/apps/web/README.md +36 -0
  88. package/apps/web/components.json +25 -0
  89. package/apps/web/eslint.config.mjs +18 -0
  90. package/apps/web/next.config.ts +11 -0
  91. package/apps/web/package.json +48 -0
  92. package/apps/web/postcss.config.mjs +7 -0
  93. package/apps/web/public/file.svg +1 -0
  94. package/apps/web/public/globe.svg +1 -0
  95. package/apps/web/public/logo.svg +4 -0
  96. package/apps/web/public/next.svg +1 -0
  97. package/apps/web/public/vercel.svg +1 -0
  98. package/apps/web/public/window.svg +1 -0
  99. package/apps/web/src/app/(dashboard)/layout.tsx +33 -0
  100. package/apps/web/src/app/(dashboard)/organizations/(list)/layout.tsx +7 -0
  101. package/apps/web/src/app/(dashboard)/organizations/(list)/new/page.tsx +26 -0
  102. package/apps/web/src/app/(dashboard)/organizations/(list)/page.tsx +44 -0
  103. package/apps/web/src/app/(dashboard)/organizations/[slug]/[projectSlug]/api/page.tsx +13 -0
  104. package/apps/web/src/app/(dashboard)/organizations/[slug]/[projectSlug]/auth/layout.tsx +19 -0
  105. package/apps/web/src/app/(dashboard)/organizations/[slug]/[projectSlug]/auth/page.tsx +10 -0
  106. package/apps/web/src/app/(dashboard)/organizations/[slug]/[projectSlug]/auth/providers/page.tsx +19 -0
  107. package/apps/web/src/app/(dashboard)/organizations/[slug]/[projectSlug]/auth/url-configuration/page.tsx +24 -0
  108. package/apps/web/src/app/(dashboard)/organizations/[slug]/[projectSlug]/auth/users/page.tsx +13 -0
  109. package/apps/web/src/app/(dashboard)/organizations/[slug]/[projectSlug]/database/page.tsx +29 -0
  110. package/apps/web/src/app/(dashboard)/organizations/[slug]/[projectSlug]/realtime/page.tsx +28 -0
  111. package/apps/web/src/app/(dashboard)/organizations/[slug]/[projectSlug]/sql/page.tsx +21 -0
  112. package/apps/web/src/app/(dashboard)/organizations/[slug]/[projectSlug]/storage/page.tsx +28 -0
  113. package/apps/web/src/app/(dashboard)/organizations/[slug]/layout.tsx +20 -0
  114. package/apps/web/src/app/(dashboard)/organizations/[slug]/projects/page.tsx +62 -0
  115. package/apps/web/src/app/(dashboard)/organizations/[slug]/settings/members/page.tsx +28 -0
  116. package/apps/web/src/app/(dashboard)/organizations/[slug]/settings/page.tsx +10 -0
  117. package/apps/web/src/app/(dashboard)/settings/page.tsx +12 -0
  118. package/apps/web/src/app/dashboard/page.tsx +14 -0
  119. package/apps/web/src/app/favicon.ico +0 -0
  120. package/apps/web/src/app/globals.css +115 -0
  121. package/apps/web/src/app/layout.tsx +36 -0
  122. package/apps/web/src/app/login/page.tsx +199 -0
  123. package/apps/web/src/app/page.tsx +100 -0
  124. package/apps/web/src/app/register/page.tsx +218 -0
  125. package/apps/web/src/components/app-sidebar.tsx +301 -0
  126. package/apps/web/src/components/navbar.tsx +63 -0
  127. package/apps/web/src/components/topNav.tsx +68 -0
  128. package/apps/web/src/components/ui/avatar.tsx +112 -0
  129. package/apps/web/src/components/ui/badge.tsx +48 -0
  130. package/apps/web/src/components/ui/button.tsx +66 -0
  131. package/apps/web/src/components/ui/card.tsx +102 -0
  132. package/apps/web/src/components/ui/checkbox.tsx +32 -0
  133. package/apps/web/src/components/ui/dialog.tsx +168 -0
  134. package/apps/web/src/components/ui/dropdown-menu.tsx +269 -0
  135. package/apps/web/src/components/ui/field.tsx +238 -0
  136. package/apps/web/src/components/ui/input.tsx +19 -0
  137. package/apps/web/src/components/ui/label.tsx +24 -0
  138. package/apps/web/src/components/ui/resizable.tsx +50 -0
  139. package/apps/web/src/components/ui/scroll-area.tsx +55 -0
  140. package/apps/web/src/components/ui/select.tsx +192 -0
  141. package/apps/web/src/components/ui/separator.tsx +28 -0
  142. package/apps/web/src/components/ui/sheet.tsx +147 -0
  143. package/apps/web/src/components/ui/sidebar.tsx +703 -0
  144. package/apps/web/src/components/ui/skeleton.tsx +13 -0
  145. package/apps/web/src/components/ui/switch.tsx +33 -0
  146. package/apps/web/src/components/ui/table.tsx +116 -0
  147. package/apps/web/src/components/ui/tooltip.tsx +57 -0
  148. package/apps/web/src/features/api-docs/api-docs-client.tsx +227 -0
  149. package/apps/web/src/features/api-docs/api-docs-helpers.server.ts +86 -0
  150. package/apps/web/src/features/auth/action.ts +67 -0
  151. package/apps/web/src/features/auth/client.schema.ts +13 -0
  152. package/apps/web/src/features/auth/constants.ts +6 -0
  153. package/apps/web/src/features/auth/cookies.ts +86 -0
  154. package/apps/web/src/features/auth/server.schema.ts +11 -0
  155. package/apps/web/src/features/auth/sign-out.ts +17 -0
  156. package/apps/web/src/features/members/action.ts +66 -0
  157. package/apps/web/src/features/members/client.schema.ts +11 -0
  158. package/apps/web/src/features/members/constants.ts +8 -0
  159. package/apps/web/src/features/members/members-client.tsx +198 -0
  160. package/apps/web/src/features/members/members-helpers.server.ts +21 -0
  161. package/apps/web/src/features/members/server.schema.ts +19 -0
  162. package/apps/web/src/features/organization/action.ts +45 -0
  163. package/apps/web/src/features/organization/client.schema.ts +5 -0
  164. package/apps/web/src/features/organization/constants.tsx +3 -0
  165. package/apps/web/src/features/organization/create-org-form.tsx +66 -0
  166. package/apps/web/src/features/organization/organization-helpers.server.ts +35 -0
  167. package/apps/web/src/features/organization/server.schema.ts +10 -0
  168. package/apps/web/src/features/project-auth/project-auth-action.ts +78 -0
  169. package/apps/web/src/features/project-auth/project-auth-client.schema.ts +18 -0
  170. package/apps/web/src/features/project-auth/project-auth-constants.ts +8 -0
  171. package/apps/web/src/features/project-auth/project-auth-helpers.server.ts +39 -0
  172. package/apps/web/src/features/project-auth/project-auth-providers.tsx +222 -0
  173. package/apps/web/src/features/project-auth/project-auth-server.schema.ts +22 -0
  174. package/apps/web/src/features/project-auth/project-auth-shell.tsx +106 -0
  175. package/apps/web/src/features/project-auth/project-auth-url-config.tsx +151 -0
  176. package/apps/web/src/features/project-auth/project-auth-users.tsx +138 -0
  177. package/apps/web/src/features/projects/action.ts +46 -0
  178. package/apps/web/src/features/projects/client.schema.ts +9 -0
  179. package/apps/web/src/features/projects/constants.ts +6 -0
  180. package/apps/web/src/features/projects/create-project-modal.tsx +117 -0
  181. package/apps/web/src/features/projects/project-helpers.server.ts +38 -0
  182. package/apps/web/src/features/projects/server.schema.ts +10 -0
  183. package/apps/web/src/features/realtime/realtime-client.tsx +294 -0
  184. package/apps/web/src/features/realtime/realtime-helpers.server.ts +40 -0
  185. package/apps/web/src/features/sql-editor/sql-editor-client.tsx +324 -0
  186. package/apps/web/src/features/sql-editor/sql-editor-helpers.server.ts +22 -0
  187. package/apps/web/src/features/storage/storage-client.tsx +500 -0
  188. package/apps/web/src/features/storage/storage-helpers.server.ts +36 -0
  189. package/apps/web/src/features/table-editor/action.ts +97 -0
  190. package/apps/web/src/features/table-editor/add-column-dialog.tsx +184 -0
  191. package/apps/web/src/features/table-editor/client.schema.ts +36 -0
  192. package/apps/web/src/features/table-editor/create-table-drawer.tsx +542 -0
  193. package/apps/web/src/features/table-editor/server.schema.ts +41 -0
  194. package/apps/web/src/features/table-editor/table-editor-client.tsx +737 -0
  195. package/apps/web/src/features/table-editor/table-editor-helpers.server.ts +39 -0
  196. package/apps/web/src/hooks/use-mobile.ts +19 -0
  197. package/apps/web/src/lib/axios.ts +8 -0
  198. package/apps/web/src/lib/utils.ts +6 -0
  199. package/apps/web/src/proxy.ts +72 -0
  200. package/apps/web/src/server-utils/utils.ts +10 -0
  201. package/apps/web/tsconfig.json +34 -0
  202. package/package.json +22 -0
  203. package/packages/apiDatabase-js/package.json +39 -0
  204. package/packages/apiDatabase-js/src/auth/index.ts +121 -0
  205. package/packages/apiDatabase-js/src/client.ts +25 -0
  206. package/packages/apiDatabase-js/src/db/index.ts +15 -0
  207. package/packages/apiDatabase-js/src/db/query-builder.ts +194 -0
  208. package/packages/apiDatabase-js/src/index.ts +16 -0
  209. package/packages/apiDatabase-js/src/realtime/index.ts +84 -0
  210. package/packages/apiDatabase-js/src/storage/index.ts +130 -0
  211. package/packages/apiDatabase-js/tsconfig.json +13 -0
  212. package/packages/apiDatabase-js/tsdown.config.ts +20 -0
  213. package/packages/constants/package.json +6 -0
  214. package/packages/constants/src/index.ts +76 -0
  215. package/packages/tsconfig.json +13 -0
  216. package/packages/tsdown.config.ts +20 -0
  217. package/packages/types/package.json +6 -0
  218. package/packages/types/src/index.ts +254 -0
  219. package/pnpm-workspace.yaml +10 -0
@@ -0,0 +1,115 @@
1
+ @import 'tailwindcss';
2
+ @import 'tw-animate-css';
3
+
4
+ @custom-variant dark (&:is(.dark *));
5
+
6
+ @theme inline {
7
+ --font-sans: var(--font-geist-sans);
8
+ --font-mono: var(--font-geist-mono);
9
+ --radius-sm: calc(var(--radius) * 0.6);
10
+ --radius-md: calc(var(--radius) * 0.8);
11
+ --radius-lg: var(--radius);
12
+ --radius-xl: calc(var(--radius) * 1.4);
13
+ --color-background: var(--background);
14
+ --color-foreground: var(--foreground);
15
+ --color-card: var(--card);
16
+ --color-card-foreground: var(--card-foreground);
17
+ --color-popover: var(--popover);
18
+ --color-popover-foreground: var(--popover-foreground);
19
+ --color-primary: var(--primary);
20
+ --color-primary-foreground: var(--primary-foreground);
21
+ --color-secondary: var(--secondary);
22
+ --color-secondary-foreground: var(--secondary-foreground);
23
+ --color-muted: var(--muted);
24
+ --color-muted-foreground: var(--muted-foreground);
25
+ --color-accent: var(--accent);
26
+ --color-accent-foreground: var(--accent-foreground);
27
+ --color-destructive: var(--destructive);
28
+ --color-destructive-foreground: var(--destructive-foreground);
29
+ --color-border: var(--border);
30
+ --color-input: var(--input);
31
+ --color-ring: var(--ring);
32
+
33
+ --color-sidebar: var(--sidebar);
34
+ --color-sidebar-foreground: var(--sidebar-foreground);
35
+ --color-sidebar-primary: var(--sidebar-primary);
36
+ --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
37
+ --color-sidebar-accent: var(--sidebar-accent);
38
+ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
39
+ --color-sidebar-border: var(--sidebar-border);
40
+ --color-sidebar-ring: var(--sidebar-ring);
41
+ }
42
+
43
+ :root {
44
+ --radius: 0.625rem;
45
+ --background: oklch(1 0 0);
46
+ --foreground: oklch(0.145 0 0);
47
+ --card: oklch(1 0 0);
48
+ --card-foreground: oklch(0.145 0 0);
49
+ --popover: oklch(1 0 0);
50
+ --popover-foreground: oklch(0.145 0 0);
51
+ --primary: oklch(0.205 0 0);
52
+ --primary-foreground: oklch(0.985 0 0);
53
+ --secondary: oklch(0.97 0 0);
54
+ --secondary-foreground: oklch(0.205 0 0);
55
+ --muted: oklch(0.97 0 0);
56
+ --muted-foreground: oklch(0.556 0 0);
57
+ --accent: oklch(0.97 0 0);
58
+ --accent-foreground: oklch(0.205 0 0);
59
+ --destructive: oklch(0.577 0.245 27.325);
60
+ --destructive-foreground: oklch(0.985 0 0);
61
+ --border: oklch(0.922 0 0);
62
+ --input: oklch(0.922 0 0);
63
+ --ring: oklch(0.708 0 0);
64
+
65
+
66
+ --sidebar: oklch(0.985 0 0);
67
+ --sidebar-foreground: oklch(0.145 0 0);
68
+ --sidebar-primary: oklch(0.205 0 0);
69
+ --sidebar-primary-foreground: oklch(0.985 0 0);
70
+ --sidebar-accent: oklch(0.955 0 0);
71
+ --sidebar-accent-foreground: oklch(0.205 0 0);
72
+ --sidebar-border: oklch(0.922 0 0);
73
+ --sidebar-ring: oklch(0.708 0 0);
74
+ }
75
+
76
+ .dark {
77
+ --background: oklch(0.145 0 0);
78
+ --foreground: oklch(0.985 0 0);
79
+ --card: oklch(0.205 0 0);
80
+ --card-foreground: oklch(0.985 0 0);
81
+ --popover: oklch(0.205 0 0);
82
+ --popover-foreground: oklch(0.985 0 0);
83
+ --primary: oklch(0.922 0 0);
84
+ --primary-foreground: oklch(0.205 0 0);
85
+ --secondary: oklch(0.269 0 0);
86
+ --secondary-foreground: oklch(0.985 0 0);
87
+ --muted: oklch(0.269 0 0);
88
+ --muted-foreground: oklch(0.708 0 0);
89
+ --accent: oklch(0.371 0 0);
90
+ --accent-foreground: oklch(0.985 0 0);
91
+ --destructive: oklch(0.704 0.191 22.216);
92
+ --destructive-foreground: oklch(0.985 0 0);
93
+ --border: oklch(1 0 0 / 10%);
94
+ --input: oklch(1 0 0 / 15%);
95
+ --ring: oklch(0.556 0 0);
96
+
97
+ --sidebar: oklch(0.18 0 0);
98
+ --sidebar-foreground: oklch(0.985 0 0);
99
+ --sidebar-primary: oklch(0.985 0 0);
100
+ --sidebar-primary-foreground: oklch(0.205 0 0);
101
+ --sidebar-accent: oklch(0.24 0 0);
102
+ --sidebar-accent-foreground: oklch(0.985 0 0);
103
+ --sidebar-border: oklch(1 0 0 / 10%);
104
+ --sidebar-ring: oklch(0.556 0 0);
105
+ }
106
+
107
+ @layer base {
108
+ * {
109
+ @apply border-border outline-ring/50;
110
+ }
111
+
112
+ body {
113
+ @apply bg-background text-foreground font-sans antialiased;
114
+ }
115
+ }
@@ -0,0 +1,36 @@
1
+ import type { Metadata } from "next";
2
+ import { Geist, Geist_Mono } from "next/font/google";
3
+ import "./globals.css";
4
+ import { TooltipProvider } from "@/components/ui/tooltip";
5
+
6
+ const geistSans = Geist({
7
+ variable: "--font-geist-sans",
8
+ subsets: ["latin"],
9
+ });
10
+
11
+ const geistMono = Geist_Mono({
12
+ variable: "--font-geist-mono",
13
+ subsets: ["latin"],
14
+ });
15
+
16
+ export const metadata: Metadata = {
17
+ title: "Api_Database Model",
18
+ description: "Generated by create next app",
19
+ };
20
+
21
+ export default function RootLayout({
22
+ children,
23
+ }: Readonly<{
24
+ children: React.ReactNode;
25
+ }>) {
26
+ return (
27
+ <html
28
+ lang="en"
29
+ className={`${geistSans.variable} ${geistMono.variable} h-full antialiased`}
30
+ >
31
+ <body className="min-h-full flex flex-col">
32
+ <TooltipProvider>{children}</TooltipProvider>
33
+ </body>
34
+ </html>
35
+ );
36
+ }
@@ -0,0 +1,199 @@
1
+ "use client";
2
+
3
+ import { useActionState } from "react";
4
+ import Image from "next/image";
5
+ import { Controller, useForm } from "react-hook-form";
6
+ import { zodResolver } from "@hookform/resolvers/zod";
7
+ import { z } from "zod";
8
+ import Link from "next/link";
9
+ import { Button } from "@/components/ui/button";
10
+ import {
11
+ Card,
12
+ CardContent,
13
+ CardDescription,
14
+ CardHeader,
15
+ CardTitle,
16
+ } from "@/components/ui/card";
17
+ import {
18
+ Field,
19
+ FieldError,
20
+ FieldGroup,
21
+ FieldLabel,
22
+ } from "@/components/ui/field";
23
+ import { Input } from "@/components/ui/input";
24
+ import { authAction } from "@/features/auth/action";
25
+ import { AUTH_INTENT } from "@/features/auth/constants";
26
+ import { loginSchema } from "@/features/auth/client.schema";
27
+
28
+ type LoginFormValues = z.infer<typeof loginSchema>;
29
+
30
+ export default function LoginPage() {
31
+ const [state, formAction, isPending] = useActionState(authAction, {});
32
+
33
+ const form = useForm<LoginFormValues>({
34
+ resolver: zodResolver(loginSchema),
35
+ defaultValues: { email: "", password: "" },
36
+ });
37
+
38
+ return (
39
+ <main className="px-4 py-4">
40
+ <Link className="flex items-center gap-2 italic font-semibold" href="/">
41
+ <Image
42
+ className="h-9 md:h-9.5 w-auto shrink-0 "
43
+ src="/logo.svg"
44
+ alt="Logo"
45
+ width={140}
46
+ height={40}
47
+ priority
48
+ fetchPriority="high"
49
+ />
50
+ ta_data_mas
51
+ </Link>
52
+
53
+ <div className="min-h-screen flex items-center justify-center bg-muted/40 px-4 py-12">
54
+ <Card className="w-full max-w-md shadow-sm italic">
55
+ <CardHeader>
56
+ <CardTitle>Welcome back</CardTitle>
57
+ <CardDescription>
58
+ Sign in to your ta_data_mas account
59
+ </CardDescription>
60
+ </CardHeader>
61
+ <CardContent>
62
+ {state.error && (
63
+ <div className="bg-destructive/10 text-destructive text-sm rounded-lg px-4 py-3 mb-4">
64
+ {state.error}
65
+ </div>
66
+ )}
67
+
68
+ <form
69
+ action={formAction}
70
+ noValidate
71
+ onSubmitCapture={async (e) => {
72
+ const ok = await form.trigger(undefined, { shouldFocus: true });
73
+ if (!ok) e.preventDefault();
74
+ }}
75
+ className="space-y-4"
76
+ >
77
+ <FieldGroup>
78
+ <Controller
79
+ name="email"
80
+ control={form.control}
81
+ render={({ field, fieldState }) => (
82
+ <Field data-invalid={fieldState.invalid}>
83
+ <FieldLabel htmlFor="login-email">Email</FieldLabel>
84
+ <Input
85
+ {...field}
86
+ id="login-email"
87
+ type="email"
88
+ autoComplete="email"
89
+ aria-invalid={fieldState.invalid}
90
+ />
91
+ {fieldState.invalid && (
92
+ <FieldError errors={[fieldState.error]} />
93
+ )}
94
+ </Field>
95
+ )}
96
+ />
97
+
98
+ <Controller
99
+ name="password"
100
+ control={form.control}
101
+ render={({ field, fieldState }) => (
102
+ <Field data-invalid={fieldState.invalid}>
103
+ <FieldLabel htmlFor="login-password">Password</FieldLabel>
104
+ <Input
105
+ {...field}
106
+ id="login-password"
107
+ type="password"
108
+ autoComplete="current-password"
109
+ aria-invalid={fieldState.invalid}
110
+ />
111
+ {fieldState.invalid && (
112
+ <FieldError errors={[fieldState.error]} />
113
+ )}
114
+ </Field>
115
+ )}
116
+ />
117
+ </FieldGroup>
118
+
119
+ <Button
120
+ type="submit"
121
+ name="intent"
122
+ value={AUTH_INTENT.LOGIN}
123
+ disabled={isPending}
124
+ size="lg"
125
+ className="w-full"
126
+ >
127
+ {isPending ? "Signing in..." : "Sign in"}
128
+ </Button>
129
+ </form>
130
+
131
+ <div className="relative my-6">
132
+ <div className="absolute inset-0 flex items-center">
133
+ <div className="w-full border-t" />
134
+ </div>
135
+ <div className="relative flex justify-center text-xs text-muted-foreground bg-card px-2">
136
+ or continue with
137
+ </div>
138
+ </div>
139
+
140
+ <div className="space-y-3">
141
+ <Button variant="outline" size="lg" className="w-full" asChild>
142
+ <a
143
+ href={`${process.env.NEXT_PUBLIC_API_URL}/auth/google`}
144
+ className="inline-flex items-center justify-center gap-2"
145
+ >
146
+ <svg className="size-4 shrink-0" viewBox="0 0 24 24">
147
+ <path
148
+ fill="#4285F4"
149
+ d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"
150
+ />
151
+ <path
152
+ fill="#34A853"
153
+ d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"
154
+ />
155
+ <path
156
+ fill="#FBBC05"
157
+ d="M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l3.66-2.84z"
158
+ />
159
+ <path
160
+ fill="#EA4335"
161
+ d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"
162
+ />
163
+ </svg>
164
+ Continue with Google
165
+ </a>
166
+ </Button>
167
+
168
+ <Button variant="outline" size="lg" className="w-full" asChild>
169
+ <a
170
+ href={`${process.env.NEXT_PUBLIC_API_URL}/auth/github`}
171
+ className="inline-flex items-center justify-center gap-2"
172
+ >
173
+ <svg
174
+ className="size-4 shrink-0"
175
+ fill="currentColor"
176
+ viewBox="0 0 24 24"
177
+ >
178
+ <path d="M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z" />
179
+ </svg>
180
+ Continue with GitHub
181
+ </a>
182
+ </Button>
183
+ </div>
184
+
185
+ <p className="text-center text-sm text-muted-foreground mt-6">
186
+ Don&apos;t have an account?{" "}
187
+ <Link
188
+ href="/register"
189
+ className="font-medium text-foreground hover:underline"
190
+ >
191
+ Sign up
192
+ </Link>
193
+ </p>
194
+ </CardContent>
195
+ </Card>
196
+ </div>
197
+ </main>
198
+ );
199
+ }
@@ -0,0 +1,100 @@
1
+ "use client";
2
+ import {
3
+ RocketIcon,
4
+ ShapesIcon,
5
+ ThumbsUpIcon,
6
+ HardDrive,
7
+ BookHeart,
8
+ DatabasePlus,
9
+ KeySquare,
10
+ } from "lucide-react";
11
+
12
+ import Navbar from "@/components/navbar";
13
+
14
+ export const featuresData = [
15
+ {
16
+ icon: DatabasePlus,
17
+ title: "Postgres Database",
18
+ description:
19
+ "Every project is a full Postgres database.Portable,extensible and ready to query...",
20
+ },
21
+ {
22
+ icon: ThumbsUpIcon,
23
+ title: "JavaScript SDK",
24
+ description:
25
+ "Query your backend from any app with the official ta_data_mas client library...",
26
+ },
27
+ {
28
+ icon: KeySquare,
29
+ title: "Authentication",
30
+ description:
31
+ "Add user sign ups and logins.Email,magic link and OAuth providers built in...",
32
+ },
33
+ {
34
+ icon: RocketIcon,
35
+ title: "Realtime",
36
+ description: "Built multiplayer experiences with real-time data sync...",
37
+ },
38
+ {
39
+ icon: HardDrive,
40
+ title: "Storage",
41
+ description:
42
+ "Store,organize and serve large files --from avatars to large video files...",
43
+ },
44
+ {
45
+ icon: BookHeart,
46
+ title: "Data APIs",
47
+ description:
48
+ "Instant ready-to-use REST APIs for every table in your project...",
49
+ },
50
+ ];
51
+
52
+ // import { useEffect, useState } from "react";
53
+
54
+ export default function Home() {
55
+ // const [status, setStatus] = useState("checking...");
56
+
57
+ // useEffect(() => {
58
+ // fetch(`${process.env.NEXT_PUBLIC_API_URL}/health`)
59
+ // .then((r) => r.json())
60
+ // .then((data) => setStatus(data.status))
61
+ // .catch(() => setStatus("unreachable"));
62
+ // }, []);
63
+
64
+ return (
65
+ <main className=" bg-slate-300">
66
+ <nav className="mt-2">
67
+ <Navbar />
68
+ </nav>
69
+ <div className="flex items-center gap-4 flex-col mt-10">
70
+ <h1 className=" text-2xl/5 md:text-[44px]/10 font-semibold max-w-2xl italic text-center">
71
+ Build your own database with{" "}
72
+ <span className="text-blue-400 ">ta_data_mas</span>
73
+ </h1>
74
+ <p className="text-base dark:text-slate-300 max-w-lg ">
75
+ Start your project with a Postgres database,Add Authentication,Data
76
+ APIs,Realtime,Storage,and a Javascript SDK --all from one dashboard...
77
+ </p>
78
+ </div>
79
+ <div className="flex flex-wrap items-center justify-center gap-6 md:gap-4 mt-10 px-6 md:px-16 lg:px-24 xl:px-32">
80
+ {featuresData.map((feature, index) => (
81
+ <div
82
+ key={index}
83
+ className="p-3 rounded-xl space-y-3 border border-slate-200 dark:border-slate-800 bg-blue-100 dark:bg-slate-800/20 max-w-80 md:max-w-66"
84
+ >
85
+ <feature.icon
86
+ className="text-slate-500 size-8 mt-4"
87
+ strokeWidth={1.3}
88
+ />
89
+ <h3 className="text-base font-medium">{feature.title}</h3>
90
+ <p className="text-slate-700 line-clamp-2">{feature.description}</p>
91
+ </div>
92
+ ))}
93
+ </div>
94
+ </main>
95
+ // <main className="flex min-h-screen flex-col items-center justify-center p-24">
96
+ // <h1 className="text-4xl font-bold italic">ta_data_mas</h1>
97
+ // <p className="mt-4 text-gray-500">API status: {status}</p>
98
+ // </main>
99
+ );
100
+ }
@@ -0,0 +1,218 @@
1
+ "use client";
2
+
3
+ import { useActionState } from "react";
4
+ import Image from "next/image";
5
+ import { Controller, useForm } from "react-hook-form";
6
+ import { zodResolver } from "@hookform/resolvers/zod";
7
+ import { z } from "zod";
8
+ import Link from "next/link";
9
+ import { Button } from "@/components/ui/button";
10
+ import {
11
+ Card,
12
+ CardContent,
13
+ CardDescription,
14
+ CardHeader,
15
+ CardTitle,
16
+ } from "@/components/ui/card";
17
+ import {
18
+ Field,
19
+ FieldError,
20
+ FieldGroup,
21
+ FieldLabel,
22
+ } from "@/components/ui/field";
23
+ import { Input } from "@/components/ui/input";
24
+ import { authAction } from "@/features/auth/action";
25
+ import { AUTH_INTENT } from "@/features/auth/constants";
26
+ import { registerSchema } from "@/features/auth/client.schema";
27
+
28
+ type RegisterFormValues = z.infer<typeof registerSchema>;
29
+
30
+ export default function RegisterPage() {
31
+ const [state, formAction, isPending] = useActionState(authAction, {});
32
+
33
+ const form = useForm<RegisterFormValues>({
34
+ resolver: zodResolver(registerSchema),
35
+ defaultValues: { email: "", password: "", name: "" },
36
+ });
37
+
38
+ return (
39
+ <main className="px-4 py-4">
40
+ <Link className="flex items-center gap-2 italic font-semibold" href="/">
41
+ <Image
42
+ className="h-9 md:h-9.5 w-auto shrink-0 "
43
+ src="/logo.svg"
44
+ alt="Logo"
45
+ width={140}
46
+ height={40}
47
+ priority
48
+ fetchPriority="high"
49
+ />
50
+ ta_data_mas
51
+ </Link>
52
+ <div className="min-h-screen flex items-center justify-center bg-muted/40 px-4 py-12">
53
+ <Card className="w-full max-w-md shadow-sm italic">
54
+ <CardHeader>
55
+ <CardTitle>Create an account</CardTitle>
56
+ <CardDescription>
57
+ Start building with ta_data_mas Model
58
+ </CardDescription>
59
+ </CardHeader>
60
+ <CardContent>
61
+ {state.error && (
62
+ <div className="bg-destructive/10 text-destructive text-sm rounded-lg px-4 py-3 mb-4">
63
+ {state.error}
64
+ </div>
65
+ )}
66
+
67
+ <form
68
+ action={formAction}
69
+ noValidate
70
+ onSubmitCapture={async (e) => {
71
+ const ok = await form.trigger(undefined, { shouldFocus: true });
72
+ if (!ok) e.preventDefault();
73
+ }}
74
+ className="space-y-4"
75
+ >
76
+ <FieldGroup>
77
+ <Controller
78
+ name="name"
79
+ control={form.control}
80
+ render={({ field, fieldState }) => (
81
+ <Field data-invalid={fieldState.invalid}>
82
+ <FieldLabel htmlFor="register-name">Name</FieldLabel>
83
+ <Input
84
+ {...field}
85
+ id="register-name"
86
+ type="text"
87
+ autoComplete="name"
88
+ aria-invalid={fieldState.invalid}
89
+ />
90
+ {fieldState.invalid && (
91
+ <FieldError errors={[fieldState.error]} />
92
+ )}
93
+ </Field>
94
+ )}
95
+ />
96
+
97
+ <Controller
98
+ name="email"
99
+ control={form.control}
100
+ render={({ field, fieldState }) => (
101
+ <Field data-invalid={fieldState.invalid}>
102
+ <FieldLabel htmlFor="login-email">Email</FieldLabel>
103
+ <Input
104
+ {...field}
105
+ id="login-email"
106
+ type="email"
107
+ autoComplete="email"
108
+ aria-invalid={fieldState.invalid}
109
+ />
110
+ {fieldState.invalid && (
111
+ <FieldError errors={[fieldState.error]} />
112
+ )}
113
+ </Field>
114
+ )}
115
+ />
116
+
117
+ <Controller
118
+ name="password"
119
+ control={form.control}
120
+ render={({ field, fieldState }) => (
121
+ <Field data-invalid={fieldState.invalid}>
122
+ <FieldLabel htmlFor="login-password">Password</FieldLabel>
123
+ <Input
124
+ {...field}
125
+ id="login-password"
126
+ type="password"
127
+ autoComplete="current-password"
128
+ aria-invalid={fieldState.invalid}
129
+ />
130
+ {fieldState.invalid && (
131
+ <FieldError errors={[fieldState.error]} />
132
+ )}
133
+ </Field>
134
+ )}
135
+ />
136
+ </FieldGroup>
137
+
138
+ <Button
139
+ type="submit"
140
+ name="intent"
141
+ value={AUTH_INTENT.REGISTER}
142
+ disabled={isPending}
143
+ size="lg"
144
+ className="w-full"
145
+ >
146
+ {isPending ? "Creating account..." : "Create Account"}
147
+ </Button>
148
+ </form>
149
+
150
+ <div className="relative my-6">
151
+ <div className="absolute inset-0 flex items-center">
152
+ <div className="w-full border-t" />
153
+ </div>
154
+ <div className="relative flex justify-center text-xs text-muted-foreground bg-card px-2">
155
+ or continue with
156
+ </div>
157
+ </div>
158
+
159
+ <div className="space-y-3">
160
+ <Button variant="outline" size="lg" className="w-full" asChild>
161
+ <a
162
+ href={`${process.env.NEXT_PUBLIC_API_URL}/auth/google`}
163
+ className="inline-flex items-center justify-center gap-2"
164
+ >
165
+ <svg className="size-4 shrink-0" viewBox="0 0 24 24">
166
+ <path
167
+ fill="#4285F4"
168
+ d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"
169
+ />
170
+ <path
171
+ fill="#34A853"
172
+ d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"
173
+ />
174
+ <path
175
+ fill="#FBBC05"
176
+ d="M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l3.66-2.84z"
177
+ />
178
+ <path
179
+ fill="#EA4335"
180
+ d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"
181
+ />
182
+ </svg>
183
+ Continue with Google
184
+ </a>
185
+ </Button>
186
+
187
+ <Button variant="outline" size="lg" className="w-full" asChild>
188
+ <a
189
+ href={`${process.env.NEXT_PUBLIC_API_URL}/auth/github`}
190
+ className="inline-flex items-center justify-center gap-2"
191
+ >
192
+ <svg
193
+ className="size-4 shrink-0"
194
+ fill="currentColor"
195
+ viewBox="0 0 24 24"
196
+ >
197
+ <path d="M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z" />
198
+ </svg>
199
+ Continue with GitHub
200
+ </a>
201
+ </Button>
202
+ </div>
203
+
204
+ <p className="text-center text-sm text-muted-foreground mt-6">
205
+ Don&apos;t have an account?{" "}
206
+ <Link
207
+ href="/login"
208
+ className="font-medium text-foreground hover:underline"
209
+ >
210
+ Sign in
211
+ </Link>
212
+ </p>
213
+ </CardContent>
214
+ </Card>
215
+ </div>
216
+ </main>
217
+ );
218
+ }