News for hackers. Stuff that matters.
Re:Ask HN: What tools are you using to quickly build website... by Leftium on Tuesday July 02, 2024 @10:36AM (#40857117)
With SvelteKit I can take an idea for a non-trivial web app to working prototype in less than a day.

For example, I built an experimental beat-aware video player in less than a day. And this was while I was first teaching myself Svelte. (This was before SvelteKit was even a thing.)

My freelance clients are often surprised how fast I can get them results. And I keep getting faster as I gain more experience.

- The SvelteKit starter template is like a collection of best practices for web development.

- The Svelte community is pretty helpful, too. (Both core maintainers and regular users.)

Here's one of the apps I'm currently working on:

- https://weather-sense.leftium.com

- https://github.com/Leftium/weather-sense

Re:Ask HN: What tools are you using to quickly build website... by sriram_malhar on Tuesday July 02, 2024 @12:57PM (#40858433)
This looks lovely. May I ask who your preferred hosting providers are?
Re:Ask HN: What tools are you using to quickly build website... by Leftium on Tuesday July 02, 2024 @01:08PM (#40858545)
Vercel.

- Vercel hired the founder as well as a few core-maintainers to just work on Svelte(Kit) full-time. So Vercel tends to have the best class support for SvelteKit.

- Other platforms like Netlify and Cloudflare have officially maintained adapters too.

- SvelteKit was designed as serverless-first, but Node and even static deployments (like Github pages) are supported, too

Re:Ask HN: What tools are you using to quickly build website... by jayFellows on Tuesday July 02, 2024 @02:21PM (#40859159)
Database?
Re:Ask HN: What tools are you using to quickly build website... by Leftium on Tuesday July 02, 2024 @02:43PM (#40859342)
So far, my personal projects haven't used a database. If I need a DB (service), these would be my top candidates:

- https://supabase.com

- https://pockethost.io

- https://fauna.com

- https://www.edgedb.com

They all support serverless and also provide auth (to avoid the user storage/query problem[1])

While SvelteKit does include backend functionality, unfortunately it doesn't have any special DX for databases. I think there are other starter templates built on top of Kit for that...

[1]: https://threadreaderapp.com/thread/1651434348174778370.html

Re:Ask HN: What tools are you using to quickly build website... by Lord_Zero on Tuesday July 02, 2024 @04:28PM (#40860134)
Eh... when the user logs in like via OIDC you get claims, you just store the user the second they login (username, profile pic/avatar, email).
Re:Ask HN: What tools are you using to quickly build website... by Leftium on Tuesday July 02, 2024 @10:28PM (#40862246)
Sure, querying/storing the current logged in user is simple.

Imagine rendering a single Reddit thread that contains comments by 100's of users from a set of millions of users.

The problem is querying (and storing) the usernames, avatars, etc of other users to render the author info for all comments... and updating that information when any user updates their avatar, etc.

That's what the user storage problem is.

Re:Ask HN: What tools are you using to quickly build website... by Lord_Zero on Wednesday July 03, 2024 @03:07PM (#40869064)
I guess I still dont see the problem.

If you store claims when they login, and update when they update their profile you simply join users table to comments table.

That is no different than any other data in your system. You could have a view, or do the join in SQL to join Users + Comments when someone requests a page. Thats not really a problem is it?

Re:Ask HN: What tools are you using to quickly build website... by Leftium on Wednesday July 03, 2024 @07:08PM (#40870915)
> when you look at these auth solutions they typically will handle three things

> 1. handshakes with third party IDPs (login with google, etc)

> 2. session management

> 3. user storage

> 1+2 are boring and i’m 100% down to offload it to someone else

> the problem is #3

I think you are assuming you do #3 (user storage) yourself in your own database, which is possible.

But lots of auth providers want to store the users for you and make it look appealing (user dashboard already made, don't have to store PII, SSO: can share single account across multiple services, etc)

That is exactly what one of my clients decided after I introduced them to UserFront. But then ran into problems just rendering a list of items in the app because only the UserFront id was stored in the local DB. User names, email addresses, were all stored in UserFront.

You can choose to store username, email addresses, etc in your own database, but then you have to be careful about syncing at least the user id + email address(es) between the auth service and your own DB.

Re:Ask HN: What tools are you using to quickly build website... by jayFellows on Tuesday July 02, 2024 @05:24PM (#40860568)
Hadn't heard of pockethost before.

Recently learned about https://www.convex.dev/ which seems worth consideration.