cmintey / wishlist

Wishlist is a self-hosted wishlist application that you can share with your friends and family. You no longer have to wonder what to get your family for the holidays, simply check their wishlist and claim any available item!
MIT License
63 stars 2 forks source link

Feature: Developer guide #178

Open albinmedoc opened 21 hours ago

albinmedoc commented 21 hours ago

Is your feature request related to a problem? Please describe. I can't manage to get the application running on my computer. I would like to add new features to the application. I have installed Node 22 and pnpm, then I run these commands in order:

  1. pnpm install
  2. pnpm prisma generate
  3. pnpm run dev

Describe the solution you'd like A clear and concise steps how to setup the developing environment

Additional context

PS C:\Users\al6688me\Documents\Repositories\wishlist> pnpm run dev

> wishlist@0.0.1 dev C:\Users\al6688me\Documents\Repositories\wishlist
> vite dev

  VITE v5.4.11  ready in 1798 ms

  ➜  Local:   http://localhost:5173/
  ➜  Network: use --host to expose
  ➜  press h + enter to show help
prisma:error
Invalid `prisma.user.count()` invocation:

error: Environment variable not found: DATABASE_URL.
  -->  schema.prisma:3
   |
 2 |   provider = "sqlite"
 3 |   url      = env("DATABASE_URL")
   |

Validation Error Count: 1
PrismaClientInitializationError:
Invalid `prisma.user.count()` invocation:

error: Environment variable not found: DATABASE_URL.
  -->  schema.prisma:3
   |
 2 |   provider = "sqlite"
 3 |   url      = env("DATABASE_URL")
   |

Validation Error Count: 1
    at $n.handleRequestError (C:\Users\al6688me\Documents\Repositories\wishlist\node_modules\.pnpm\@prisma+client@5.22.0_prisma@5.22.0\node_modules\@prisma\client\runtime\library.js:121:7615)
    at $n.handleAndLogRequestError (C:\Users\al6688me\Documents\Repositories\wishlist\node_modules\.pnpm\@prisma+client@5.22.0_prisma@5.22.0\node_modules\@prisma\client\runtime\library.js:121:6623)
    at $n.request (C:\Users\al6688me\Documents\Repositories\wishlist\node_modules\.pnpm\@prisma+client@5.22.0_prisma@5.22.0\node_modules\@prisma\client\runtime\library.js:121:6307)
    at async l (C:\Users\al6688me\Documents\Repositories\wishlist\node_modules\.pnpm\@prisma+client@5.22.0_prisma@5.22.0\node_modules\@prisma\client\runtime\library.js:130:9633)
    at async load (C:\Users\al6688me\Documents\Repositories\wishlist\src\routes\login\+page.server.ts:15:23)
    at async Module.load_server_data (C:\Users\al6688me\Documents\Repositories\wishlist\node_modules\.pnpm\@sveltejs+kit@2.8.1_@sveltejs+vite-plugin-svelte@4.0.1_svelte@5.2.3_vite@5.4.11_@types+node@2_pb5rirknwahgnoixf77ldhrq4q\node_modules\@sveltejs\kit\src\runtime\server\page\load_data.js:61:17)
    at async eval (C:\Users\al6688me\Documents\Repositories\wishlist\node_modules\.pnpm\@sveltejs+kit@2.8.1_@sveltejs+vite-plugin-svelte@4.0.1_svelte@5.2.3_vite@5.4.11_@types+node@2_pb5rirknwahgnoixf77ldhrq4q\node_modules\@sveltejs\kit\src\runtime\server\page\index.js:156:13) {
  clientVersion: '5.22.0',
  errorCode: undefined
}
prisma:error
Invalid `prisma.user.count()` invocation:

error: Environment variable not found: DATABASE_URL.
  -->  schema.prisma:3
   |
 2 |   provider = "sqlite"
 3 |   url      = env("DATABASE_URL")
   |

Validation Error Count: 1
PrismaClientInitializationError:
Invalid `prisma.user.count()` invocation:

error: Environment variable not found: DATABASE_URL.
  -->  schema.prisma:3
   |
 2 |   provider = "sqlite"
 3 |   url      = env("DATABASE_URL")
   |

