Compare commits

..

4 Commits

Author SHA1 Message Date
89eadbd477 Fuck 2025-02-08 22:40:36 -08:00
Turbobot
09b3508a72 feat(create-turbo): apply pnpm-eslint transform 2025-02-08 17:04:20 -08:00
Turbobot
c2646d922a feat(create-turbo): apply package-manager transform 2025-02-08 17:04:20 -08:00
Turbobot
9be2282943 feat(create-turbo): apply official-starter transform 2025-02-08 17:04:20 -08:00
39 changed files with 11821 additions and 2239 deletions

View File

@ -1,19 +0,0 @@
#!/usr/bin/env bash
set -e
if [[ ! -d "/home/ryan/Documents/Code/nazara" ]]; then
echo "Cannot find source directory; Did you move it?"
echo "(Looking for "/home/ryan/Documents/Code/nazara")"
echo 'Cannot force reload with this script - use "direnv reload" manually and then try again'
exit 1
fi
# rebuild the cache forcefully
_nix_direnv_force_reload=1 direnv exec "/home/ryan/Documents/Code/nazara" true
# Update the mtime for .envrc.
# This will cause direnv to reload again - but without re-building.
touch "/home/ryan/Documents/Code/nazara/.envrc"
# Also update the timestamp of whatever profile_rc we have.
# This makes sure that we know we are up to date.
touch -r "/home/ryan/Documents/Code/nazara/.envrc" "/home/ryan/Documents/Code/nazara/.direnv"/*.rc

View File

@ -1 +0,0 @@
/nix/store/01x5k4nlxcpyd85nnr0b9gm89rm8ff4x-source

View File

@ -1 +0,0 @@
/nix/store/m4wcdchjxw2fdyzjp8i6irpc613pchkr-source

View File

@ -1 +0,0 @@
/nix/store/v693fy6xqbw70nfw0gyv66blwpax2l67-source

View File

@ -1 +0,0 @@
/nix/store/yj1wxm9hh8610iyzqnz75kvs6xl8j3my-source

View File

@ -1 +0,0 @@
/nix/store/lr0337b15w70fzrxg79xi6zf3bgcm399-nix-shell-env

4
.envrc
View File

@ -1 +1,3 @@
use flake
source_url "https://raw.githubusercontent.com/cachix/devenv/82c0147677e510b247d8b9165c54f73d32dfd899/direnvrc" "sha256-7u4iDd1nZpxL4tCzmPG0dQgC5V+/44Ba+tHkPob1v2k="
use devenv

9
.gitignore vendored Normal file
View File

@ -0,0 +1,9 @@
# Devenv
.devenv*
devenv.local.nix
# direnv
.direnv
# pre-commit
.pre-commit-config.yaml

100
devenv.lock Normal file
View File

@ -0,0 +1,100 @@
{
"nodes": {
"devenv": {
"locked": {
"dir": "src/modules",
"lastModified": 1739003866,
"owner": "cachix",
"repo": "devenv",
"rev": "ebaa7440666d6aadea574b723c9188cf6f56447f",
"type": "github"
},
"original": {
"dir": "src/modules",
"owner": "cachix",
"repo": "devenv",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1733328505,
"owner": "edolstra",
"repo": "flake-compat",
"rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"pre-commit-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1739019272,
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "fa35a3c8e17a3de613240fea68f876e5b4896aec",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"pre-commit-hooks": {
"inputs": {
"flake-compat": "flake-compat",
"gitignore": "gitignore",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1737465171,
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "9364dc02281ce2d37a1f55b6e51f7c0f65a75f17",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"type": "github"
}
},
"root": {
"inputs": {
"devenv": "devenv",
"nixpkgs": "nixpkgs",
"pre-commit-hooks": "pre-commit-hooks"
}
}
},
"root": "root",
"version": 7
}

9
devenv.nix Normal file
View File

@ -0,0 +1,9 @@
{ pkgs, ... }:
{
packages = with pkgs; [
nodejs
pnpm
postgresql
];
}

4
devenv.yaml Normal file
View File

@ -0,0 +1,4 @@
allowUnfree: true
inputs:
nixpkgs:
url: github:NixOS/nixpkgs/nixpkgs-unstable

3
local.properties Normal file
View File

@ -0,0 +1,3 @@
# This file was automatically generated by nix-shell.
sdk.dir=/nix/store/3bhlykx0dp1rbd5z04sk40f3lapwalp4-androidsdk/libexec/android-sdk
ndk.dir=/nix/store/3bhlykx0dp1rbd5z04sk40f3lapwalp4-androidsdk/libexec/android-sdk/ndk/

View File

@ -18,9 +18,9 @@ This Turborepo includes the following packages/apps:
- `docs`: a [Next.js](https://nextjs.org/) app
- `web`: another [Next.js](https://nextjs.org/) app
- `@repo/ui`: a stub React component library shared by both `web` and `docs` applications
- `@repo/eslint-config`: `eslint` configurations (includes `eslint-config-next` and `eslint-config-prettier`)
- `@repo/typescript-config`: `tsconfig.json`s used throughout the monorepo
- `@nazara/ui`: a stub React component library shared by both `web` and `docs` applications
- `@nazara/eslint-config`: `eslint` configurations (includes `eslint-config-next` and `eslint-config-prettier`)
- `@nazara/typescript-config`: `tsconfig.json`s used throughout the monorepo
Each package/app is 100% [TypeScript](https://www.typescriptlang.org/).

View File

@ -1,5 +1,5 @@
import Image, { type ImageProps } from "next/image";
import { Button } from "@repo/ui/button";
import { Button } from "@nazara/ui/button";
import styles from "./page.module.css";
type Props = Omit<ImageProps, "src"> & {

View File

@ -1,4 +1,4 @@
import { nextJsConfig } from "@repo/eslint-config/next-js";
import { nextJsConfig } from "@nazara/eslint-config/next-js";
/** @type {import("eslint").Linter.Config} */
export default nextJsConfig;

