diff --git a/.dockerignore b/.dockerignore index 9b76597..3c12b92 100644 --- a/.dockerignore +++ b/.dockerignore @@ -13,6 +13,5 @@ README.md .vscode .idea node_modules -build package **/.env \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 6c03d4a..09a84b9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:22-alpine +FROM node:22-alpine as builder RUN npm install -g pnpm @@ -10,6 +10,21 @@ RUN pnpm install --frozen-lockfile COPY . . +ARG DATABASE_URL +ENV DATABASE_URL=$DATABASE_URL + +RUN pnpm run build + +FROM node:22-alpine + +WORKDIR /app + +COPY --from=builder /app/build ./build + +COPY package.json pnpm-lock.yaml ./ + +RUN npm install --only=production --legacy-peer-deps + EXPOSE 5173 -CMD ["sh", "-c", "pnpm run generate && pnpm run migrate && pnpm run dev"] +CMD ["node", "build/index.js"] \ No newline at end of file diff --git a/components.json b/components.json index 9e538f6..bfc2bf7 100644 --- a/components.json +++ b/components.json @@ -11,4 +11,4 @@ "utils": "$lib/utils" }, "typescript": true -} \ No newline at end of file +} diff --git a/docker-compose.build.yaml b/docker-compose.build.yaml index 134919d..0e94021 100644 --- a/docker-compose.build.yaml +++ b/docker-compose.build.yaml @@ -5,6 +5,8 @@ services: build: context: . dockerfile: Dockerfile + args: + DATABASE_URL: "postgresql://postgres:mysecretpassword@db:5432/better-db" ports: - "5173:5173" depends_on: @@ -12,7 +14,7 @@ services: environment: DATABASE_URL: "postgresql://postgres:mysecretpassword@db:5432/better-db" command: > - sh -c "pnpm install && pnpm run generate && pnpm run migrate && pnpm run dev" + sh -c "npm install && npm run generate && npm run migrate && node build/index.js" db: container_name: better-db diff --git a/package.json b/package.json index 54033b9..d550e89 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,8 @@ "eslint-config-prettier": "^9.1.0", "eslint-plugin-svelte": "^2.44.0", "globals": "^15.9.0", + "lucide-svelte": "^0.441.0", + "paneforge": "^0.0.6", "pg": "^8.13.0", "postcss": "^8.4.47", "prettier": "^3.3.3", @@ -58,7 +60,6 @@ "drizzle-orm": "^0.33.0", "embla-carousel-svelte": "^8.3.0", "lucia": "^3.2.0", - "lucide-svelte": "^0.441.0", "mode-watcher": "^0.4.1", "postgres": "^3.4.4", "svelte-sonner": "^0.3.28", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0a3b0c5..ace5e33 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -23,9 +23,6 @@ dependencies: lucia: specifier: ^3.2.0 version: 3.2.0 - lucide-svelte: - specifier: ^0.441.0 - version: 0.441.0(svelte@5.0.0-next.259) mode-watcher: specifier: ^0.4.1 version: 0.4.1(svelte@5.0.0-next.259) @@ -91,6 +88,12 @@ devDependencies: globals: specifier: ^15.9.0 version: 15.9.0 + lucide-svelte: + specifier: ^0.441.0 + version: 0.441.0(svelte@5.0.0-next.259) + paneforge: + specifier: ^0.0.6 + version: 0.0.6(svelte@5.0.0-next.259) pg: specifier: ^8.13.0 version: 8.13.0 @@ -3107,7 +3110,7 @@ packages: svelte: ^3 || ^4 || ^5.0.0-next.42 dependencies: svelte: 5.0.0-next.259 - dev: false + dev: true /magic-string@0.30.11: resolution: {integrity: sha512-+Wri9p0QHMy+545hKww7YAu5NyzF8iomPL/RQazugQ9+Ez4Ic3mERMd8ZTX5rfK944j+560ZJi8iAwgak1Ac7A==} @@ -3196,7 +3199,6 @@ packages: resolution: {integrity: sha512-oLxFY2gd2IqnjcYyOXD8XGCftpGtZP2AbHbOkthDkvRywH5ayNtPVy9YlOPcHckXzbLTCHpkb7FB+yuxKV13pQ==} engines: {node: ^18 || >=20} hasBin: true - dev: false /natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} @@ -3259,6 +3261,15 @@ packages: /package-json-from-dist@1.0.0: resolution: {integrity: sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==} + /paneforge@0.0.6(svelte@5.0.0-next.259): + resolution: {integrity: sha512-jYeN/wdREihja5c6nK3S5jritDQ+EbCqC5NrDo97qCZzZ9GkmEcN5C0ZCjF4nmhBwkDKr6tLIgz4QUKWxLXjAw==} + peerDependencies: + svelte: ^4.0.0 || ^5.0.0-next.1 + dependencies: + nanoid: 5.0.7 + svelte: 5.0.0-next.259 + dev: true + /parent-module@1.0.1: resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} engines: {node: '>=6'} diff --git a/src/components/habits/ProgressBar.svelte b/src/components/habits/ProgressBar.svelte index 088a8b2..b76ea12 100644 --- a/src/components/habits/ProgressBar.svelte +++ b/src/components/habits/ProgressBar.svelte @@ -1,7 +1,8 @@ -
+
{#if habits.length > 0}

Habits

diff --git a/src/lib/components/ui/resizable/index.ts b/src/lib/components/ui/resizable/index.ts new file mode 100644 index 0000000..2e37f11 --- /dev/null +++ b/src/lib/components/ui/resizable/index.ts @@ -0,0 +1,13 @@ +import { Pane } from "paneforge"; +import Handle from "./resizable-handle.svelte"; +import PaneGroup from "./resizable-pane-group.svelte"; + +export { + PaneGroup, + Pane, + Handle, + // + PaneGroup as ResizablePaneGroup, + Pane as ResizablePane, + Handle as ResizableHandle, +}; diff --git a/src/lib/components/ui/resizable/resizable-handle.svelte b/src/lib/components/ui/resizable/resizable-handle.svelte new file mode 100644 index 0000000..43316a0 --- /dev/null +++ b/src/lib/components/ui/resizable/resizable-handle.svelte @@ -0,0 +1,28 @@ + + +div]:rotate-90", + className + )} +> + {#if withHandle} +
+ +
+ {/if} +
diff --git a/src/lib/components/ui/resizable/resizable-pane-group.svelte b/src/lib/components/ui/resizable/resizable-pane-group.svelte new file mode 100644 index 0000000..2692794 --- /dev/null +++ b/src/lib/components/ui/resizable/resizable-pane-group.svelte @@ -0,0 +1,22 @@ + + + + +