Validation Error Count: 1
    at $n.handleRequestError (C:\Users\al6688me\Documents\Repositories\wishlist\node_modules\.pnpm\@prisma+client@5.22.0_prisma@5.22.0\node_modules\@prisma\client\runtime\library.js:121:7615)
    at $n.handleAndLogRequestError (C:\Users\al6688me\Documents\Repositories\wishlist\node_modules\.pnpm\@prisma+client@5.22.0_prisma@5.22.0\node_modules\@prisma\client\runtime\library.js:121:6623)
    at $n.request (C:\Users\al6688me\Documents\Repositories\wishlist\node_modules\.pnpm\@prisma+client@5.22.0_prisma@5.22.0\node_modules\@prisma\client\runtime\library.js:121:6307)
    at async l (C:\Users\al6688me\Documents\Repositories\wishlist\node_modules\.pnpm\@prisma+client@5.22.0_prisma@5.22.0\node_modules\@prisma\client\runtime\library.js:130:9633)
    at async load (C:\Users\al6688me\Documents\Repositories\wishlist\src\routes\login\+page.server.ts:15:23)
    at async Module.load_server_data (C:\Users\al6688me\Documents\Repositories\wishlist\node_modules\.pnpm\@sveltejs+kit@2.8.1_@sveltejs+vite-plugin-svelte@4.0.1_svelte@5.2.3_vite@5.4.11_@types+node@2_pb5rirknwahgnoixf77ldhrq4q\node_modules\@sveltejs\kit\src\runtime\server\page\load_data.js:61:17)
    at async eval (C:\Users\al6688me\Documents\Repositories\wishlist\node_modules\.pnpm\@sveltejs+kit@2.8.1_@sveltejs+vite-plugin-svelte@4.0.1_svelte@5.2.3_vite@5.4.11_@types+node@2_pb5rirknwahgnoixf77ldhrq4q\node_modules\@sveltejs\kit\src\runtime\server\page\index.js:156:13) {
  clientVersion: '5.22.0',
  errorCode: undefined
}
SvelteKitError: Not found: /registerSW.js
    at resolve (C:\Users\al6688me\Documents\Repositories\wishlist\node_modules\.pnpm\@sveltejs+kit@2.8.1_@sveltejs+vite-plugin-svelte@4.0.1_svelte@5.2.3_vite@5.4.11_@types+node@2_pb5rirknwahgnoixf77ldhrq4q\node_modules\@sveltejs\kit\src\runtime\server\respond.js:530:13)
    at resolve (C:\Users\al6688me\Documents\Repositories\wishlist\node_modules\.pnpm\@sveltejs+kit@2.8.1_@sveltejs+vite-plugin-svelte@4.0.1_svelte@5.2.3_vite@5.4.11_@types+node@2_pb5rirknwahgnoixf77ldhrq4q\node_modules\@sveltejs\kit\src\runtime\server\respond.js:330:5)
    at Object.handle (C:\Users\al6688me\Documents\Repositories\wishlist\src\hooks.server.ts:9:16)
    at Module.respond (C:\Users\al6688me\Documents\Repositories\wishlist\node_modules\.pnpm\@sveltejs+kit@2.8.1_@sveltejs+vite-plugin-svelte@4.0.1_svelte@5.2.3_vite@5.4.11_@types+node@2_pb5rirknwahgnoixf77ldhrq4q\node_modules\@sveltejs\kit\src\runtime\server\respond.js:327:40)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  status: 404,
  text: 'Not Found'
}
albinmedoc commented 20 hours ago

I managed to get the application started using these commands instead:

  1. pnpm install
  2. pnpm prisma db push after I have added environment variable DATABASE_URL
  3. pnpm run dev

But when following the setup-wizard to create the first user I get this error: image

cmintey commented 15 hours ago

Instead of pnpm prisma db push, try pnpm prisma migrate dev

cmintey commented 14 hours ago

Also if you'd like to implement any features, please add a comment to any existing (or create a new) feature request so I know and don't work on it as well.

albinmedoc commented 10 hours ago

Still getting the last error when following the setup wizard, user already exist...

> wishlist@0.0.1 dev /Users/al6688me/Documents/Repositories/wishlist
> vite dev

  VITE v5.4.11  ready in 941 ms

  ➜  Local:   http://localhost:5173/
  ➜  Network: use --host to expose
  ➜  press h + enter to show help
SvelteKitError: Not found: /registerSW.js
    at resolve (/Users/al6688me/Documents/Repositories/wishlist/node_modules/.pnpm/@sveltejs+kit@2.8.1_@sveltejs+vite-plugin-svelte@4.0.1_svelte@5.2.3_vite@5.4.11_@types+node@2_pb5rirknwahgnoixf77ldhrq4q/node_modules/@sveltejs/kit/src/runtime/server/respond.js:530:13)
    at resolve (/Users/al6688me/Documents/Repositories/wishlist/node_modules/.pnpm/@sveltejs+kit@2.8.1_@sveltejs+vite-plugin-svelte@4.0.1_svelte@5.2.3_vite@5.4.11_@types+node@2_pb5rirknwahgnoixf77ldhrq4q/node_modules/@sveltejs/kit/src/runtime/server/respond.js:330:5)
    at Object.handle (/Users/al6688me/Documents/Repositories/wishlist/src/hooks.server.ts:9:16)
    at Module.respond (/Users/al6688me/Documents/Repositories/wishlist/node_modules/.pnpm/@sveltejs+kit@2.8.1_@sveltejs+vite-plugin-svelte@4.0.1_svelte@5.2.3_vite@5.4.11_@types+node@2_pb5rirknwahgnoixf77ldhrq4q/node_modules/@sveltejs/kit/src/runtime/server/respond.js:327:40)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
  status: 404,
  text: 'Not Found'
}
prisma:error 
Invalid `prisma.user.create()` invocation:

Foreign key constraint violated: `foreign key`
cmintey commented 9 hours ago

Delete the db and run the prisma migrate dev. If it doesn't automatically run the seed command, then run pnpm prisma db seed as well