View File

@ -1,5 +1,5 @@
{
"name": "docs",
"name": "@nazara/docs",
"version": "0.1.0",
"type": "module",
"private": true,
@ -11,18 +11,18 @@
"check-types": "tsc --noEmit"
},
"dependencies": {
"@repo/ui": "workspace:*",
"@nazara/ui": "workspace:*",
"next": "^15.1.6",
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
"devDependencies": {
"@repo/eslint-config": "workspace:*",
"@repo/typescript-config": "workspace:*",
"@nazara/eslint-config": "workspace:*",
"@nazara/typescript-config": "workspace:*",
"@types/node": "^22",
"@types/react": "19.0.8",
"@types/react-dom": "19.0.3",
"eslint": "^9.19.0",
"typescript": "5.7.3"
}
}
}

View File

@ -1,5 +1,5 @@
{
"extends": "@repo/typescript-config/nextjs.json",
"extends": "@nazara/typescript-config/nextjs.json",
"compilerOptions": {
"plugins": [
{
@ -17,4 +17,4 @@
"exclude": [
"node_modules"
]
}
}

View File

@ -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 ? <div>Loading...</div> : (
<>
<h1>{spacetime(day.date).format('{month} {date-ordinal}, {year}')}</h1>
<ul>
<li>{day.mood}</li>
<li>{day.comment}</li>
</ul>
</>
<RealtimeDayPage initialDay={day} />
);
}

View File

@ -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 (
<>
<h1>{spacetime(day.date).format('{month} {date-ordinal}, {year}')}</h1>
<ul>
<li>MOOD: {day.mood ?? "No mood set."}</li>
<li>COMMENT: {day.comment ?? "No comment yet."}</li>
</ul>
<ul>
{day.hours.map((hour) => (
<li key={hour.id}
className="p-2"
style={{
"backgroundColor": hour.category?.color?.hexcode,
"color": hour.category?.color?.inverse
}}>[{spacetime(hour.datetime).format('{time}')}] {hour.comment}</li>
))}
</ul>
</>
)
}

View File

@ -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({

177
nazara/apps/web/lib/schemas.d.ts vendored Normal file
View File

@ -0,0 +1,177 @@
/*
* ==========================================
* | GENERATED BY SUPAZOD |
* ==========================================
*/
import { z } from "zod";
import * as generated from "./schemas";
export type Json = z.infer<typeof generated.jsonSchema>;
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
>;

View File

@ -0,0 +1,549 @@
/*
* ==========================================
* | GENERATED BY SUPAZOD |
* ==========================================
*/
import { z } from "zod";
import { Json } from "./types";
export const jsonSchema: z.ZodSchema<Json> = 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([]);

View File

@ -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<keyof Database, "public">]
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

View File

@ -7,6 +7,7 @@
"start": "next start"
},
"dependencies": {
"@nazara/ui": "workspace:^",
"@radix-ui/react-checkbox": "^1.1.1",
"@radix-ui/react-dropdown-menu": "^2.1.1",
"@radix-ui/react-label": "^2.1.0",
@ -22,13 +23,17 @@
"prettier": "^3.3.3",
"react": "19.0.0",
"react-dom": "19.0.0",
"spacetime": "^7.7.0"
"react-native-web": "^0.19.13",
"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",
"babel-plugin-react-native-web": "^0.19.13",
"postcss": "8.4.49",
"supazod": "^1.1.2",
"tailwind-merge": "^2.5.2",
"tailwindcss": "3.4.17",
"tailwindcss-animate": "^1.0.7",

8
nazara/apps/web/supabase/.gitignore vendored Normal file
View File

@ -0,0 +1,8 @@
# Supabase
.branches
.temp
# dotenvx
.env.keys
.env.local
.env.*.local

View File

@ -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://<database>/<schema>/<hook_name>"
# 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. <bucket_name>.s3-<region>.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)"

View File

@ -1,5 +1,5 @@
{
"name": "@repo/eslint-config",
"name": "@nazara/eslint-config",
"version": "0.0.0",
"type": "module",
"private": true,
@ -21,4 +21,4 @@
"typescript": "^5.7.3",
"typescript-eslint": "^8.23.0"
}
}
}

