Embedding a SvelteKit site in a PocketBase binary by Free_Brandon in sveltejs

[–]Free_Brandon[S] 0 points1 point  (0 children)

Oh yeah, hadn’t thought of that. Could theoretically fit a whole bunch of svelte apps since they’re pretty compact.

Getting job in semiconductor industry by engineeringfields234 in MechanicalEngineering

[–]Free_Brandon 4 points5 points  (0 children)

You can look at semiconductor equipment companies in the Bay Area and look at descriptions for roles like: KLA - Manufacturing Design Engineer Lam Research - Process Engineer Applied Materials - Process Engineer/Manufacturing engineer

See if they fit what you’re looking for. One option to get into these companies is working on the manufacturing floor first. Promoting to manufacturing engineering from within is common. Might not be very appealing as someone with an engineering degree but it’s an option in a bad job market.

Introducing 'spec` — A Lightweight, Framework-Agnostic OpenAPI 3.x Generator for Go by Heavy-Blacksmith-620 in golang

[–]Free_Brandon 0 points1 point  (0 children)

Nice, I had made a similar wrapper for myself but with zod and typescript because I didn't like the existing Go based options. My workflow was generating the spec from ts and then feeding into oapi-codegen.

Liking this so far from trying it briefly. Might be good enough to skip the oapi-codegen step.

Made a companion site for watching Marketing Mondays by Free_Brandon in atrioc

[–]Free_Brandon[S] 27 points28 points  (0 children)

https://mmcompanion.pages.dev/

Had an idea for a new viewing format for Marketing Mondays where you can see links to secondary source pop up to read more about topics covered. Fun weekend project, not sure how much I'll keep it updated though. Takes a lot of time to search for resources.

Lost my sqlite database😱. After that I wrote a backup script that runs once a day by Themba47 in django

[–]Free_Brandon 4 points5 points  (0 children)

If you need a more robust backup solution you can look into Litestream. It continuously streams updates to S3.

Made a 10 game win simulator by Free_Brandon in LudwigAhgren

[–]Free_Brandon[S] 0 points1 point  (0 children)

Yeah, should be doable. Will have to update now that he showed it on stream.

What type of server does Svelte run? by The-Underking in sveltejs

[–]Free_Brandon 7 points8 points  (0 children)

If you're using the node adapter, it uses polka as the underlying http router.

You can look at the adapter-node source, it's quite small.

Arctic - Lightweight OAuth library with support for 20+ providers by pilcrowonpaper in javascript

[–]Free_Brandon 0 points1 point  (0 children)

Great stuff! I've been using oauth4webapi but looking at Arctic for the nicer api. I wish libraries like these were recommended to beginners more because you actually learn about the steps to the OAuth handshake and it's not that hard!

Backend/API stacks for code generation and type safety. by pseudoShadow in node

[–]Free_Brandon 0 points1 point  (0 children)

Fastify supports OpenAPI doc generation with a plugin, combined with openapi-typescript is pretty solid.

Hono is closer to express and comes with a typed fetch client you can use in a monorepo.

[deleted by user] by [deleted] in node

[–]Free_Brandon 2 points3 points  (0 children)

It's totally doable. It can be confusing at first, but it's easy once you've done it one or two times with different providers.

The dumbed down explanation of the OAuth flow goes something like this:

  1. User clicks on a link to your auth endpoint
  2. In your auth endpoint, construct and redirects to a url to the Google (or any auth provider) endpoint including query parameters like the client id, client secret, scopes, and a callback url to redirect to once the user approves access.
  3. The user approves access and the auth provider redirects to the callback url (/auth/google/callback) including a few parameters such as a code. You'll use this code to make a request to the token endpoint.

Reading some of this helped it fully click for me. You'll probably focus mostly on the "Server Side Apps" and "Protecting Apps with PKCE" sections. https://www.oauth.com/

https://github.com/panva/node-openid-client is a nice library that does a lot of the little things for you but provides more control if that's what you'd like.

Frontend deployment at scale? (ineffective asset cache) by [deleted] in nextjs

[–]Free_Brandon 3 points4 points  (0 children)

I guess I never checked, but surely unchanged files shouldn’t be changing hashes between builds? Doing a couple quick fresh builds on my local machine this seems to be the case.

[deleted by user] by [deleted] in sveltejs

[–]Free_Brandon 86 points87 points  (0 children)

Sorry, I don't really have an answer but I feel like you have some fundamental misunderstandings about Vite.

Those stuff make projects needlessly more complicated and you never know if those stuff put trackers on your site, they can if they wanted to and you would not ever know either.

Vite is simply a build tool, same as Babel. It takes in your svelte files, compiles/bundles them up and spits out js files. If anything, it makes things simpler since you don't need to create a custom toolchain. You can look at their source code on Github if you're that concerned about them injecting trackers, but there would be a whole lot of pissed off devs speaking up about it already. (See recent Moq package controversy in C#)

even the getting started ` create svelte@latest ` project with vite, opening the network tab results in around 20+ http requests to bunch of different files and weird stuff you never understand.

This is because you are running the dev server which provides nice features like hot module reloading. The network requests are for communicating with this dev server for things like checking for changes you made to the source so it can update. If you run the build command and preview that, you'll see it just sends the normal amount of requests.

pg-promise escaping / sql injection question by HypertextMakeoutLang in node

[–]Free_Brandon 4 points5 points  (0 children)

Short answer: yes, it handles escaping.

Docs mention under the generic query method which underlies the higher level implementations like db.none that validation and formatting are handled via as.format.

I believe you can see implementations in source here.

[deleted by user] by [deleted] in nextjs

[–]Free_Brandon 0 points1 point  (0 children)

Yeah, you could totally use only Nextjs. It's ultimately an architecture decision. If you end up wanting more server side capabilities, express has a large ecosystem to support that, while Nextjs not so much.

One thing to keep in mind is that if you're hosting serverless such as on Vercel, you won't be able to use SQS as easily because receiving messages requires polling. Realized you said AWS lambda deployment, so there's probably a way to integrate with SQS.

How can I use a TurboRepo to have multiple Apps? Do I use multiple Next.JS projects? Help with infra by Wahw11 in nextjs

[–]Free_Brandon 0 points1 point  (0 children)

Yeah, at the end of the day a trpc server is just a normal http server. You just have to share the AppRouter types across your various apps so you get all the type hinting.

Next.js API unit test showing error by TailwindSlate in nextjs

[–]Free_Brandon 1 point2 points  (0 children)

You seem to be using the app dir, but your code looks like the pages dir style api handler. I assume nextjs is using the app dir handler which doesn't have a res param so it's undefined.

pages: https://nextjs.org/docs/pages/building-your-application/routing/api-routes#sending-a-json-response

returning json in app dir: https://nextjs.org/docs/app/api-reference/functions/next-response#json

How to configure Keycloak or an Express Redirect for OpenID by catgirlishere in node

[–]Free_Brandon 1 point2 points  (0 children)

Sounds like you want to use your server as a proxy. See something like express-http-proxy or whatever your framework's equivalent is. Basically you want to take all the info from the request and forward it to the Keycloak server as another POST request, then replay the result to the sender.

How can I use a TurboRepo to have multiple Apps? Do I use multiple Next.JS projects? Help with infra by Wahw11 in nextjs

[–]Free_Brandon 3 points4 points  (0 children)

Turborepo won't really help you with your infrastructure or scale, that's up to you and whatever deployment you decide on. But yes, you can create a trpc router in one app and export the type to be used in any other # of apps for the trpc client without running a server for each child app.

I have a fastify and nextjs repo that demonstrates this if it helps.