Codync
A free, open-source 1:1 alternative to Grok Bot and Muse. Message Claude Code, Codex, Cursor and 40+ coding agents as persistent bots from your iPhone, Mac or Linux desktop. Group chats, threads, appr
React SSR for NestJS with Clean Architecture
Developer toolsTypeScript · JavaScriptGitHub @georgialexandrovOnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
React as a view layer for NestJS
Translation pending
Taken from the repository README
Loading the full README.
Read the full README ↗React SSR for NestJS. One app. One deploy. Full type safety from database to DOM.
No separate frontend. No second router. No type boundary you maintain by hand. Controllers return data, components render it, TypeScript enforces the contract.
// recipes.controller.ts
import { Controller, Get, Param } from '@nestjs/common';
import { Render, Layout } from '@nestjs-ssr/react';
import { RecipesLayout } from './views/recipes-layout';
import { RecipeDetail } from './views/recipe-detail';
@Controller('recipes')
@Layout(RecipesLayout)
export class RecipesController {
@Get(':slug')
@Render(RecipeDetail)
getRecipe(@Param('slug') slug: string) {
const recipe = this.recipes.findBySlug(slug);
return {
recipe,
chef: this.chefs.findById(recipe.chefId),
head: { title: recipe.name },
};
}
}
// recipe-detail.tsx
import { PageProps } from '@nestjs-ssr/react';
export default function RecipeDetail({
recipe,
chef,
}: PageProps<RecipeDetailProps>) {
return (
<article>
<h1>{recipe.name}</h1>
<p>{recipe.description}</p>
<IngredientList items={recipe.ingredients} />
<ChefCard chef={chef} />
</article>
);
}
Return the wrong shape and TypeScript catches it before the code runs.
Your NestJS app stays exactly as it is. Routing, guards, pipes, interceptors, services, modules, testing — all unchanged. You're adding a view layer, not rewriting your backend.
renderToString for simplicity, renderToPipeableStream for performance. Suspense boundaries stream as they resolve.head from your controller.npx @nestjs-ssr/react init
One command. Works with Express and Fastify, on NestJS 11 and 12. It adds a
starter layout and a /welcome page so you can see server rendering and
hydration working right away.
Node.js 22.17+ / NestJS 11 or 12 / React 19+ / Vite 7+ / TypeScript 5+
georgialexandrov.github.io/nestjs-ssr
git clone https://github.com/georgialexandrov/nestjs-ssr.git
cd nestjs-ssr
pnpm install
pnpm build:package
pnpm test
MIT