4 ms·
After many nodejs app iterations this will be my next nodejs architecture: sql statements in ./sql/* endpoint functions in ./endpoints/* router files in ./ro
by andrewstuart 2y ago
After many nodejs app iterations this will be my next nodejs architecture:
sql statements in ./sql/*
endpoint functions in ./endpoints/*
router files in ./routes
Subdirs under those that group things logically for that app
Auth functions in a separate server called by caddy forward auth like checkpoint401 which I wrote
User flow functions in a separate server like identoro which I wrote
Data validation in a separate server like youvalidateme which I wrote
I write big Postgres stored functions/procs and minimal sql in node
I gotta say though I’ll probably use Golang instead of node going forward, after building many node apps.
- pixelready 2y agoI’m a bit GoLang curious myself, but it seems like the modern react world is moving towards more tightly coupled monolithic full stack meta frameworks, with “use client” and “use server” directives sprinkled throughout the codebase. Then again, I feel like a good backend-focused language, a nice templating system, HTMX, and the inevitable cross-platform view transitions support will become a very tempting option for the vast majority of CRUD focused web apps…