View File

@ -1,9 +1,9 @@
{
"name": "@repo/typescript-config",
"name": "@nazara/typescript-config",
"version": "0.0.0",
"private": true,
"license": "MIT",
"publishConfig": {
"access": "public"
}
}
}

28
nazara/packages/ui/.gitignore vendored Normal file
View File

@ -0,0 +1,28 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
node_modules
.pnp
.pnp.js
# misc
.DS_Store
*.pem
# build
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

View File

@ -1,4 +1,4 @@
import { config } from "@repo/eslint-config/react-internal";
import { config } from "@nazara/eslint-config/react-internal";
/** @type {import("eslint").Linter.Config} */
export default config;

View File

@ -1,8 +1,9 @@
{
"name": "@repo/ui",
"name": "@nazara/ui",
"version": "0.0.0",
"private": true,
"exports": {
".": "./src/index.ts",
"./button": "./src/button.tsx",
"./card": "./src/card.tsx",
"./code": "./src/code.tsx"
@ -13,8 +14,8 @@
"check-types": "tsc --noEmit"
},
"devDependencies": {
"@repo/eslint-config": "workspace:*",
"@repo/typescript-config": "workspace:*",
"@nazara/eslint-config": "workspace:*",
"@nazara/typescript-config": "workspace:*",
"@turbo/gen": "^2.4.0",
"@types/node": "^22.13.0",
"@types/react": "19.0.8",
@ -26,4 +27,4 @@
"react": "^19.0.0",
"react-dom": "^19.0.0"
}
}
}

View File

@ -1,20 +1,37 @@
"use client";
import * as React from "react";
import {
StyleSheet,
GestureResponderEvent,
Text,
Pressable,
} from "react-native";
import { ReactNode } from "react";
interface ButtonProps {
children: ReactNode;
className?: string;
appName: string;
export interface ButtonProps {
text: string;
onClick?: (event: GestureResponderEvent) => void;
}
export const Button = ({ children, className, appName }: ButtonProps) => {
export function Button({ text, onClick }: ButtonProps) {
return (
<button
className={className}
onClick={() => alert(`Hello from your ${appName} app!`)}
>
{children}
</button>
<Pressable style={styles.button} onPress={onClick}>
<Text style={styles.text}>{text}</Text>
</Pressable>
);
};
}
const styles = StyleSheet.create({
button: {
maxWidth: 200,
textAlign: "center",
borderRadius: 10,
paddingTop: 14,
paddingBottom: 14,
paddingLeft: 30,
paddingRight: 30,
fontSize: 15,
backgroundColor: "#2f80ed",
},
text: {
color: "white",
},
});

View File

@ -0,0 +1 @@
export { Button, type ButtonProps } from "./button";

View File

@ -1,8 +1,13 @@
{
"extends": "@repo/typescript-config/react-library.json",
"extends": "@nazara/typescript-config/react-library.json",
"compilerOptions": {
"outDir": "dist"
},
"include": ["src"],
"exclude": ["node_modules", "dist"]
}
"include": [
"src"
],
"exclude": [
"node_modules",
"dist"
]
}

View File

@ -0,0 +1,15 @@
import { defineConfig, Options } from "tsup";
export default defineConfig((options: Options) => ({
entry: {
index: "src/index.tsx",
},
banner: {
js: "'use client'",
},
clean: true,
format: ["cjs", "esm"],
external: ["react"],
dts: true,
...options,
}));

View File

@ -1,30 +0,0 @@
import type { PlopTypes } from "@turbo/gen";
// Learn more about Turborepo Generators at https://turbo.build/repo/docs/core-concepts/monorepos/code-generation
export default function generator(plop: PlopTypes.NodePlopAPI): void {
// A simple generator to add a new React component to the internal UI library
plop.setGenerator("react-component", {
description: "Adds a new react component",
prompts: [
{
type: "input",
name: "name",
message: "What is the name of the component?",
},
],
actions: [
{
type: "add",
path: "src/{{kebabCase name}}.tsx",
templateFile: "templates/component.hbs",
},
{
type: "append",
path: "package.json",
pattern: /"exports": {(?<insertion>)/g,
template: ' "./{{kebabCase name}}": "./src/{{kebabCase name}}.tsx",',
},
],
});
}

View File

@ -1,8 +0,0 @@
export const {{ pascalCase name }} = ({ children }: { children: React.ReactNode }) => {
return (
<div>
<h1>{{ pascalCase name }} Component</h1>
{children}
</div>
);
};

9887
nazara/pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff