N
Nuxt4mo ago
moe

Backend resources

Hey there everyone, i have a problem which is i dont know how to make fullstack apps using nuxt maybe it sounds like a skill issue but i have always used nuxt server routes to fetch my apis from my main backend which is Laravel but now i want to use the h3 server and nitro to make my apps but guess what i dont know how to start docs are great specially for the nuxt server directory docs but i still feel that i need a big one tutorial or a resource that teach me all the way about nuxt backend and how to use it how to make my own db and do relations websockets etc. thank you all
2 Replies
kapa.ai
kapa.ai4mo ago
Hi @moe. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- If you want to build the backend inside Nuxt (with Nitro + h3), start with these official docs and guides, then expand to specific topics: - Getting started with the server in Nuxt (what lives in server/api, server/middleware, server/plugins; HMR; calling APIs with useFetch/$fetch) (Server).
- Server directory guide (API routes, non-/api routes, middleware, plugins, utilities, advanced patterns like nested routers, redirects, streams, legacy adapters, Nitro storage config) (server directory, advanced usage).
- Nitro server engine concepts (API layer with h3, direct calls with $fetch that avoid extra network hops on server, typed routes, standalone output) (Server engine).
- Nuxt lifecycle on the server (Nitro plugins run once, server middleware per request, where to put what) (Nuxt lifecycle: server).
Patterns and “when to use server/ vs external backend”: - If you already have Laravel as a separate backend, you don’t have to use server/api; use it when you want a tightly coupled full‑stack app or small app-specific endpoints (auth, proxy/BFF) (Stack Overflow answer). Proxy/BFF and sharing data: - Recommended proxy strategies in Nuxt/Nitro to talk to external backends (e.g., Laravel) without exposing secrets or CORS pain (The BEST way to proxy your API in Nuxt).
- Share data computed once in Nitro with the Nuxt app without re-fetching (Fetch ONCE and share data).
- Understand Nuxt vs Nitro boundaries and limitations of the server folder (Nuxt vs. Nitro).
Databases and storage: - Nitro storage layer and mounting drivers (e.g., Redis) from config or plugins (server advanced: Server Storage).
- Nuxt docs also point to Nitro’s database feature and NuxtHub SQL in the sessions/auth recipe’s “next steps” (Sessions and Authentication – Conclusion).
Auth and sessions: - End-to-end recipe with sessions, plus pointers to OAuth providers, password hashing, WebAuthn, and DB options (Sessions and Authentication – Conclusion).
WebSockets: - How to set up WebSockets in Nitro and consume from the client (Integrating WebSockets in Nuxt and Nitro).
Going deeper with Nitro (APIs/middleware/plugins/prerender via kit utilities): - addServerHandler/addServerPlugin/addPrerenderRoutes usage (Nuxt Kit: Nitro).
If you’re migrating from or comparing with other backends: - Using other backend frameworks inside Nitro (Express/Fastify/Hono) for advanced needs (Nuxt with OTHER backend frameworks?). Tip: Build iteratively— 1) Start with server/api endpoints and server/middleware in your Nuxt app (server directory).
2) Add auth/session per the recipe, then DB/storage (Sessions and Authentication – Conclusion, Server Storage).
3) Introduce routeRules for caching/SSR/prerender as you scale (Getting started: Server → Hybrid Rendering).
If you need a single “big tutorial,” the docs + the linked videos together provide the end-to-end picture for APIs, middleware, auth, DB/storage, proxy/BFF, and WebSockets in Nitro. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai4mo ago
<@1282066639868792833> Kapa.ai is still learning and improving, please let me know how I did by reacting below.

Did you find this page helpful?