Skip to content

Commit 4097678

Browse files
committed
Update README.md
1 parent 25d8b9d commit 4097678

1 file changed

Lines changed: 185 additions & 44 deletions

File tree

README.md

Lines changed: 185 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2,86 +2,227 @@
22

33
# .NET 10.0 Next.js + Tailwindcss ASP.NET Identity Auth Template
44

5-
![](https://raw.githubusercontent.com/ServiceStack/Assets/master/csharp-templates/nextjs.png)
6-
![](https://raw.githubusercontent.com/ServiceStack/Assets/master/csharp-templates/start/nextjs.png)
5+
[![](https://react-templates.net/img/replacing-legacy-uis/react-home.webp)](https://techstacks.io)
76

8-
> Browse [source code](https://github.com/NetCoreTemplates/nextjs) and install with [x new](https://docs.servicestack.net/dotnet-new):
9-
10-
This template should help get you started developing with Vue 3 and Typescript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
7+
> Browse [source code](https://github.com/NetCoreTemplates/next-rsc) and install with:
118
129
```bash
13-
$ dotnet tool install -g x
14-
15-
$ x new nextjs ProjectName
10+
npx create-net next-rsc ProjectName
1611
```
1712

1813
## Getting Started
1914

20-
Build Client UI & Run Dev Server
15+
Run Server .NET Project (automatically starts both .NET and Next.js dev servers):
2116

2217
```bash
23-
$ cd ui && npm run build:local
24-
$ npm run dev
18+
cd MyProject
19+
dotnet watch
2520
```
2621

27-
Run Server .NET Project (New Terminal)
22+
## Replacing Legacy UIs in an AI-First world
2823

29-
```bash
30-
$ cd api\ProjectName
31-
$ dotnet watch
32-
```
24+
Software Development has reached an inflection point where AI Models and tools are now good enough to rebuild complete application UIs in hours, not months.
25+
This fundamentally changes the economics of modernizing legacy applications where for many legacy frontends, it’s finally cheaper to rewrite than to keep refactoring legacy code bases.
3326

34-
For more, see development workflow docs for **JetBrains Rider** and **VS Code / VS .NET**
27+
## The Legacy UI Problem
3528

36-
#### Use npm dev server for UI Development
29+
Like old buildings, legacy UIs accumulate years of technical debt that makes renovation increasingly expensive:
3730

38-
- https://localhost:3000
31+
- **Layers of workarounds** - Code built on top of framework limitations that no longer exist
32+
- **Outdated patterns** - Solutions to problems that modern frameworks solve elegantly out-of-the-box
33+
- **Dependency hell** - Ancient package versions with security vulnerabilities and incompatible upgrades
34+
- **Framework quirks** - Intimate knowledge required of deprecated APIs and edge cases
35+
- **Integration friction** - Every new feature must navigate the minefield of existing code
3936

40-
#### `npm run build:local` to view in .NET App
37+
Traditional renovation means dealing with all these nuances. Each new feature requires understanding why things were done a certain way, working around old limitations, and maintaining compatibility with outdated patterns. It's like trying to add a second floor to your house whilst still living in it, technically possible, but an expensive, delicate, and compromised endeavor that's rarely done.
4138

42-
- https://localhost:5001
39+
## AI-Powered UI Transformation
4340

41+
Modern AI models have transformed UI development from a time-intensive rewrite into a rapid transformation process. By utilizing an AI-first development approach (aka Vibe Coding) we can now leverage existing codebases as detailed specifications they can use as a blueprint, telling them exactly what to build.
4442

45-
## About Next.js
43+
Something AI Models excel at is code transformations, they are remarkable at understanding the intent of code and transforming code from one framework to another, a perfect fit for rewriting legacy UIs.
4644

47-
### A statically generated blog example using Next.js, Markdown, and TypeScript
45+
#### Context is King
4846

49-
This is the existing [blog-starter](https://github.com/vercel/next.js/tree/canary/examples/blog-starter) plus TypeScript.
47+
With AI code generation, the more details and context you provide, the closer the output matches your intent. With existing code-bases there is no ambiguity, the AI gets to know exactly what features it needs to build and how they work.
5048

51-
This example showcases Next.js's [Static Generation](https://nextjs.org/docs/basic-features/pages) feature using Markdown files as the data source.
49+
### What Makes This Possible
5250

53-
The blog posts are stored in `/_posts` as Markdown files with front matter support. Adding a new Markdown file in there will create a new blog post.
51+
The key insight is that **your existing codebase is the perfect specification** as Legacy UIs already define:
5452

55-
To create the blog posts we use [`remark`](https://github.com/remarkjs/remark) and [`remark-html`](https://github.com/remarkjs/remark-html) to convert the Markdown files into an HTML string, and then send it down as a prop to the page. The metadata of every post is handled by [`gray-matter`](https://github.com/jonschlinkert/gray-matter) and also sent in props to the page.
53+
- All features and functionality
54+
- User interactions and workflows
55+
- Data structures and API contracts
56+
- Edge cases and business logic
57+
- Visual layouts and component hierarchy
5658

57-
## Preview
59+
With just an existing code-base and a detailed migration plan, AI models can translate it to modern frameworks with remarkable accuracy to 90% completion in minutes, whilst you can Vibe Code the rest to get it over the line.
5860

59-
Preview the example live on [StackBlitz](http://stackblitz.com/):
61+
### What Framework to Choose?
6062

61-
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/vercel/next.js/tree/canary/examples/blog-starter-typescript)
63+
Up until now, the framework to choose was mostly up to developers personal preferences; in our case we preferred Vue, given its readability and progressive enhancement capabilities. But with an AI-first development model, you're no longer writing the code directly, you're task becomes feeding AI Models text prompts and context on what features to implement, so it's more important to choose a framework that AI Models understand well. Currently, that's:
6264

63-
## Deploy your own
65+
### The Optimal Stack for AI Development
6466

65-
Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_medium=readme&utm_campaign=next-example):
67+
Through this process, we've identified the most effective technology stack for AI-assisted development:
6668

67-
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/blog-starter-typescript&project-name=blog-starter-typescript&repository-name=blog-starter-typescript)
69+
- **Next.js 16** - Modern React framework with excellent AI model familiarity
70+
- **React 19** - Component patterns that AI models understand deeply
71+
- **TypeScript** - Type safety that helps AI generate correct code
72+
- **Tailwind CSS v4** - Utility-first styling that AI excels at composing
6873

69-
## How to use
74+
This stack represents the sweet spot where AI models have the most training data, the clearest patterns, and the best ability to generate cohesive, loosely coupled, high-quality code, and what was used for the new [techstacks.io](https://techstacks.io).
7075

71-
Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:
76+
## A Real-World Example: TechStacks
7277

73-
```bash
74-
npx create-next-app --example blog-starter-typescript blog-starter-typescript-app
75-
# or
76-
yarn create next-app --example blog-starter-typescript blog-starter-typescript-app
78+
![](https://docs.servicestack.net/img/pages/react/replacing-legacy-uis/vuetify-home.webp)
79+
80+
![](https://docs.servicestack.net/img/pages/react/replacing-legacy-uis/react-home.webp)
81+
82+
Whilst the TechStacks C# ServiceStack backend is over a decade old, its UI has undergone multiple migrations,
83+
with the last version rewritten 7 years ago.
84+
85+
- **v1**: [Angular 1 + Bootstrap](https://github.com/ServiceStackApps/TechStacks)
86+
- **v2**: [Nuxt.js 1.4 + Vuetify 1](https://github.com/NetCoreApps/TechStacks)
87+
- **v3**: [Next.js 16 + React 19 + Tailwindcss v4](https://github.com/NetCoreApps/techstacks.io) (Vibe Coded UI / Preserved backend .NET APIs)
88+
89+
The previous migration from **Angular 1 / Bootstrap** to **Nuxt.js / Vuetify** was done over **several weeks** whilst the last AI completed migration to **React / Tailwindcss** was done within a couple of days.
90+
91+
The actual migration and Vibe coded walkthrough itself **only took a few hours**, as the majority of the time was spent moving the existing deployment from an AWS ECS / RDS setup to a much less expensive Hetzner + PostgreSQL setup, [deployed using GitHub Actions](https://github.com/NetCoreApps/techstacks.io/tree/main/.github/workflows) and [Kamal](https://kamal-deploy.org).
92+
93+
### Migration Scope
94+
95+
This wasn't a trivial update. The migration involved:
96+
97+
- **20 pages** with complex routing and dynamic content
98+
- **23 components** including complex forms and interactive elements
99+
- Complete conversion from Vuetify/Bootstrap to React 19/Tailwindcss
100+
- Migration from JavaScript to strict TypeScript
101+
- Replaced Vuetify with Tailwind CSS + [@servicestack/react](https://react.servicestack.net) components
102+
- Implementation of modern patterns (Server Components, App Router)
103+
104+
### Where to start:
105+
106+
1. **Create a detailed Migration Plan** - It's vital for big migrations (and other large code generation tasks) to have a detailed plan of what needs to be done, how it will be done, and what the end result will be.
107+
108+
### The Migration Prompt
109+
110+
As it's a vital part of AI Assisted development, most AI Tools have planning tools built-in, Since Anthropic gave out
111+
free credits to their [Claude Code on the web](https://www.claude.com/blog/claude-code-on-the-web) we used it to create
112+
the Migration plan:
113+
114+
```txt
115+
Create a detailed plan for completely rewriting this old Nuxt.js Vuetify website into a
116+
new modern beautiful Next.js 16 Web App utilizing the existing C# ServiceStack back-end.
117+
118+
The entire UI can be erased to make way for a modern, visually stunning React 19,
119+
TypeScript and Tailwindcss v4 App.
120+
121+
Use the existing Nuxt Vuetify pages to learn how to call its C# ServiceStack APIs with
122+
the TypeScript JsonServiceClient and Typed DTOs in ./TechStacks/src/shared/dtos.ts.
123+
124+
Do not generate code, only generate a comprehensive detailed plan for how to rewrite
125+
the UI layer for the existing C# back-end APIs. All Data is already available in the
126+
existing C# APIs.
127+
```
128+
129+
The result of which was the [NEXTJS_MIGRATION_PLAN.md](https://github.com/NetCoreApps/techstacks.io/blob/main/NEXTJS_MIGRATION_PLAN.md).
130+
131+
After reviewing the plan and making the necessary changes to match what you want to build it's time to execute the migration.
132+
133+
### Executing the Migration
134+
135+
We took a copy of the existing **Nuxt.js / Vuetify code-base** with the **migration plan** and instructed Claude Code to execute the migration with the prompt:
136+
137+
```
138+
Implement the NEXTJS_MIGRATION_PLAN.md
77139
```
78140

79-
Your blog should be up and running on [https://localhost:3000](https://localhost:3000)! If it doesn't work, post on [GitHub discussions](https://github.com/vercel/next.js/discussions).
141+
With access to both the Migration Plan and existing code-base, Claude Code was able to generate the entire new Next.js UI within 10-20 minutes, for less than $10 (in free credits).
142+
143+
The initial AI-generated code wasn't perfect, but it generated an excellent starting point that converted most of the existing Nuxt/Vuetify implementation into a modern Next.js App, with its preferred project structure.
144+
145+
### Vibe Code the rest
146+
147+
The most time consuming part of the migration is walking through the entire Application, in tandem with your existing App to test that everything functions as it did before. Fortunately you never need to take the reins to get it over the line, as now that we have a modern AI-friendly Next.js/React/Tailwind UI we can just use Vibe Coding to prompt the AI Models to implement any missing features or fix any issues that you find along the way.
148+
149+
If this is your first time using AI Models for all development, it can seem like unrealistic magic from the future.
150+
But not only is it possible, it's the most productive development model we've ever experienced, and is all likely to be the future of software development.
151+
152+
### Old vs New UI
153+
154+
Here's a sample set of screenshots of the old vs new UIs:
155+
156+
![](https://servicestack.net/img/posts/replacing-legacy-uis/vuetify-home.webp)
157+
![](https://servicestack.net/img/posts/replacing-legacy-uis/react-home.webp)
158+
![](https://servicestack.net/img/posts/replacing-legacy-uis/vuetify-post-edit.webp)
159+
![](https://servicestack.net/img/posts/replacing-legacy-uis/react-post-edit.webp)
160+
![](https://servicestack.net/img/posts/replacing-legacy-uis/vuetify-top.webp)
161+
![](https://servicestack.net/img/posts/replacing-legacy-uis/react-top.webp)
162+
![](https://servicestack.net/img/posts/replacing-legacy-uis/vuetify-stacks.webp)
163+
![](https://servicestack.net/img/posts/replacing-legacy-uis/react-stacks.webp)
164+
![](https://servicestack.net/img/posts/replacing-legacy-uis/vuetify-stacks-edit.webp)
165+
![](https://servicestack.net/img/posts/replacing-legacy-uis/react-stacks-edit.webp)
166+
![](https://servicestack.net/img/posts/replacing-legacy-uis/vuetify-tech.webp)
167+
![](https://servicestack.net/img/posts/replacing-legacy-uis/react-tech.webp)
168+
![](https://servicestack.net/img/posts/replacing-legacy-uis/vuetify-favorites.webp)
169+
![](https://servicestack.net/img/posts/replacing-legacy-uis/react-favorites.webp)
170+
171+
Whilst we keep the old UI around for reference, you can view both UIs side-by-side at:
172+
173+
- Old (AWS + ECS + RDS): https://vuetify.techstacks.io
174+
- New (Hetzner + PostgreSQL): https://techstacks.io
175+
176+
### Why UIs Are Perfect Candidates for Replacement
177+
178+
Unlike backend systems where "tear down and rebuild" is far riskier and requires a more methodical approach, UIs are uniquely suited for complete replacement:
179+
180+
**1. WYSIWYG Validation**
181+
The end result is immediately visible. You can see if it works correctly just by using it. No hidden business logic, no subtle data corruption bugs - it just needs to look and behave right.
182+
183+
**2. Clear API Boundaries**
184+
When your UI integrates with existing, battle-tested backend APIs, you're building on proven business logic. The API contract is your safety boundary — preventing you from accidentally introducing server-side vulnerabilities or data corruption.
185+
186+
**3. No Legacy Baggage**
187+
Start fresh without inheriting:
188+
- Workarounds for bugs in older framework versions but never updated
189+
- CSS hacks for IE11 compatibility that we no longer need
190+
- State management patterns designed before modern solutions existed
191+
- Build configurations accumulated over years of framework updates
192+
193+
**4. Better Modern Frameworks**
194+
Today's frameworks solve problems that required custom code in legacy stacks:
195+
- Server Components eliminate entire categories of client-side state management
196+
- Modern CSS (Grid, Flexbox, Container Queries) replaces brittle layout hacks
197+
- TypeScript catches errors that required runtime checks and defensive coding
198+
- Built-in optimizations (code splitting, lazy loading) that were manual before
199+
200+
**5. Separation of Concerns**
201+
The UI layer is just the presentation layer. All the critical business logic, validation, authorization, and data integrity remains safely in the backend where it's been tested and proven over years of production use.
202+
203+
### The AI-First Advantage
204+
205+
The real return on migrating isn’t the one-time rewrite, it’s the velocity that's gained afterward. After migrating to an AI‑native stack (Next.js, React, TypeScript, Tailwind), AI agents are better able to reliably implement new features asynchronously, i.e. without human intervention.
206+
207+
Changes like **"Add dark mode support"**, **"Implement infinite scrolling"** or **"Add export to CSV"** become natural‑language prompts instead of full developer-assigned tickets. Iteration cycles of most UI features get compressed down to seconds, where it now takes less time to get AI Agents to implement features than it would take to describe the feature to a developer. Code becomes a disposable resource that's become cheap to write, where complete UI rewrites, prototypes, and experiments are now feasible.
208+
209+
Most importantly, a high quality product is the result of multiple dev iterations, i.e. continuously improving on features until they work exactly as intended and AI Agents enables far greater iteration velocity than hand coded implementations, at a fraction of the cost – that's able to supercharge the productivity of existing developers.
210+
211+
This is the primary benefit of rewriting to an AI‑native stack: creating a new foundation that enables **"Vibe Coding"** - where UI changes are described by text prompts and implemented by AI Agents.
212+
213+
Work that once took hours of human effort can now be done using AI Agents in minutes, with the migration typically paying for itself within the first few features.
214+
215+
## Looking Forward
216+
217+
We're at the beginning of a fundamental shift in how we approach software development. AI Assistance has become a mandatory tool for developers, amplifying their capabilities and automating away tedious, repetitive work.
218+
AI models are only going to get better at understanding codebases and generating accurate implementations. The frameworks and patterns that work best with AI will become the new standard.
219+
220+
For organizations with legacy applications, it means **modernization is now economically viable**. Barriers that made UI rewrites prohibitively expensive have eroded. What was once a multi-month project requiring dedicated teams is now achievable in days with AI assistance.
80221

81-
Deploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).
222+
## From .NET APIs to AI First UIs
82223

83-
# Notes
224+
The unprecedented productivity of AI Assisted development has transformed our roadmap which is now firmly centered on developing the ideal .NET AI‑first development stack, powered by a growing suite of React / TypeScript / Tailwind CSS templates and components, the ultimate UX of hot-reloading npm UIs and built on our highly capable & performant .NET backend APIs.
84225

85-
This blog-starter-typescript uses [Tailwind CSS](https://tailwindcss.com). To control the generated stylesheet's filesize, this example uses Tailwind CSS' v2.0 [`purge` option](https://tailwindcss.com/docs/controlling-file-size/#removing-unused-css) to remove unused CSS.
226+
## [react-templates.net](https://react-templates.net)
86227

87-
[Tailwind CSS v2.0 no longer supports Node.js 8 or 10](https://tailwindcss.com/docs/upgrading-to-v2#upgrade-to-node-js-12-13-or-higher). To build your CSS you'll need to ensure you are running Node.js 12.13.0 or higher in both your local and CI environments.
228+
[Templates](https://react-templates.net) for the next generation of AI-assisted web applications.

0 commit comments

Comments
 (0)