Skip to content

Commit

Permalink
feat: create docker image & logo component
Browse files Browse the repository at this point in the history
Signed-off-by: Arthur Broudoux <[email protected]>
  • Loading branch information
abroudoux committed Oct 13, 2024
1 parent 0e83c88 commit 0fc0432
Show file tree
Hide file tree
Showing 12 changed files with 492 additions and 35 deletions.
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ RUN pnpm install --frozen-lockfile

COPY . .

RUN pnpm build
ENV DATABASE_URL="postgresql://postgres:mysecretpassword@localhost:5432/postgres"

EXPOSE 3000
RUN pnpm run build

CMD ["node", "build"]
EXPOSE 5173

CMD ["pnpm", "run", "dev"]
1 change: 0 additions & 1 deletion src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<meta charset="utf-8" />
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" href="/favicon.png" />
<title>Better</title>
%sveltekit.head%
</head>
Expand Down
3 changes: 2 additions & 1 deletion src/components/global/Header.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<script lang="ts">
import ModeToggle from "$components/global/ModeToggle.svelte";
import Logo from "$components/global/Logo.svelte";
</script>

<header class="header bg-background p-4 px-6 flex flex-row items-center justify-between border-b">
<a href="/" class="font-bold">better.</a>
<Logo />
<ModeToggle />
</header>
10 changes: 10 additions & 0 deletions src/components/global/Logo.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<script lang="ts">
import { Sprout } from "lucide-svelte";
</script>

<a href="/" class="font-bold text-foreground text-2xl inline-flex items-center gap-1">
better
<span class="text-green-500">
<Sprout class="w-6 h-6" />
</span>
</a>
30 changes: 30 additions & 0 deletions src/lib/db/server/drizzle/0002_little_magus.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
CREATE TABLE IF NOT EXISTS "circuits" (
"id" text PRIMARY KEY DEFAULT 'uuid_generate_v4()' NOT NULL,
"name" text NOT NULL,
"reps" integer DEFAULT 0,
"rest_exercice" integer DEFAULT 0,
"rest_circuit" integer DEFAULT 0
);
--> statement-breakpoint
CREATE TABLE IF NOT EXISTS "exercises" (
"id" text PRIMARY KEY DEFAULT 'uuid_generate_v4()' NOT NULL,
"name" text NOT NULL,
"reps" integer DEFAULT 0 NOT NULL,
"sets" integer DEFAULT 0,
"rest" integer DEFAULT 0
);
--> statement-breakpoint
CREATE TABLE IF NOT EXISTS "trainings" (
"id" text PRIMARY KEY DEFAULT 'uuid_generate_v4()' NOT NULL,
"user_id" text,
"name" text NOT NULL,
"is_archived" boolean DEFAULT false,
"duration" integer DEFAULT 0,
"link" text
);
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "trainings" ADD CONSTRAINT "trainings_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
Loading

0 comments on commit 0fc0432

Please sign in to comment.