From 9be22829430e41ab0bb9152a85b25997abcd2613 Mon Sep 17 00:00:00 2001 From: Turbobot Date: Sat, 8 Feb 2025 17:04:20 -0800 Subject: [PATCH] feat(create-turbo): apply official-starter transform --- nazara/apps/web/app/day/[date]/page.tsx | 24 +- nazara/apps/web/app/day/[date]/realtime.tsx | 64 + nazara/apps/web/app/layout.tsx | 4 +- nazara/apps/web/lib/schemas.d.ts | 177 + nazara/apps/web/lib/schemas.ts | 549 + nazara/apps/web/lib/types.ts | 624 + nazara/apps/web/package.json | 4 +- nazara/apps/web/supabase/.gitignore | 8 + nazara/apps/web/supabase/config.toml | 281 + nazara/deleteme/.gitignore | 37 + nazara/deleteme/README.md | 32 + .../apps/native/.expo-shared/assets.json | 4 + nazara/deleteme/apps/native/.gitignore | 14 + nazara/deleteme/apps/native/README.md | 3 + nazara/deleteme/apps/native/app.json | 39 + nazara/deleteme/apps/native/app/_layout.tsx | 7 + nazara/deleteme/apps/native/app/index.tsx | 33 + .../apps/native/assets/adaptive-icon.png | Bin 0 -> 17547 bytes .../deleteme/apps/native/assets/favicon.png | Bin 0 -> 1466 bytes nazara/deleteme/apps/native/assets/icon.png | Bin 0 -> 22380 bytes nazara/deleteme/apps/native/assets/splash.png | Bin 0 -> 47346 bytes nazara/deleteme/apps/native/babel.config.js | 6 + nazara/deleteme/apps/native/index.js | 1 + nazara/deleteme/apps/native/metro.config.js | 21 + nazara/deleteme/apps/native/package.json | 35 + nazara/deleteme/apps/native/tsconfig.json | 6 + nazara/deleteme/apps/web/.eslintrc.json | 3 + nazara/deleteme/apps/web/.gitignore | 34 + nazara/deleteme/apps/web/README.md | 28 + nazara/deleteme/apps/web/app/layout.tsx | 11 + nazara/deleteme/apps/web/app/page.tsx | 14 + nazara/deleteme/apps/web/next-env.d.ts | 5 + nazara/deleteme/apps/web/next.config.js | 18 + nazara/deleteme/apps/web/package.json | 28 + nazara/deleteme/apps/web/styles/global.css | 8 + .../deleteme/apps/web/styles/index.module.css | 3 + nazara/deleteme/apps/web/tsconfig.json | 8 + nazara/deleteme/package.json | 22 + .../packages/typescript-config/base.json | 19 + .../packages/typescript-config/nextjs.json | 19 + .../packages/typescript-config/package.json | 8 + .../react-native-library.json | 12 + nazara/deleteme/packages/ui/.gitignore | 28 + nazara/deleteme/packages/ui/package.json | 22 + nazara/deleteme/packages/ui/src/button.tsx | 37 + nazara/deleteme/packages/ui/src/index.tsx | 1 + nazara/deleteme/packages/ui/tsconfig.json | 8 + nazara/deleteme/packages/ui/tsup.config.ts | 15 + nazara/deleteme/turbo.json | 19 + nazara/deleteme/yarn.lock | 11726 ++++++++++++++++ nazara/pnpm-lock.yaml | 483 +- 51 files changed, 14526 insertions(+), 26 deletions(-) create mode 100644 nazara/apps/web/app/day/[date]/realtime.tsx create mode 100644 nazara/apps/web/lib/schemas.d.ts create mode 100644 nazara/apps/web/lib/schemas.ts create mode 100644 nazara/apps/web/lib/types.ts create mode 100644 nazara/apps/web/supabase/.gitignore create mode 100644 nazara/apps/web/supabase/config.toml create mode 100644 nazara/deleteme/.gitignore create mode 100644 nazara/deleteme/README.md create mode 100644 nazara/deleteme/apps/native/.expo-shared/assets.json create mode 100644 nazara/deleteme/apps/native/.gitignore create mode 100644 nazara/deleteme/apps/native/README.md create mode 100644 nazara/deleteme/apps/native/app.json create mode 100644 nazara/deleteme/apps/native/app/_layout.tsx create mode 100644 nazara/deleteme/apps/native/app/index.tsx create mode 100644 nazara/deleteme/apps/native/assets/adaptive-icon.png create mode 100644 nazara/deleteme/apps/native/assets/favicon.png create mode 100644 nazara/deleteme/apps/native/assets/icon.png create mode 100644 nazara/deleteme/apps/native/assets/splash.png create mode 100644 nazara/deleteme/apps/native/babel.config.js create mode 100644 nazara/deleteme/apps/native/index.js create mode 100644 nazara/deleteme/apps/native/metro.config.js create mode 100644 nazara/deleteme/apps/native/package.json create mode 100644 nazara/deleteme/apps/native/tsconfig.json create mode 100644 nazara/deleteme/apps/web/.eslintrc.json create mode 100644 nazara/deleteme/apps/web/.gitignore create mode 100644 nazara/deleteme/apps/web/README.md create mode 100644 nazara/deleteme/apps/web/app/layout.tsx create mode 100644 nazara/deleteme/apps/web/app/page.tsx create mode 100644 nazara/deleteme/apps/web/next-env.d.ts create mode 100644 nazara/deleteme/apps/web/next.config.js create mode 100644 nazara/deleteme/apps/web/package.json create mode 100644 nazara/deleteme/apps/web/styles/global.css create mode 100644 nazara/deleteme/apps/web/styles/index.module.css create mode 100644 nazara/deleteme/apps/web/tsconfig.json create mode 100644 nazara/deleteme/package.json create mode 100644 nazara/deleteme/packages/typescript-config/base.json create mode 100644 nazara/deleteme/packages/typescript-config/nextjs.json create mode 100644 nazara/deleteme/packages/typescript-config/package.json create mode 100644 nazara/deleteme/packages/typescript-config/react-native-library.json create mode 100644 nazara/deleteme/packages/ui/.gitignore create mode 100644 nazara/deleteme/packages/ui/package.json create mode 100644 nazara/deleteme/packages/ui/src/button.tsx create mode 100644 nazara/deleteme/packages/ui/src/index.tsx create mode 100644 nazara/deleteme/packages/ui/tsconfig.json create mode 100644 nazara/deleteme/packages/ui/tsup.config.ts create mode 100644 nazara/deleteme/turbo.json create mode 100644 nazara/deleteme/yarn.lock diff --git a/nazara/apps/web/app/day/[date]/page.tsx b/nazara/apps/web/app/day/[date]/page.tsx index 6798546..0824016 100644 --- a/nazara/apps/web/app/day/[date]/page.tsx +++ b/nazara/apps/web/app/day/[date]/page.tsx @@ -1,27 +1,31 @@ import spacetime from "spacetime"; import { createClient } from '@/utils/supabase/server'; +import RealtimeDayPage from "./realtime"; export default async function DayPage( - { date }: { date: string } + { params }: { params: { date: string } } ) { - const supabase = await createClient(); + const date = (await params).date; const { data: { user: user } } = await supabase.auth.getUser(); const { data: day } = await supabase .from('days') - .select('*') + .select(`*, + hours(*, + category:categories(id, + code, + name, + color:colors(name, hexcode, inverse) + ) + ) + `) .eq('date', date) .eq('userId', user?.id) + .limit(1).single() ; return !day ?
Loading...
: ( - <> -

{spacetime(day.date).format('{month} {date-ordinal}, {year}')}

- - + ); } diff --git a/nazara/apps/web/app/day/[date]/realtime.tsx b/nazara/apps/web/app/day/[date]/realtime.tsx new file mode 100644 index 0000000..5493867 --- /dev/null +++ b/nazara/apps/web/app/day/[date]/realtime.tsx @@ -0,0 +1,64 @@ +'use client'; +import { createClient } from "@/utils/supabase/client"; +import { useEffect, useState } from "react"; +import spacetime from "spacetime"; + +const supabase = createClient(); + +export default function RealtimeDayPage({ initialDay }) { + const [day, setDay] = useState(initialDay); + + useEffect(() => { + if (initialDay && !day) { + setDay(initialDay); + } + }, [initialDay]); + + useEffect(() => { + const daysChannel = supabase.channel('days') + .on('postgres_changes', { event: 'UPDATE', schema: 'public', table: 'days' }, (payload) => { + setDay(payload.new); + }).subscribe(); + + const hoursChannel = supabase.channel('hours') + .on('postgres_changes', { event: 'UPDATE', schema: 'public', table: 'hours' }, (payload) => { + const updatedHour = payload.new; + const prevHours = day.hours; + const newHours = prevHours.map((hour) => { + if (hour.id === updatedHour.id) { + return updatedHour; + } + return hour; + }); + const newDay = { ...day, hours: newHours }; + console.log(newDay); + setDay(newDay); + }).subscribe(); + + return () => { + daysChannel.unsubscribe(); + hoursChannel.unsubscribe(); + } + }, [supabase]) + + return ( + <> +

{spacetime(day.date).format('{month} {date-ordinal}, {year}')}

+ + + + ) +} \ No newline at end of file diff --git a/nazara/apps/web/app/layout.tsx b/nazara/apps/web/app/layout.tsx index c159347..4f58953 100644 --- a/nazara/apps/web/app/layout.tsx +++ b/nazara/apps/web/app/layout.tsx @@ -14,8 +14,8 @@ const defaultUrl = process.env.VERCEL_URL export const metadata = { metadataBase: new URL(defaultUrl), - title: "Next.js and Supabase Starter Kit", - description: "The fastest way to build apps with Next.js and Supabase", + title: "Nazara", + description: "The all in one life tracking app.", }; const geistSans = Geist({ diff --git a/nazara/apps/web/lib/schemas.d.ts b/nazara/apps/web/lib/schemas.d.ts new file mode 100644 index 0000000..c98ad59 --- /dev/null +++ b/nazara/apps/web/lib/schemas.d.ts @@ -0,0 +1,177 @@ +/* + * ========================================== + * | GENERATED BY SUPAZOD | + * ========================================== + */ + +import { z } from "zod"; +import * as generated from "./schemas"; +export type Json = z.infer; +export type PublicApikeyRowSchema = z.infer< + typeof generated.publicApikeyRowSchemaSchema +>; +export type PublicApikeyInsertSchema = z.infer< + typeof generated.publicApikeyInsertSchemaSchema +>; +export type PublicApikeyUpdateSchema = z.infer< + typeof generated.publicApikeyUpdateSchemaSchema +>; +export type PublicApikeyRelationshipsSchema = z.infer< + typeof generated.publicApikeyRelationshipsSchemaSchema +>; +export type PublicCategoriesRowSchema = z.infer< + typeof generated.publicCategoriesRowSchemaSchema +>; +export type PublicCategoriesInsertSchema = z.infer< + typeof generated.publicCategoriesInsertSchemaSchema +>; +export type PublicCategoriesUpdateSchema = z.infer< + typeof generated.publicCategoriesUpdateSchemaSchema +>; +export type PublicCategoriesRelationshipsSchema = z.infer< + typeof generated.publicCategoriesRelationshipsSchemaSchema +>; +export type PublicColorsRowSchema = z.infer< + typeof generated.publicColorsRowSchemaSchema +>; +export type PublicColorsInsertSchema = z.infer< + typeof generated.publicColorsInsertSchemaSchema +>; +export type PublicColorsUpdateSchema = z.infer< + typeof generated.publicColorsUpdateSchemaSchema +>; +export type PublicColorsRelationshipsSchema = z.infer< + typeof generated.publicColorsRelationshipsSchemaSchema +>; +export type PublicDaysRowSchema = z.infer< + typeof generated.publicDaysRowSchemaSchema +>; +export type PublicDaysInsertSchema = z.infer< + typeof generated.publicDaysInsertSchemaSchema +>; +export type PublicDaysUpdateSchema = z.infer< + typeof generated.publicDaysUpdateSchemaSchema +>; +export type PublicDaysRelationshipsSchema = z.infer< + typeof generated.publicDaysRelationshipsSchemaSchema +>; +export type PublicHoursRowSchema = z.infer< + typeof generated.publicHoursRowSchemaSchema +>; +export type PublicHoursInsertSchema = z.infer< + typeof generated.publicHoursInsertSchemaSchema +>; +export type PublicHoursUpdateSchema = z.infer< + typeof generated.publicHoursUpdateSchemaSchema +>; +export type PublicHoursRelationshipsSchema = z.infer< + typeof generated.publicHoursRelationshipsSchemaSchema +>; +export type PublicMeasurementsRowSchema = z.infer< + typeof generated.publicMeasurementsRowSchemaSchema +>; +export type PublicMeasurementsInsertSchema = z.infer< + typeof generated.publicMeasurementsInsertSchemaSchema +>; +export type PublicMeasurementsUpdateSchema = z.infer< + typeof generated.publicMeasurementsUpdateSchemaSchema +>; +export type PublicMeasurementsRelationshipsSchema = z.infer< + typeof generated.publicMeasurementsRelationshipsSchemaSchema +>; +export type PublicMetricsRowSchema = z.infer< + typeof generated.publicMetricsRowSchemaSchema +>; +export type PublicMetricsInsertSchema = z.infer< + typeof generated.publicMetricsInsertSchemaSchema +>; +export type PublicMetricsUpdateSchema = z.infer< + typeof generated.publicMetricsUpdateSchemaSchema +>; +export type PublicMetricsRelationshipsSchema = z.infer< + typeof generated.publicMetricsRelationshipsSchemaSchema +>; +export type PublicSbCategoriesRowSchema = z.infer< + typeof generated.publicSbCategoriesRowSchemaSchema +>; +export type PublicSbCategoriesInsertSchema = z.infer< + typeof generated.publicSbCategoriesInsertSchemaSchema +>; +export type PublicSbCategoriesUpdateSchema = z.infer< + typeof generated.publicSbCategoriesUpdateSchemaSchema +>; +export type PublicSbCategoriesRelationshipsSchema = z.infer< + typeof generated.publicSbCategoriesRelationshipsSchemaSchema +>; +export type PublicSbColorsRowSchema = z.infer< + typeof generated.publicSbColorsRowSchemaSchema +>; +export type PublicSbColorsInsertSchema = z.infer< + typeof generated.publicSbColorsInsertSchemaSchema +>; +export type PublicSbColorsUpdateSchema = z.infer< + typeof generated.publicSbColorsUpdateSchemaSchema +>; +export type PublicSbColorsRelationshipsSchema = z.infer< + typeof generated.publicSbColorsRelationshipsSchemaSchema +>; +export type PublicSbDaysRowSchema = z.infer< + typeof generated.publicSbDaysRowSchemaSchema +>; +export type PublicSbDaysInsertSchema = z.infer< + typeof generated.publicSbDaysInsertSchemaSchema +>; +export type PublicSbDaysUpdateSchema = z.infer< + typeof generated.publicSbDaysUpdateSchemaSchema +>; +export type PublicSbDaysRelationshipsSchema = z.infer< + typeof generated.publicSbDaysRelationshipsSchemaSchema +>; +export type PublicSbHoursRowSchema = z.infer< + typeof generated.publicSbHoursRowSchemaSchema +>; +export type PublicSbHoursInsertSchema = z.infer< + typeof generated.publicSbHoursInsertSchemaSchema +>; +export type PublicSbHoursUpdateSchema = z.infer< + typeof generated.publicSbHoursUpdateSchemaSchema +>; +export type PublicSbHoursRelationshipsSchema = z.infer< + typeof generated.publicSbHoursRelationshipsSchemaSchema +>; +export type PublicSbMeasurementsRowSchema = z.infer< + typeof generated.publicSbMeasurementsRowSchemaSchema +>; +export type PublicSbMeasurementsInsertSchema = z.infer< + typeof generated.publicSbMeasurementsInsertSchemaSchema +>; +export type PublicSbMeasurementsUpdateSchema = z.infer< + typeof generated.publicSbMeasurementsUpdateSchemaSchema +>; +export type PublicSbMeasurementsRelationshipsSchema = z.infer< + typeof generated.publicSbMeasurementsRelationshipsSchemaSchema +>; +export type PublicSbMetricsRowSchema = z.infer< + typeof generated.publicSbMetricsRowSchemaSchema +>; +export type PublicSbMetricsInsertSchema = z.infer< + typeof generated.publicSbMetricsInsertSchemaSchema +>; +export type PublicSbMetricsUpdateSchema = z.infer< + typeof generated.publicSbMetricsUpdateSchemaSchema +>; +export type PublicSbMetricsRelationshipsSchema = z.infer< + typeof generated.publicSbMetricsRelationshipsSchemaSchema +>; +export type PublicUserRowSchema = z.infer< + typeof generated.publicUserRowSchemaSchema +>; +export type PublicUserInsertSchema = z.infer< + typeof generated.publicUserInsertSchemaSchema +>; +export type PublicUserUpdateSchema = z.infer< + typeof generated.publicUserUpdateSchemaSchema +>; +export type PublicUserRelationshipsSchema = z.infer< + typeof generated.publicUserRelationshipsSchemaSchema +>; diff --git a/nazara/apps/web/lib/schemas.ts b/nazara/apps/web/lib/schemas.ts new file mode 100644 index 0000000..488dc84 --- /dev/null +++ b/nazara/apps/web/lib/schemas.ts @@ -0,0 +1,549 @@ +/* + * ========================================== + * | GENERATED BY SUPAZOD | + * ========================================== + */ + +import { z } from "zod"; +import { Json } from "./types"; + +export const jsonSchema: z.ZodSchema = z.lazy(() => + z + .union([ + z.string(), + z.number(), + z.boolean(), + z.record(z.union([jsonSchema, z.undefined()])), + z.array(jsonSchema), + ]) + .nullable(), +); + +export const publicApikeyRowSchemaSchema = z.object({ + createdAt: z.string(), + id: z.string(), + keyHash: z.string(), + keyId: z.string(), + name: z.string(), + userId: z.string().nullable(), +}); + +export const publicApikeyInsertSchemaSchema = z.object({ + createdAt: z.string().optional(), + id: z.string(), + keyHash: z.string(), + keyId: z.string(), + name: z.string(), + userId: z.string().optional().nullable(), +}); + +export const publicApikeyUpdateSchemaSchema = z.object({ + createdAt: z.string().optional(), + id: z.string().optional(), + keyHash: z.string().optional(), + keyId: z.string().optional(), + name: z.string().optional(), + userId: z.string().optional().nullable(), +}); + +export const publicApikeyRelationshipsSchemaSchema = z.tuple([]); + +export const publicCategoriesRowSchemaSchema = z.object({ + code: z.number(), + colorId: z.string(), + createdAt: z.string(), + description: z.string().nullable(), + id: z.string(), + name: z.string(), + parentId: z.string().nullable(), + userId: z.string().nullable(), +}); + +export const publicCategoriesInsertSchemaSchema = z.object({ + code: z.number(), + colorId: z.string(), + createdAt: z.string().optional(), + description: z.string().optional().nullable(), + id: z.string(), + name: z.string(), + parentId: z.string().optional().nullable(), + userId: z.string().optional().nullable(), +}); + +export const publicCategoriesUpdateSchemaSchema = z.object({ + code: z.number().optional(), + colorId: z.string().optional(), + createdAt: z.string().optional(), + description: z.string().optional().nullable(), + id: z.string().optional(), + name: z.string().optional(), + parentId: z.string().optional().nullable(), + userId: z.string().optional().nullable(), +}); + +export const publicCategoriesRelationshipsSchemaSchema = z.tuple([ + z.object({ + foreignKeyName: z.literal("category_colorId_color_id_fk"), + columns: z.tuple([z.literal("colorId")]), + isOneToOne: z.literal(false), + referencedRelation: z.literal("colors"), + referencedColumns: z.tuple([z.literal("id")]), + }), + z.object({ + foreignKeyName: z.literal("category_parentId_category_id_fk"), + columns: z.tuple([z.literal("parentId")]), + isOneToOne: z.literal(false), + referencedRelation: z.literal("categories"), + referencedColumns: z.tuple([z.literal("id")]), + }), +]); + +export const publicColorsRowSchemaSchema = z.object({ + createdAt: z.string(), + hexcode: z.string(), + id: z.string(), + inverse: z.string().nullable(), + name: z.string(), + userId: z.string().nullable(), +}); + +export const publicColorsInsertSchemaSchema = z.object({ + createdAt: z.string().optional(), + hexcode: z.string(), + id: z.string(), + inverse: z.string().optional().nullable(), + name: z.string(), + userId: z.string().optional().nullable(), +}); + +export const publicColorsUpdateSchemaSchema = z.object({ + createdAt: z.string().optional(), + hexcode: z.string().optional(), + id: z.string().optional(), + inverse: z.string().optional().nullable(), + name: z.string().optional(), + userId: z.string().optional().nullable(), +}); + +export const publicColorsRelationshipsSchemaSchema = z.tuple([]); + +export const publicDaysRowSchemaSchema = z.object({ + comment: z.string().nullable(), + date: z.string(), + id: z.string(), + mood: z.number().nullable(), + userId: z.string().nullable(), +}); + +export const publicDaysInsertSchemaSchema = z.object({ + comment: z.string().optional().nullable(), + date: z.string(), + id: z.string(), + mood: z.number().optional().nullable(), + userId: z.string().optional().nullable(), +}); + +export const publicDaysUpdateSchemaSchema = z.object({ + comment: z.string().optional().nullable(), + date: z.string().optional(), + id: z.string().optional(), + mood: z.number().optional().nullable(), + userId: z.string().optional().nullable(), +}); + +export const publicDaysRelationshipsSchemaSchema = z.tuple([]); + +export const publicHoursRowSchemaSchema = z.object({ + categoryId: z.string().nullable(), + comment: z.string().nullable(), + createdAt: z.string(), + datetime: z.string().nullable(), + dayId: z.string(), + id: z.string(), + userId: z.string().nullable(), +}); + +export const publicHoursInsertSchemaSchema = z.object({ + categoryId: z.string().optional().nullable(), + comment: z.string().optional().nullable(), + createdAt: z.string().optional(), + datetime: z.string().optional().nullable(), + dayId: z.string(), + id: z.string(), + userId: z.string().optional().nullable(), +}); + +export const publicHoursUpdateSchemaSchema = z.object({ + categoryId: z.string().optional().nullable(), + comment: z.string().optional().nullable(), + createdAt: z.string().optional(), + datetime: z.string().optional().nullable(), + dayId: z.string().optional(), + id: z.string().optional(), + userId: z.string().optional().nullable(), +}); + +export const publicHoursRelationshipsSchemaSchema = z.tuple([ + z.object({ + foreignKeyName: z.literal("hour_categoryId_category_id_fk"), + columns: z.tuple([z.literal("categoryId")]), + isOneToOne: z.literal(false), + referencedRelation: z.literal("categories"), + referencedColumns: z.tuple([z.literal("id")]), + }), + z.object({ + foreignKeyName: z.literal("hour_dayId_day_id_fk"), + columns: z.tuple([z.literal("dayId")]), + isOneToOne: z.literal(false), + referencedRelation: z.literal("days"), + referencedColumns: z.tuple([z.literal("id")]), + }), +]); + +export const publicMeasurementsRowSchemaSchema = z.object({ + createdAt: z.string(), + dayId: z.string(), + hourId: z.string().nullable(), + id: z.string(), + metricId: z.string(), + userId: z.string().nullable(), + value: z.string(), +}); + +export const publicMeasurementsInsertSchemaSchema = z.object({ + createdAt: z.string().optional(), + dayId: z.string(), + hourId: z.string().optional().nullable(), + id: z.string(), + metricId: z.string(), + userId: z.string().optional().nullable(), + value: z.string(), +}); + +export const publicMeasurementsUpdateSchemaSchema = z.object({ + createdAt: z.string().optional(), + dayId: z.string().optional(), + hourId: z.string().optional().nullable(), + id: z.string().optional(), + metricId: z.string().optional(), + userId: z.string().optional().nullable(), + value: z.string().optional(), +}); + +export const publicMeasurementsRelationshipsSchemaSchema = z.tuple([ + z.object({ + foreignKeyName: z.literal("measurement_dayId_day_id_fk"), + columns: z.tuple([z.literal("dayId")]), + isOneToOne: z.literal(false), + referencedRelation: z.literal("days"), + referencedColumns: z.tuple([z.literal("id")]), + }), + z.object({ + foreignKeyName: z.literal("measurement_hourId_hour_id_fk"), + columns: z.tuple([z.literal("hourId")]), + isOneToOne: z.literal(false), + referencedRelation: z.literal("hours"), + referencedColumns: z.tuple([z.literal("id")]), + }), + z.object({ + foreignKeyName: z.literal("measurement_metricId_metric_id_fk"), + columns: z.tuple([z.literal("metricId")]), + isOneToOne: z.literal(false), + referencedRelation: z.literal("metrics"), + referencedColumns: z.tuple([z.literal("id")]), + }), +]); + +export const publicMetricsRowSchemaSchema = z.object({ + createdAt: z.string(), + description: z.string().nullable(), + goal: z.number().nullable(), + icon: z.string(), + id: z.string(), + name: z.string(), + type: z.string(), + unit: z.string().nullable(), + userId: z.string().nullable(), +}); + +export const publicMetricsInsertSchemaSchema = z.object({ + createdAt: z.string().optional(), + description: z.string().optional().nullable(), + goal: z.number().optional().nullable(), + icon: z.string(), + id: z.string(), + name: z.string(), + type: z.string(), + unit: z.string().optional().nullable(), + userId: z.string().optional().nullable(), +}); + +export const publicMetricsUpdateSchemaSchema = z.object({ + createdAt: z.string().optional(), + description: z.string().optional().nullable(), + goal: z.number().optional().nullable(), + icon: z.string().optional(), + id: z.string().optional(), + name: z.string().optional(), + type: z.string().optional(), + unit: z.string().optional().nullable(), + userId: z.string().optional().nullable(), +}); + +export const publicMetricsRelationshipsSchemaSchema = z.tuple([]); + +export const publicSbCategoriesRowSchemaSchema = z.object({ + code: z.number(), + colorId: z.number(), + created_at: z.string(), + id: z.number(), + name: z.string(), + userId: z.string(), +}); + +export const publicSbCategoriesInsertSchemaSchema = z.object({ + code: z.number(), + colorId: z.number(), + created_at: z.string().optional(), + id: z.number().optional(), + name: z.string(), + userId: z.string(), +}); + +export const publicSbCategoriesUpdateSchemaSchema = z.object({ + code: z.number().optional(), + colorId: z.number().optional(), + created_at: z.string().optional(), + id: z.number().optional(), + name: z.string().optional(), + userId: z.string().optional(), +}); + +export const publicSbCategoriesRelationshipsSchemaSchema = z.tuple([ + z.object({ + foreignKeyName: z.literal("categories_colorId_fkey"), + columns: z.tuple([z.literal("colorId")]), + isOneToOne: z.literal(false), + referencedRelation: z.literal("sb_colors"), + referencedColumns: z.tuple([z.literal("id")]), + }), +]); + +export const publicSbColorsRowSchemaSchema = z.object({ + hexcode: z.string(), + id: z.number(), + inverse: z.string(), + name: z.string(), + userId: z.string(), +}); + +export const publicSbColorsInsertSchemaSchema = z.object({ + hexcode: z.string(), + id: z.number().optional(), + inverse: z.string(), + name: z.string(), + userId: z.string(), +}); + +export const publicSbColorsUpdateSchemaSchema = z.object({ + hexcode: z.string().optional(), + id: z.number().optional(), + inverse: z.string().optional(), + name: z.string().optional(), + userId: z.string().optional(), +}); + +export const publicSbColorsRelationshipsSchemaSchema = z.tuple([]); + +export const publicSbDaysRowSchemaSchema = z.object({ + comment: z.string().nullable(), + date: z.string(), + id: z.number(), + mood: z.number().nullable(), + userId: z.string(), +}); + +export const publicSbDaysInsertSchemaSchema = z.object({ + comment: z.string().optional().nullable(), + date: z.string(), + id: z.number().optional(), + mood: z.number().optional().nullable(), + userId: z.string(), +}); + +export const publicSbDaysUpdateSchemaSchema = z.object({ + comment: z.string().optional().nullable(), + date: z.string().optional(), + id: z.number().optional(), + mood: z.number().optional().nullable(), + userId: z.string().optional(), +}); + +export const publicSbDaysRelationshipsSchemaSchema = z.tuple([]); + +export const publicSbHoursRowSchemaSchema = z.object({ + categoryId: z.number().nullable(), + comment: z.string().nullable(), + datetime: z.string(), + dayId: z.number(), + id: z.number(), + userId: z.string().nullable(), +}); + +export const publicSbHoursInsertSchemaSchema = z.object({ + categoryId: z.number().optional().nullable(), + comment: z.string().optional().nullable(), + datetime: z.string(), + dayId: z.number(), + id: z.number().optional(), + userId: z.string().optional().nullable(), +}); + +export const publicSbHoursUpdateSchemaSchema = z.object({ + categoryId: z.number().optional().nullable(), + comment: z.string().optional().nullable(), + datetime: z.string().optional(), + dayId: z.number().optional(), + id: z.number().optional(), + userId: z.string().optional().nullable(), +}); + +export const publicSbHoursRelationshipsSchemaSchema = z.tuple([ + z.object({ + foreignKeyName: z.literal("hours_dayId_fkey"), + columns: z.tuple([z.literal("dayId")]), + isOneToOne: z.literal(false), + referencedRelation: z.literal("sb_days"), + referencedColumns: z.tuple([z.literal("id")]), + }), +]); + +export const publicSbMeasurementsRowSchemaSchema = z.object({ + created_at: z.string(), + dayId: z.number().nullable(), + hourId: z.number().nullable(), + id: z.number(), + metricId: z.number().nullable(), + type: z.string(), + userId: z.string().nullable(), + value: z.string(), +}); + +export const publicSbMeasurementsInsertSchemaSchema = z.object({ + created_at: z.string().optional(), + dayId: z.number().optional().nullable(), + hourId: z.number().optional().nullable(), + id: z.number().optional(), + metricId: z.number().optional().nullable(), + type: z.string().optional(), + userId: z.string().optional().nullable(), + value: z.string(), +}); + +export const publicSbMeasurementsUpdateSchemaSchema = z.object({ + created_at: z.string().optional(), + dayId: z.number().optional().nullable(), + hourId: z.number().optional().nullable(), + id: z.number().optional(), + metricId: z.number().optional().nullable(), + type: z.string().optional(), + userId: z.string().optional().nullable(), + value: z.string().optional(), +}); + +export const publicSbMeasurementsRelationshipsSchemaSchema = z.tuple([ + z.object({ + foreignKeyName: z.literal("measurements_dayId_fkey"), + columns: z.tuple([z.literal("dayId")]), + isOneToOne: z.literal(false), + referencedRelation: z.literal("sb_days"), + referencedColumns: z.tuple([z.literal("id")]), + }), + z.object({ + foreignKeyName: z.literal("measurements_hourId_fkey"), + columns: z.tuple([z.literal("hourId")]), + isOneToOne: z.literal(false), + referencedRelation: z.literal("sb_hours"), + referencedColumns: z.tuple([z.literal("id")]), + }), + z.object({ + foreignKeyName: z.literal("measurements_metricId_fkey"), + columns: z.tuple([z.literal("metricId")]), + isOneToOne: z.literal(false), + referencedRelation: z.literal("sb_metrics"), + referencedColumns: z.tuple([z.literal("id")]), + }), +]); + +export const publicSbMetricsRowSchemaSchema = z.object({ + created_at: z.string(), + description: z.string().nullable(), + goal: z.number().nullable(), + icon: z.string(), + id: z.number(), + name: z.string(), + type: z.string(), + unit: z.string().nullable(), + userId: z.string(), +}); + +export const publicSbMetricsInsertSchemaSchema = z.object({ + created_at: z.string().optional(), + description: z.string().optional().nullable(), + goal: z.number().optional().nullable(), + icon: z.string(), + id: z.number().optional(), + name: z.string(), + type: z.string(), + unit: z.string().optional().nullable(), + userId: z.string(), +}); + +export const publicSbMetricsUpdateSchemaSchema = z.object({ + created_at: z.string().optional(), + description: z.string().optional().nullable(), + goal: z.number().optional().nullable(), + icon: z.string().optional(), + id: z.number().optional(), + name: z.string().optional(), + type: z.string().optional(), + unit: z.string().optional().nullable(), + userId: z.string().optional(), +}); + +export const publicSbMetricsRelationshipsSchemaSchema = z.tuple([]); + +export const publicUserRowSchemaSchema = z.object({ + email: z.string(), + emailVerified: z.number().nullable(), + id: z.string(), + image: z.string().nullable(), + name: z.string(), + password: z.string().nullable(), + role: z.string().nullable(), + timezone: z.string(), +}); + +export const publicUserInsertSchemaSchema = z.object({ + email: z.string(), + emailVerified: z.number().optional().nullable(), + id: z.string(), + image: z.string().optional().nullable(), + name: z.string(), + password: z.string().optional().nullable(), + role: z.string().optional().nullable(), + timezone: z.string().optional(), +}); + +export const publicUserUpdateSchemaSchema = z.object({ + email: z.string().optional(), + emailVerified: z.number().optional().nullable(), + id: z.string().optional(), + image: z.string().optional().nullable(), + name: z.string().optional(), + password: z.string().optional().nullable(), + role: z.string().optional().nullable(), + timezone: z.string().optional(), +}); + +export const publicUserRelationshipsSchemaSchema = z.tuple([]); diff --git a/nazara/apps/web/lib/types.ts b/nazara/apps/web/lib/types.ts new file mode 100644 index 0000000..5a6bd51 --- /dev/null +++ b/nazara/apps/web/lib/types.ts @@ -0,0 +1,624 @@ +export type Json = + | string + | number + | boolean + | null + | { [key: string]: Json | undefined } + | Json[] + +export type Database = { + public: { + Tables: { + apiKey: { + Row: { + createdAt: string + id: string + keyHash: string + keyId: string + name: string + userId: string | null + } + Insert: { + createdAt?: string + id: string + keyHash: string + keyId: string + name: string + userId?: string | null + } + Update: { + createdAt?: string + id?: string + keyHash?: string + keyId?: string + name?: string + userId?: string | null + } + Relationships: [] + } + categories: { + Row: { + code: number + colorId: string + createdAt: string + description: string | null + id: string + name: string + parentId: string | null + userId: string | null + } + Insert: { + code: number + colorId: string + createdAt?: string + description?: string | null + id: string + name: string + parentId?: string | null + userId?: string | null + } + Update: { + code?: number + colorId?: string + createdAt?: string + description?: string | null + id?: string + name?: string + parentId?: string | null + userId?: string | null + } + Relationships: [ + { + foreignKeyName: "category_colorId_color_id_fk" + columns: ["colorId"] + isOneToOne: false + referencedRelation: "colors" + referencedColumns: ["id"] + }, + { + foreignKeyName: "category_parentId_category_id_fk" + columns: ["parentId"] + isOneToOne: false + referencedRelation: "categories" + referencedColumns: ["id"] + }, + ] + } + colors: { + Row: { + createdAt: string + hexcode: string + id: string + inverse: string | null + name: string + userId: string | null + } + Insert: { + createdAt?: string + hexcode: string + id: string + inverse?: string | null + name: string + userId?: string | null + } + Update: { + createdAt?: string + hexcode?: string + id?: string + inverse?: string | null + name?: string + userId?: string | null + } + Relationships: [] + } + days: { + Row: { + comment: string | null + date: string + id: string + mood: number | null + userId: string | null + } + Insert: { + comment?: string | null + date: string + id: string + mood?: number | null + userId?: string | null + } + Update: { + comment?: string | null + date?: string + id?: string + mood?: number | null + userId?: string | null + } + Relationships: [] + } + hours: { + Row: { + categoryId: string | null + comment: string | null + createdAt: string + datetime: string | null + dayId: string + id: string + userId: string | null + } + Insert: { + categoryId?: string | null + comment?: string | null + createdAt?: string + datetime?: string | null + dayId: string + id: string + userId?: string | null + } + Update: { + categoryId?: string | null + comment?: string | null + createdAt?: string + datetime?: string | null + dayId?: string + id?: string + userId?: string | null + } + Relationships: [ + { + foreignKeyName: "hour_categoryId_category_id_fk" + columns: ["categoryId"] + isOneToOne: false + referencedRelation: "categories" + referencedColumns: ["id"] + }, + { + foreignKeyName: "hour_dayId_day_id_fk" + columns: ["dayId"] + isOneToOne: false + referencedRelation: "days" + referencedColumns: ["id"] + }, + ] + } + measurements: { + Row: { + createdAt: string + dayId: string + hourId: string | null + id: string + metricId: string + userId: string | null + value: string + } + Insert: { + createdAt?: string + dayId: string + hourId?: string | null + id: string + metricId: string + userId?: string | null + value: string + } + Update: { + createdAt?: string + dayId?: string + hourId?: string | null + id?: string + metricId?: string + userId?: string | null + value?: string + } + Relationships: [ + { + foreignKeyName: "measurement_dayId_day_id_fk" + columns: ["dayId"] + isOneToOne: false + referencedRelation: "days" + referencedColumns: ["id"] + }, + { + foreignKeyName: "measurement_hourId_hour_id_fk" + columns: ["hourId"] + isOneToOne: false + referencedRelation: "hours" + referencedColumns: ["id"] + }, + { + foreignKeyName: "measurement_metricId_metric_id_fk" + columns: ["metricId"] + isOneToOne: false + referencedRelation: "metrics" + referencedColumns: ["id"] + }, + ] + } + metrics: { + Row: { + createdAt: string + description: string | null + goal: number | null + icon: string + id: string + name: string + type: string + unit: string | null + userId: string | null + } + Insert: { + createdAt?: string + description?: string | null + goal?: number | null + icon: string + id: string + name: string + type: string + unit?: string | null + userId?: string | null + } + Update: { + createdAt?: string + description?: string | null + goal?: number | null + icon?: string + id?: string + name?: string + type?: string + unit?: string | null + userId?: string | null + } + Relationships: [] + } + sb_categories: { + Row: { + code: number + colorId: number + created_at: string + id: number + name: string + userId: string + } + Insert: { + code: number + colorId: number + created_at?: string + id?: number + name: string + userId: string + } + Update: { + code?: number + colorId?: number + created_at?: string + id?: number + name?: string + userId?: string + } + Relationships: [ + { + foreignKeyName: "categories_colorId_fkey" + columns: ["colorId"] + isOneToOne: false + referencedRelation: "sb_colors" + referencedColumns: ["id"] + }, + ] + } + sb_colors: { + Row: { + hexcode: string + id: number + inverse: string + name: string + userId: string + } + Insert: { + hexcode: string + id?: number + inverse: string + name: string + userId: string + } + Update: { + hexcode?: string + id?: number + inverse?: string + name?: string + userId?: string + } + Relationships: [] + } + sb_days: { + Row: { + comment: string | null + date: string + id: number + mood: number | null + userId: string + } + Insert: { + comment?: string | null + date: string + id?: number + mood?: number | null + userId: string + } + Update: { + comment?: string | null + date?: string + id?: number + mood?: number | null + userId?: string + } + Relationships: [] + } + sb_hours: { + Row: { + categoryId: number | null + comment: string | null + datetime: string + dayId: number + id: number + userId: string | null + } + Insert: { + categoryId?: number | null + comment?: string | null + datetime: string + dayId: number + id?: number + userId?: string | null + } + Update: { + categoryId?: number | null + comment?: string | null + datetime?: string + dayId?: number + id?: number + userId?: string | null + } + Relationships: [ + { + foreignKeyName: "hours_dayId_fkey" + columns: ["dayId"] + isOneToOne: false + referencedRelation: "sb_days" + referencedColumns: ["id"] + }, + ] + } + sb_measurements: { + Row: { + created_at: string + dayId: number | null + hourId: number | null + id: number + metricId: number | null + type: string + userId: string | null + value: string + } + Insert: { + created_at?: string + dayId?: number | null + hourId?: number | null + id?: number + metricId?: number | null + type?: string + userId?: string | null + value: string + } + Update: { + created_at?: string + dayId?: number | null + hourId?: number | null + id?: number + metricId?: number | null + type?: string + userId?: string | null + value?: string + } + Relationships: [ + { + foreignKeyName: "measurements_dayId_fkey" + columns: ["dayId"] + isOneToOne: false + referencedRelation: "sb_days" + referencedColumns: ["id"] + }, + { + foreignKeyName: "measurements_hourId_fkey" + columns: ["hourId"] + isOneToOne: false + referencedRelation: "sb_hours" + referencedColumns: ["id"] + }, + { + foreignKeyName: "measurements_metricId_fkey" + columns: ["metricId"] + isOneToOne: false + referencedRelation: "sb_metrics" + referencedColumns: ["id"] + }, + ] + } + sb_metrics: { + Row: { + created_at: string + description: string | null + goal: number | null + icon: string + id: number + name: string + type: string + unit: string | null + userId: string + } + Insert: { + created_at?: string + description?: string | null + goal?: number | null + icon: string + id?: number + name: string + type: string + unit?: string | null + userId: string + } + Update: { + created_at?: string + description?: string | null + goal?: number | null + icon?: string + id?: number + name?: string + type?: string + unit?: string | null + userId?: string + } + Relationships: [] + } + user: { + Row: { + email: string + emailVerified: number | null + id: string + image: string | null + name: string + password: string | null + role: string | null + timezone: string + } + Insert: { + email: string + emailVerified?: number | null + id: string + image?: string | null + name: string + password?: string | null + role?: string | null + timezone?: string + } + Update: { + email?: string + emailVerified?: number | null + id?: string + image?: string | null + name?: string + password?: string | null + role?: string | null + timezone?: string + } + Relationships: [] + } + } + Views: { + [_ in never]: never + } + Functions: { + [_ in never]: never + } + Enums: { + [_ in never]: never + } + CompositeTypes: { + [_ in never]: never + } + } +} + +type PublicSchema = Database[Extract] + +export type Tables< + PublicTableNameOrOptions extends + | keyof (PublicSchema["Tables"] & PublicSchema["Views"]) + | { schema: keyof Database }, + TableName extends PublicTableNameOrOptions extends { schema: keyof Database } + ? keyof (Database[PublicTableNameOrOptions["schema"]]["Tables"] & + Database[PublicTableNameOrOptions["schema"]]["Views"]) + : never = never, +> = PublicTableNameOrOptions extends { schema: keyof Database } + ? (Database[PublicTableNameOrOptions["schema"]]["Tables"] & + Database[PublicTableNameOrOptions["schema"]]["Views"])[TableName] extends { + Row: infer R + } + ? R + : never + : PublicTableNameOrOptions extends keyof (PublicSchema["Tables"] & + PublicSchema["Views"]) + ? (PublicSchema["Tables"] & + PublicSchema["Views"])[PublicTableNameOrOptions] extends { + Row: infer R + } + ? R + : never + : never + +export type TablesInsert< + PublicTableNameOrOptions extends + | keyof PublicSchema["Tables"] + | { schema: keyof Database }, + TableName extends PublicTableNameOrOptions extends { schema: keyof Database } + ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"] + : never = never, +> = PublicTableNameOrOptions extends { schema: keyof Database } + ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends { + Insert: infer I + } + ? I + : never + : PublicTableNameOrOptions extends keyof PublicSchema["Tables"] + ? PublicSchema["Tables"][PublicTableNameOrOptions] extends { + Insert: infer I + } + ? I + : never + : never + +export type TablesUpdate< + PublicTableNameOrOptions extends + | keyof PublicSchema["Tables"] + | { schema: keyof Database }, + TableName extends PublicTableNameOrOptions extends { schema: keyof Database } + ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"] + : never = never, +> = PublicTableNameOrOptions extends { schema: keyof Database } + ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends { + Update: infer U + } + ? U + : never + : PublicTableNameOrOptions extends keyof PublicSchema["Tables"] + ? PublicSchema["Tables"][PublicTableNameOrOptions] extends { + Update: infer U + } + ? U + : never + : never + +export type Enums< + PublicEnumNameOrOptions extends + | keyof PublicSchema["Enums"] + | { schema: keyof Database }, + EnumName extends PublicEnumNameOrOptions extends { schema: keyof Database } + ? keyof Database[PublicEnumNameOrOptions["schema"]]["Enums"] + : never = never, +> = PublicEnumNameOrOptions extends { schema: keyof Database } + ? Database[PublicEnumNameOrOptions["schema"]]["Enums"][EnumName] + : PublicEnumNameOrOptions extends keyof PublicSchema["Enums"] + ? PublicSchema["Enums"][PublicEnumNameOrOptions] + : never + +export type CompositeTypes< + PublicCompositeTypeNameOrOptions extends + | keyof PublicSchema["CompositeTypes"] + | { schema: keyof Database }, + CompositeTypeName extends PublicCompositeTypeNameOrOptions extends { + schema: keyof Database + } + ? keyof Database[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"] + : never = never, +> = PublicCompositeTypeNameOrOptions extends { schema: keyof Database } + ? Database[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"][CompositeTypeName] + : PublicCompositeTypeNameOrOptions extends keyof PublicSchema["CompositeTypes"] + ? PublicSchema["CompositeTypes"][PublicCompositeTypeNameOrOptions] + : never diff --git a/nazara/apps/web/package.json b/nazara/apps/web/package.json index c16d9ab..93cc20c 100644 --- a/nazara/apps/web/package.json +++ b/nazara/apps/web/package.json @@ -22,13 +22,15 @@ "prettier": "^3.3.3", "react": "19.0.0", "react-dom": "19.0.0", - "spacetime": "^7.7.0" + "spacetime": "^7.7.0", + "supabase": "^2.9.6" }, "devDependencies": { "@types/node": "22.10.2", "@types/react": "^19.0.2", "@types/react-dom": "19.0.2", "postcss": "8.4.49", + "supazod": "^1.1.2", "tailwind-merge": "^2.5.2", "tailwindcss": "3.4.17", "tailwindcss-animate": "^1.0.7", diff --git a/nazara/apps/web/supabase/.gitignore b/nazara/apps/web/supabase/.gitignore new file mode 100644 index 0000000..ad9264f --- /dev/null +++ b/nazara/apps/web/supabase/.gitignore @@ -0,0 +1,8 @@ +# Supabase +.branches +.temp + +# dotenvx +.env.keys +.env.local +.env.*.local diff --git a/nazara/apps/web/supabase/config.toml b/nazara/apps/web/supabase/config.toml new file mode 100644 index 0000000..c7963ab --- /dev/null +++ b/nazara/apps/web/supabase/config.toml @@ -0,0 +1,281 @@ +# For detailed configuration reference documentation, visit: +# https://supabase.com/docs/guides/local-development/cli/config +# A string used to distinguish different Supabase projects on the same host. Defaults to the +# working directory name when running `supabase init`. +project_id = "web" + +[api] +enabled = true +# Port to use for the API URL. +port = 54321 +# Schemas to expose in your API. Tables, views and stored procedures in this schema will get API +# endpoints. `public` and `graphql_public` schemas are included by default. +schemas = ["public", "graphql_public"] +# Extra schemas to add to the search_path of every request. +extra_search_path = ["public", "extensions"] +# The maximum number of rows returns from a view, table, or stored procedure. Limits payload size +# for accidental or malicious requests. +max_rows = 1000 + +[api.tls] +# Enable HTTPS endpoints locally using a self-signed certificate. +enabled = false + +[db] +# Port to use for the local database URL. +port = 54322 +# Port used by db diff command to initialize the shadow database. +shadow_port = 54320 +# The database major version to use. This has to be the same as your remote database's. Run `SHOW +# server_version;` on the remote database to check. +major_version = 15 + +[db.pooler] +enabled = false +# Port to use for the local connection pooler. +port = 54329 +# Specifies when a server connection can be reused by other clients. +# Configure one of the supported pooler modes: `transaction`, `session`. +pool_mode = "transaction" +# How many server connections to allow per user/database pair. +default_pool_size = 20 +# Maximum number of client connections allowed. +max_client_conn = 100 + +[db.seed] +# If enabled, seeds the database after migrations during a db reset. +enabled = true +# Specifies an ordered list of seed files to load during db reset. +# Supports glob patterns relative to supabase directory: "./seeds/*.sql" +sql_paths = ["./seed.sql"] + +[realtime] +enabled = true +# Bind realtime via either IPv4 or IPv6. (default: IPv4) +# ip_version = "IPv6" +# The maximum length in bytes of HTTP request headers. (default: 4096) +# max_header_length = 4096 + +[studio] +enabled = true +# Port to use for Supabase Studio. +port = 54323 +# External URL of the API server that frontend connects to. +api_url = "http://127.0.0.1" +# OpenAI API Key to use for Supabase AI in the Supabase Studio. +openai_api_key = "env(OPENAI_API_KEY)" + +# Email testing server. Emails sent with the local dev setup are not actually sent - rather, they +# are monitored, and you can view the emails that would have been sent from the web interface. +[inbucket] +enabled = true +# Port to use for the email testing server web interface. +port = 54324 +# Uncomment to expose additional ports for testing user applications that send emails. +# smtp_port = 54325 +# pop3_port = 54326 +# admin_email = "admin@email.com" +# sender_name = "Admin" + +[storage] +enabled = true +# The maximum file size allowed (e.g. "5MB", "500KB"). +file_size_limit = "50MiB" + +# Image transformation API is available to Supabase Pro plan. +# [storage.image_transformation] +# enabled = true + +# Uncomment to configure local storage buckets +# [storage.buckets.images] +# public = false +# file_size_limit = "50MiB" +# allowed_mime_types = ["image/png", "image/jpeg"] +# objects_path = "./images" + +[auth] +enabled = true +# The base URL of your website. Used as an allow-list for redirects and for constructing URLs used +# in emails. +site_url = "http://127.0.0.1:3000" +# A list of *exact* URLs that auth providers are permitted to redirect to post authentication. +additional_redirect_urls = ["https://127.0.0.1:3000"] +# How long tokens are valid for, in seconds. Defaults to 3600 (1 hour), maximum 604,800 (1 week). +jwt_expiry = 3600 +# If disabled, the refresh token will never expire. +enable_refresh_token_rotation = true +# Allows refresh tokens to be reused after expiry, up to the specified interval in seconds. +# Requires enable_refresh_token_rotation = true. +refresh_token_reuse_interval = 10 +# Allow/disallow new user signups to your project. +enable_signup = true +# Allow/disallow anonymous sign-ins to your project. +enable_anonymous_sign_ins = false +# Allow/disallow testing manual linking of accounts +enable_manual_linking = false +# Passwords shorter than this value will be rejected as weak. Minimum 6, recommended 8 or more. +minimum_password_length = 6 +# Passwords that do not meet the following requirements will be rejected as weak. Supported values +# are: `letters_digits`, `lower_upper_letters_digits`, `lower_upper_letters_digits_symbols` +password_requirements = "" + +[auth.email] +# Allow/disallow new user signups via email to your project. +enable_signup = true +# If enabled, a user will be required to confirm any email change on both the old, and new email +# addresses. If disabled, only the new email is required to confirm. +double_confirm_changes = true +# If enabled, users need to confirm their email address before signing in. +enable_confirmations = false +# If enabled, users will need to reauthenticate or have logged in recently to change their password. +secure_password_change = false +# Controls the minimum amount of time that must pass before sending another signup confirmation or password reset email. +max_frequency = "1s" +# Number of characters used in the email OTP. +otp_length = 6 +# Number of seconds before the email OTP expires (defaults to 1 hour). +otp_expiry = 3600 + +# Use a production-ready SMTP server +# [auth.email.smtp] +# enabled = true +# host = "smtp.sendgrid.net" +# port = 587 +# user = "apikey" +# pass = "env(SENDGRID_API_KEY)" +# admin_email = "admin@email.com" +# sender_name = "Admin" + +# Uncomment to customize email template +# [auth.email.template.invite] +# subject = "You have been invited" +# content_path = "./supabase/templates/invite.html" + +[auth.sms] +# Allow/disallow new user signups via SMS to your project. +enable_signup = false +# If enabled, users need to confirm their phone number before signing in. +enable_confirmations = false +# Template for sending OTP to users +template = "Your code is {{ .Code }}" +# Controls the minimum amount of time that must pass before sending another sms otp. +max_frequency = "5s" + +# Use pre-defined map of phone number to OTP for testing. +# [auth.sms.test_otp] +# 4152127777 = "123456" + +# Configure logged in session timeouts. +# [auth.sessions] +# Force log out after the specified duration. +# timebox = "24h" +# Force log out if the user has been inactive longer than the specified duration. +# inactivity_timeout = "8h" + +# This hook runs before a token is issued and allows you to add additional claims based on the authentication method used. +# [auth.hook.custom_access_token] +# enabled = true +# uri = "pg-functions:////" + +# Configure one of the supported SMS providers: `twilio`, `twilio_verify`, `messagebird`, `textlocal`, `vonage`. +[auth.sms.twilio] +enabled = false +account_sid = "" +message_service_sid = "" +# DO NOT commit your Twilio auth token to git. Use environment variable substitution instead: +auth_token = "env(SUPABASE_AUTH_SMS_TWILIO_AUTH_TOKEN)" + +# Multi-factor-authentication is available to Supabase Pro plan. +[auth.mfa] +# Control how many MFA factors can be enrolled at once per user. +max_enrolled_factors = 10 + +# Control MFA via App Authenticator (TOTP) +[auth.mfa.totp] +enroll_enabled = false +verify_enabled = false + +# Configure MFA via Phone Messaging +[auth.mfa.phone] +enroll_enabled = false +verify_enabled = false +otp_length = 6 +template = "Your code is {{ .Code }}" +max_frequency = "5s" + +# Configure MFA via WebAuthn +# [auth.mfa.web_authn] +# enroll_enabled = true +# verify_enabled = true + +# Use an external OAuth provider. The full list of providers are: `apple`, `azure`, `bitbucket`, +# `discord`, `facebook`, `github`, `gitlab`, `google`, `keycloak`, `linkedin_oidc`, `notion`, `twitch`, +# `twitter`, `slack`, `spotify`, `workos`, `zoom`. +[auth.external.apple] +enabled = false +client_id = "" +# DO NOT commit your OAuth provider secret to git. Use environment variable substitution instead: +secret = "env(SUPABASE_AUTH_EXTERNAL_APPLE_SECRET)" +# Overrides the default auth redirectUrl. +redirect_uri = "" +# Overrides the default auth provider URL. Used to support self-hosted gitlab, single-tenant Azure, +# or any other third-party OIDC providers. +url = "" +# If enabled, the nonce check will be skipped. Required for local sign in with Google auth. +skip_nonce_check = false + +# Use Firebase Auth as a third-party provider alongside Supabase Auth. +[auth.third_party.firebase] +enabled = false +# project_id = "my-firebase-project" + +# Use Auth0 as a third-party provider alongside Supabase Auth. +[auth.third_party.auth0] +enabled = false +# tenant = "my-auth0-tenant" +# tenant_region = "us" + +# Use AWS Cognito (Amplify) as a third-party provider alongside Supabase Auth. +[auth.third_party.aws_cognito] +enabled = false +# user_pool_id = "my-user-pool-id" +# user_pool_region = "us-east-1" + +[edge_runtime] +enabled = true +# Configure one of the supported request policies: `oneshot`, `per_worker`. +# Use `oneshot` for hot reload, or `per_worker` for load testing. +policy = "oneshot" +# Port to attach the Chrome inspector for debugging edge functions. +inspector_port = 8083 + +# Use these configurations to customize your Edge Function. +# [functions.MY_FUNCTION_NAME] +# enabled = true +# verify_jwt = true +# import_map = "./functions/MY_FUNCTION_NAME/deno.json" +# Uncomment to specify a custom file path to the entrypoint. +# Supported file extensions are: .ts, .js, .mjs, .jsx, .tsx +# entrypoint = "./functions/MY_FUNCTION_NAME/index.ts" +# Specifies static files to be bundled with the function. Supports glob patterns. +# For example, if you want to serve static HTML pages in your function: +# static_files = [ "./functions/MY_FUNCTION_NAME/*.html" ] + +[analytics] +enabled = true +port = 54327 +# Configure one of the supported backends: `postgres`, `bigquery`. +backend = "postgres" + +# Experimental features may be deprecated any time +[experimental] +# Configures Postgres storage engine to use OrioleDB (S3) +orioledb_version = "" +# Configures S3 bucket URL, eg. .s3-.amazonaws.com +s3_host = "env(S3_HOST)" +# Configures S3 bucket region, eg. us-east-1 +s3_region = "env(S3_REGION)" +# Configures AWS_ACCESS_KEY_ID for S3 bucket +s3_access_key = "env(S3_ACCESS_KEY)" +# Configures AWS_SECRET_ACCESS_KEY for S3 bucket +s3_secret_key = "env(S3_SECRET_KEY)" diff --git a/nazara/deleteme/.gitignore b/nazara/deleteme/.gitignore new file mode 100644 index 0000000..f664cb1 --- /dev/null +++ b/nazara/deleteme/.gitignore @@ -0,0 +1,37 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +node_modules +.pnp +.pnp.js + +# testing +coverage + +# next.js +.next/ +.swc/ +out/ +build + +# expo +.expo + +# misc +.DS_Store +*.pem +dist + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# local env files +.env.local +.env.development.local +.env.test.local +.env.production.local + +# turbo +.turbo diff --git a/nazara/deleteme/README.md b/nazara/deleteme/README.md new file mode 100644 index 0000000..b9dcd63 --- /dev/null +++ b/nazara/deleteme/README.md @@ -0,0 +1,32 @@ +# Turborepo react-native starter + +This is a community-maintained example. If you experience a problem, please submit a pull request with a fix. GitHub Issues will be closed. + +## Using this example + +Run the following command: + +```sh +npx create-turbo@latest -e with-react-native-web +``` + +## What's inside? + +This Turborepo includes the following packages/apps: + +### Apps and Packages + +- `native`: a [react-native](https://reactnative.dev/) app built with [expo](https://docs.expo.dev/) +- `web`: a [Next.js](https://nextjs.org/) app built with [react-native-web](https://necolas.github.io/react-native-web/) +- `@repo/ui`: a stub [react-native](https://reactnative.dev/) component library shared by both `web` and `native` applications +- `@repo/typescript-config`: `tsconfig.json`s used throughout the monorepo + +Each package/app is 100% [TypeScript](https://www.typescriptlang.org/). + +### Utilities + +This Turborepo has some additional tools already setup for you: + +- [Expo](https://docs.expo.dev/) for native development +- [TypeScript](https://www.typescriptlang.org/) for static type checking +- [Prettier](https://prettier.io) for code formatting diff --git a/nazara/deleteme/apps/native/.expo-shared/assets.json b/nazara/deleteme/apps/native/.expo-shared/assets.json new file mode 100644 index 0000000..1e6decf --- /dev/null +++ b/nazara/deleteme/apps/native/.expo-shared/assets.json @@ -0,0 +1,4 @@ +{ + "12bb71342c6255bbf50437ec8f4441c083f47cdb74bd89160c15e4f43e52a1cb": true, + "40b842e832070c58deac6aa9e08fa459302ee3f9da492c7e77d93d2fbf4a56fd": true +} diff --git a/nazara/deleteme/apps/native/.gitignore b/nazara/deleteme/apps/native/.gitignore new file mode 100644 index 0000000..ec8a36a --- /dev/null +++ b/nazara/deleteme/apps/native/.gitignore @@ -0,0 +1,14 @@ +node_modules/ +.expo/ +dist/ +npm-debug.* +*.jks +*.p8 +*.p12 +*.key +*.mobileprovision +*.orig.* +web-build/ + +# macOS +.DS_Store diff --git a/nazara/deleteme/apps/native/README.md b/nazara/deleteme/apps/native/README.md new file mode 100644 index 0000000..be1fea0 --- /dev/null +++ b/nazara/deleteme/apps/native/README.md @@ -0,0 +1,3 @@ +# Native + +A [react-native](https://reactnative.dev/) app built using [expo](https://docs.expo.dev/) diff --git a/nazara/deleteme/apps/native/app.json b/nazara/deleteme/apps/native/app.json new file mode 100644 index 0000000..14ea67a --- /dev/null +++ b/nazara/deleteme/apps/native/app.json @@ -0,0 +1,39 @@ +{ + "expo": { + "name": "native", + "slug": "native", + "version": "1.0.0", + "scheme": "com.turbo.example", + "orientation": "portrait", + "icon": "./assets/icon.png", + "userInterfaceStyle": "light", + "splash": { + "image": "./assets/splash.png", + "resizeMode": "contain", + "backgroundColor": "#ffffff" + }, + "updates": { + "fallbackToCacheTimeout": 0 + }, + "assetBundlePatterns": [ + "**/*" + ], + "ios": { + "supportsTablet": true + }, + "android": { + "adaptiveIcon": { + "foregroundImage": "./assets/adaptive-icon.png", + "backgroundColor": "#FFFFFF" + }, + "package": "com.turbo.example" + }, + "web": { + "favicon": "./assets/favicon.png", + "bundler": "metro" + }, + "plugins": [ + "expo-router" + ] + } +} diff --git a/nazara/deleteme/apps/native/app/_layout.tsx b/nazara/deleteme/apps/native/app/_layout.tsx new file mode 100644 index 0000000..1d5aa05 --- /dev/null +++ b/nazara/deleteme/apps/native/app/_layout.tsx @@ -0,0 +1,7 @@ +import { Stack } from "expo-router" + +const AppLayout = () => { + return +} + +export default AppLayout diff --git a/nazara/deleteme/apps/native/app/index.tsx b/nazara/deleteme/apps/native/app/index.tsx new file mode 100644 index 0000000..8b4cd59 --- /dev/null +++ b/nazara/deleteme/apps/native/app/index.tsx @@ -0,0 +1,33 @@ +import { StyleSheet, Text, View } from "react-native"; +import { StatusBar } from "expo-status-bar"; +import { Button } from "@repo/ui"; + +export default function Native() { + return ( + + Native +