SvelteKit + PocketBase Integration: User Login and Registration

Sdílet
Vložit
  • čas přidán 30. 05. 2024
  • If you enjoyed this video, please support me by buying me a coffee. Many thanks!
    ☕️ go.jian.fyi/buy-me-a-coffee
    ℹ️ Integrate PocketBase with SvelteKit 1.0: Setup & User Management
    📁 Source code: go.jian.fyi/github-pocketbase...
    00:00 Introduction
    00:08 PocketBase setup
    00:57 SvelteKit setup
    02:30 Basic layout and styling
    04:05 Install PocketBase SDK
    05:17 Frontend client
    06:52 Backend client
    10:10 User registration page
    15:42 Log out action
    17:38 Log in page
    19:12 Final demo
    #sveltekit #svelte #pocketbase #javascript #typescript #programming

Komentáře • 75

  • @g0d638
    @g0d638 Před rokem +5

    Why is it always these weird no name channels that make the best guides

  • @mastahpiece007
    @mastahpiece007 Před rokem +2

    This guy just makes me realise how long it takes me to do very basic tasks ROFL. "now we will just create a basic form" > neat looking form with 1 liners jeez very good dude

  • @wafflecodes
    @wafflecodes Před rokem +14

    This is excellent. It's concise and succinct. It's free from the usual plagues of tutorials - "Umm"'s , "Uhhs", mistypes, rambling, etc. It's especially nice that you make the good assumption that there's some knowledge of SvelteKit and aren't going over everything in exhausting, redundant detail.
    Would love to see more content like this on SvelteKit and PocketBase. Subbed!

    • @jianyuanlee
      @jianyuanlee  Před rokem

      Wow, thank you for your kind words! I'm glad it was helpful!

    • @fredrikcelion32
      @fredrikcelion32 Před 4 měsíci

      @@jianyuanlee ; Will you do and update with new sveltekit and the latest version of Pcoketbase?

  • @ephemeus
    @ephemeus Před rokem +13

    Your pacing is good. Not too fast but not too slow either. I hope you could explain more about hooks and progressive enhancement in sveltekit. Anyway, thanks for this video, it really helps.

    • @jianyuanlee
      @jianyuanlee  Před rokem

      Thank you! I will keep that in mind for my future videos.

  • @jckail
    @jckail Před 6 měsíci +1

    Thank you for this video.
    It was very helpful and everything worked.
    +1 to listing installed Svelte extensions (ie auto complete)
    +1 to zooming out just a bit more to see more code width on screen.

  • @hakuna_matata_hakuna
    @hakuna_matata_hakuna Před rokem +1

    This one was so smooth i think am sold on svelte, i just wanted to know how to do SSR login with PB and you conveyed it perfectly

  • @rogerpence
    @rogerpence Před 10 měsíci +2

    Thank you very much for this excellent tutorial. It seems like less than 5% of example projects work as promised--and yours worked like a charm. Also, your presentation skills are superb. A++++ all the way down the line! I very much appreciate your work on this. Thank you.

  • @sikandarbhide5354
    @sikandarbhide5354 Před rokem +3

    This is called "Magnificent" , i love this content 🔥🔥

  • @SarcevicAntonio
    @SarcevicAntonio Před 11 měsíci +2

    I've used your code sample in a project before and now coded along with the video.
    What a great tutorial! Thanks for creating ❤

  • @SaiedWorks
    @SaiedWorks Před 9 měsíci +2

    Very well explained and easy to understand. Hope you make more Sveltekit videos.

  • @argonjs
    @argonjs Před rokem +1

    just started learning svelte and this video really helps. thankss man! keep up the good work

  • @karolus__
    @karolus__ Před rokem +2

    Great content. Would be great to see some continuation about sveltekit

    • @jianyuanlee
      @jianyuanlee  Před rokem +3

      Thank you! I plan to release a few more videos on SvelteKit. Stay tuned!

  • @etienneguerlain7147
    @etienneguerlain7147 Před rokem +1

    Thank you for this great video! I'm learning SvelteKit and it helps a lot :)

  • @iamcherrydee
    @iamcherrydee Před rokem +1

    We need more contents from you please

  • @tech_wizzdom
    @tech_wizzdom Před rokem +1

    Awesome content, so clear! 🔥

  • @ubermatchvlaad532
    @ubermatchvlaad532 Před 3 měsíci

    Wee neeed more!!!!, great content

  • @stephanfitzpatrick1769
    @stephanfitzpatrick1769 Před rokem +1

    Outstanding video, thanks. Instant subscription.

  • @mariogutierrez4989
    @mariogutierrez4989 Před rokem +1

    Good job. You work so efficiently.

  • @michaelsebastiansby6885
    @michaelsebastiansby6885 Před rokem +1

    Amazing video, many thanks!

  • @MOUNIROU60
    @MOUNIROU60 Před rokem +1

    you are a master, thanks for the video

  • @DevneelVaidya
    @DevneelVaidya Před 3 měsíci

    Btw, this video has helped me so much, thank you!

  • @Apptato
    @Apptato Před rokem +1

    Well explained. Thanks.

  • @sikandarbhide5354
    @sikandarbhide5354 Před rokem +1

    Man u r Amazing....

  • @demystifyingdev
    @demystifyingdev Před rokem +4

    Excellent content and superbly presented! Hope to see more videos! How about a sample app like to do or blog, with deployment of front-end and back-end... would be great!

    • @jianyuanlee
      @jianyuanlee  Před rokem +5

      Thank you! I plan to make a video on building a fully-fledged app. Stay tuned!

  • @salahaldinedouard5299
    @salahaldinedouard5299 Před rokem +1

    Great video

  • @kiwi-ck2yo
    @kiwi-ck2yo Před 10 měsíci

    Hey ! I'm pretty confused about the syntax you use around 10:03 to define the Locals interface, as it's pretty different from what I can read online about typescript interfaces.
    My first instinct would have been to import the PocketBase object from pocketbase and write " pb : Pocketbase; " (this is, in fact, how they suggest to do it on the GitHub page for Pocketbase's JS SDK) but your syntax seems to provide more complete intellisense, so I'm guessing it must be pretty different and in term the better way.
    Can you direct me to some ressources on how that kind of type declaration works ?

  • @abderrahmanesmimite6137
    @abderrahmanesmimite6137 Před rokem +1

    This is good, thank you! is part 2 coming soon with error management? interacting with other collections and file management for instance to have a complete tutorial ?

  • @vampirekabir
    @vampirekabir Před 10 měsíci

    do you recommend pocketbase for a nextjs twitter like site?

  • @diegov.b.9142
    @diegov.b.9142 Před 4 měsíci

    I've duplicated the folder register to insert another form/collection, but it didn't work. Could make an example to create a new form?

  • @RobRobJuice
    @RobRobJuice Před rokem +1

    I seem to have an issue with using multiple +page.server.ts files. Both login and register work if they are by themselves in the routes folder, but neither work if both are in they own folders (like in your video), nor if both are in the routes folder (can't have multiple +page.server.ts files in the same folder). I get error 405 and 500. Any suggestions?
    Keep up the good work!

    • @jianyuanlee
      @jianyuanlee  Před rokem +1

      The complete project is available on my GitHub: github.com/jianyuan/pocketbase-sveltekit-auth
      I hope that helps!

  • @lyaeusv3828
    @lyaeusv3828 Před rokem +1

    very clear cool vibe ! here i gift you a bar |

  • @ubergraham
    @ubergraham Před rokem

    I'm not ready to drive in just yet and learn Typescript; can I use the TS code for just user auth and use vanilla Javascript for everything else?

    • @jianyuanlee
      @jianyuanlee  Před rokem +1

      Yes, you can! All JavaScript is valid TypeScript too. Though, I still recommend using TypeScript for its amazing auto-completion. You can turn strict mode off to avoid build errors (set compilerOptions -> strict = false in tsconfig.json).

  • @RicardoCamisa
    @RicardoCamisa Před rokem +1

    Thanks so much for the wonderful class. Could you teach how to generate PDF with SvelteKit?

  • @tobias6361
    @tobias6361 Před rokem +1

    thanks for making this video, how viable is pocketbase for production ready apps?

    • @jianyuanlee
      @jianyuanlee  Před rokem +2

      The project is under active development, but I have used it in a handful of personal projects over a few months, and it's working very well so far. There were no backward incompatibilities. If you want to take full advantage of PocketBase, you have to use it as a Go framework to build custom business logic on top of it.
      I plan to build a production-ready SaaS using PocketBase in an upcoming video. Stay tuned!

  • @ardinhelios5677
    @ardinhelios5677 Před 9 měsíci +1

    Why are we refreshing the auth token every time the hook is called with a valid token, this isn't scalable at all, tokens are meant to be created once right, please correct me if I am wrong

    • @jianyuanlee
      @jianyuanlee  Před 9 měsíci +1

      PocketBase tokens are JWT tokens. The hook checks whether the JWT token is expired or not. It's all done without hitting PocketBase.

  • @onechaintwobinerz5402

    It looks like to deploy on cloudflare pages I need to use node_version 16, which does not include structuredClone :( do you have any advice? great tutorial, thanks

    • @name_less227
      @name_less227 Před rokem

      I am not much help but I saw another guy on youtube recently mention structuredClone is the same as JSON.parse(JSON.stringify(x)), just more efficient. You'll have to check for yourself.

    • @jianyuanlee
      @jianyuanlee  Před rokem

      Try converting it to JSON and back again.e.g. `JSON.parse(JSON.stringify(pb.authStore.model))`

    • @jean_luc_retard
      @jean_luc_retard Před rokem +1

      SvelteKit now includes `devalue` (by Rich Harris). Try this instead

  • @jean_luc_retard
    @jean_luc_retard Před rokem

    What are the consequences of instantiating PocketBase in client hook? I thought PocketBase was supposed to be run on server side? No risks with doing what you did here?

    • @jianyuanlee
      @jianyuanlee  Před rokem +1

      The PocketBase SDK can be used on both client-side and server-side. When we instantiate PocketBase on the client-side, it allows us to interact directly with PocketBase’s features from the client, such as real-time subscriptions and authentication.

    • @jean_luc_retard
      @jean_luc_retard Před 7 měsíci

      @@jianyuanlee I have read the code in the project repository and haven't found any examples of this, as all pages have server-side load functions only. Could you provide an example how would that be used client side?

    • @jean_luc_retard
      @jean_luc_retard Před 7 měsíci

      ​@@jianyuanlee Also, when instantiating pb the first time server side we supply local pb instance address, but when the whole thing ultimately switches to client side, wouldn't we need to supply remote ip address to still be able to reach pb?

  • @mennskr
    @mennskr Před rokem

    Which browser are you using?

  • @musketeer245
    @musketeer245 Před rokem +2

    Very helpful tutorial! Can you also make Sveltekit + Firebase authentication next time pls?

    • @jianyuanlee
      @jianyuanlee  Před rokem

      Thank you! I plan to do a video on Firebase soon!

  • @TheFoxstory
    @TheFoxstory Před 11 měsíci

    would you say this is a better approach than huntabyte's and why?
    his approach
    czcams.com/video/vKqWED-aPMg/video.html