Niko8mo ago

Frontend & Backend in one Deno Deploy project

I have a Nuxt 3 frontend and an Oak backend. Is it technically possible to deploy both in one deno deploy project? And if so, how can I achieve that? Thanks for helping! <:sushi_deno:1002977518833381396>
3 Replies
Deno AI Helper
Deno AI Helper8mo ago
The documentation does not provide a specific example or guide on deploying a Nuxt 3 frontend and an Oak backend together in one Deno Deploy project. However, it does provide separate guides on deploying web applications and using Oak. In general, Deno Deploy is designed to run JavaScript, TypeScript, and WebAssembly at the edge, worldwide. It supports built-in TypeScript and JSX, ES modules, and has direct GitHub integration. For deploying a Vite Deno and React app, the documentation suggests using the GitHub Actions mode of the GitHub integration, which allows you to perform a build step before deploying. This might be applicable to your Nuxt 3 frontend. For the Oak backend, the documentation provides an example of how to use Oak in Deno, and also mentions the possibility of publishing Oak to NPM in a way that it is usable in Node.js. However, combining these two in one Deno Deploy project is not explicitly covered in the documentation. It might be possible to achieve this by creating a main server file that serves both the frontend and the backend, but this is not explicitly supported or recommended by the documentation. I would recommend deploying the frontend and backend as separate Deno Deploy projects. This would allow you to manage and scale them independently, which can be beneficial in a microservices architecture. Remember to always test your deployments thoroughly to ensure they work as expected. 🦕
Kofi GOLO8mo ago
Have two folder at the root of your git repository ./backend/ ./frontend/ Can also be named client and server. Simple.
Niko8mo ago
But what would I set the entry_point to? The Nuxt frontend has its entry point at frontend/output/server/index.ts and the backend has it at backend/app.ts Got it to work. I am copying the frontend static files over to the backend folder after the frontend build. Then I am serving the static assets with Oak's send() method. -> only one entry_point in the backend needed then