Skip to content

Commit cc975e0

Browse files
committed
Replace AI Server with React
1 parent dc24b33 commit cc975e0

File tree

9 files changed

+868
-218
lines changed

9 files changed

+868
-218
lines changed

MyApp/Pages/React/Index.cshtml

Lines changed: 508 additions & 0 deletions
Large diffs are not rendered by default.

MyApp/Pages/React/Page.cshtml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
@page "/react/{Slug}"
2+
@model MyApp.Page
3+
@inject MarkdownPages Markdown
4+
@implements IRenderStatic<MyApp.Page>
5+
6+
@functions {
7+
public List<Page> GetStaticProps(RenderContext ctx) =>
8+
ctx.Resolve<MarkdownPages>().GetVisiblePages("react").Map(page => new Page { Slug = page.Slug.RightPart('/') });
9+
}
10+
11+
@await Html.PartialAsync("DocsPage", new Shared.DocsPage {
12+
Brand = "ServiceStack React",
13+
Slug = Model.Slug,
14+
Folder = "react",
15+
DefaultMenu = new MarkdownMenu {
16+
Icon = Markdown.DefaultMenuIcon,
17+
Text = "React",
18+
Link = "/react/",
19+
},
20+
}.Init(this, Markdown))
21+
22+
<script type="module">
23+
import { setMetadata } from "/pages/vue/data.mjs"
24+
setMetadata()
25+
</script>

MyApp/Pages/Shared/Header.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
{
44
("/templates/", "Project Templates"),
55
("/vue/", "Vue"),
6+
("/react/", "React"),
67
("/autoquery/", "AutoQuery"),
78
("/auth/", "Auth"),
89
("/ormlite/", "OrmLite"),
910
("/redis/", "Redis"),
1011
("/locode/", "Locode"),
1112
("/grpc/", "gRPC"),
12-
("/ai-server/", "AI Server")
1313
};
1414
}
1515
<header id="header" class="top-0 fixed z-50 h-14 bg-white/90 dark:bg-black/90 w-full shadow">

MyApp/_pages/react/install.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
title: Install React
3+
---

MyApp/_pages/react/sidebar.json

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
[
2+
{
3+
"text": "React",
4+
"link": "/react",
5+
"children": [
6+
{
7+
"text": "Install",
8+
"link": "https://react.servicestack.net/gallery/install"
9+
}
10+
]
11+
},
12+
{
13+
"text": "Component Gallery",
14+
"children": [
15+
{
16+
"text": "AutoQueryGrid",
17+
"link": "https://react.servicestack.net/gallery/autoquerygrid"
18+
},
19+
{
20+
"text": "DataGrid",
21+
"link": "https://react.servicestack.net/gallery/datagrid"
22+
},
23+
{
24+
"text": "Auto Forms",
25+
"link": "https://react.servicestack.net/gallery/autoform"
26+
},
27+
{
28+
"text": "Custom Auto Forms",
29+
"link": "https://react.servicestack.net/gallery/custom-autoforms"
30+
},
31+
{
32+
"text": "Form Inputs",
33+
"link": "https://react.servicestack.net/gallery/form-inputs"
34+
},
35+
{
36+
"text": "FileInput",
37+
"link": "https://react.servicestack.net/gallery/fileinput"
38+
},
39+
{
40+
"text": "TagInput",
41+
"link": "https://react.servicestack.net/gallery/taginput"
42+
},
43+
{
44+
"text": "Combobox",
45+
"link": "https://react.servicestack.net/gallery/combobox"
46+
},
47+
{
48+
"text": "Autocomplete",
49+
"link": "https://react.servicestack.net/gallery/autocomplete"
50+
},
51+
{
52+
"text": "Markdown Editor",
53+
"link": "https://react.servicestack.net/gallery/markdown"
54+
},
55+
{
56+
"text": "Custom Inputs",
57+
"link": "https://react.servicestack.net/gallery/custom-inputs"
58+
},
59+
{
60+
"text": "Modals",
61+
"link": "https://react.servicestack.net/gallery/modals"
62+
},
63+
{
64+
"text": "Navigation",
65+
"link": "https://react.servicestack.net/gallery/navigation"
66+
},
67+
{
68+
"text": "Alerts",
69+
"link": "https://react.servicestack.net/gallery/alerts"
70+
},
71+
{
72+
"text": "Formats",
73+
"link": "https://react.servicestack.net/gallery/formats"
74+
}
75+
]
76+
},
77+
{
78+
"text": "Library",
79+
"children": [
80+
{
81+
"text": "useMetadata",
82+
"link": "https://react.servicestack.net/gallery/use-metadata"
83+
},
84+
{
85+
"text": "useClient",
86+
"link": "https://react.servicestack.net/gallery/use-client"
87+
},
88+
{
89+
"text": "useAuth",
90+
"link": "https://react.servicestack.net/gallery/use-auth"
91+
},
92+
{
93+
"text": "useFormatters",
94+
"link": "https://react.servicestack.net/gallery/use-formatters"
95+
},
96+
{
97+
"text": "useFiles",
98+
"link": "https://react.servicestack.net/gallery/use-files"
99+
},
100+
{
101+
"text": "useConfig",
102+
"link": "https://react.servicestack.net/gallery/use-config"
103+
},
104+
{
105+
"text": "useUtils",
106+
"link": "https://react.servicestack.net/gallery/use-utils"
107+
}
108+
]
109+
}
110+
]

MyApp/wwwroot/pages/components/Icons.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ export default {
55
Windows: '<svg class="w-12 h-12 text-indigo-600" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M11.5 3v8.5H3V3h8.5zm0 18H3v-8.5h8.5V21zm1-18H21v8.5h-8.5V3zm8.5 9.5V21h-8.5v-8.5H21z"></path></svg>',
66
Vue: '<svg class="w-12 h-12 text-indigo-600" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M2 3h3.5L12 15l6.5-12H22L12 21L2 3m4.5 0h3L12 7.58L14.5 3h3L12 13.08L6.5 3Z"></path></svg>',
77
Nextjs: '<svg class="w-12 h-12 text-indigo-600" xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15"><path fill="currentColor" fill-rule="evenodd" d="M0 7.5a7.5 7.5 0 1 1 11.697 6.216L4.907 4.21A.5.5 0 0 0 4 4.5V12h1V6.06l5.83 8.162A7.5 7.5 0 0 1 0 7.5ZM10 10V4h1v6h-1Z" clip-rule="evenodd"></path></svg>',
8+
NextjsNative: '<svg class="w-12 h-12 bg-white text-gray-900 rounded-full" xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><path fill="currentColor" d="M386.399 35.508C217.06-64.061 1.885 57.55.012 253.882c-1.828 191.716 201.063 315.545 370.02 231.163L185.56 213.636v167.997c0 18.614-35.619 18.614-35.619 0V156.421c0-14.776 27.448-15.989 35.226-3.145L395.43 470.572c157.95-101.737 155.817-338.136-9.031-435.064zm-23.756 317.939L326.91 298.87V149.458c0-13.932 35.732-13.932 35.732 0v203.989z"></path></svg>',
89
React: '<svg class="w-12 h-12 text-indigo-600" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12 10.11c1.03 0 1.87.84 1.87 1.89c0 1-.84 1.85-1.87 1.85c-1.03 0-1.87-.85-1.87-1.85c0-1.05.84-1.89 1.87-1.89M7.37 20c.63.38 2.01-.2 3.6-1.7c-.52-.59-1.03-1.23-1.51-1.9a22.7 22.7 0 0 1-2.4-.36c-.51 2.14-.32 3.61.31 3.96m.71-5.74l-.29-.51c-.11.29-.22.58-.29.86c.27.06.57.11.88.16l-.3-.51m6.54-.76l.81-1.5l-.81-1.5c-.3-.53-.62-1-.91-1.47C13.17 9 12.6 9 12 9c-.6 0-1.17 0-1.71.03c-.29.47-.61.94-.91 1.47L8.57 12l.81 1.5c.3.53.62 1 .91 1.47c.54.03 1.11.03 1.71.03c.6 0 1.17 0 1.71-.03c.29-.47.61-.94.91-1.47M12 6.78c-.19.22-.39.45-.59.72h1.18c-.2-.27-.4-.5-.59-.72m0 10.44c.19-.22.39-.45.59-.72h-1.18c.2.27.4.5.59.72M16.62 4c-.62-.38-2 .2-3.59 1.7c.52.59 1.03 1.23 1.51 1.9c.82.08 1.63.2 2.4.36c.51-2.14.32-3.61-.32-3.96m-.7 5.74l.29.51c.11-.29.22-.58.29-.86c-.27-.06-.57-.11-.88-.16l.3.51m1.45-7.05c1.47.84 1.63 3.05 1.01 5.63c2.54.75 4.37 1.99 4.37 3.68c0 1.69-1.83 2.93-4.37 3.68c.62 2.58.46 4.79-1.01 5.63c-1.46.84-3.45-.12-5.37-1.95c-1.92 1.83-3.91 2.79-5.38 1.95c-1.46-.84-1.62-3.05-1-5.63c-2.54-.75-4.37-1.99-4.37-3.68c0-1.69 1.83-2.93 4.37-3.68c-.62-2.58-.46-4.79 1-5.63c1.47-.84 3.46.12 5.38 1.95c1.92-1.83 3.91-2.79 5.37-1.95M17.08 12c.34.75.64 1.5.89 2.26c2.1-.63 3.28-1.53 3.28-2.26c0-.73-1.18-1.63-3.28-2.26c-.25.76-.55 1.51-.89 2.26M6.92 12c-.34-.75-.64-1.5-.89-2.26c-2.1.63-3.28 1.53-3.28 2.26c0 .73 1.18 1.63 3.28 2.26c.25-.76.55-1.51.89-2.26m9 2.26l-.3.51c.31-.05.61-.1.88-.16c-.07-.28-.18-.57-.29-.86l-.29.51m-2.89 4.04c1.59 1.5 2.97 2.08 3.59 1.7c.64-.35.83-1.82.32-3.96c-.77.16-1.58.28-2.4.36c-.48.67-.99 1.31-1.51 1.9M8.08 9.74l.3-.51c-.31.05-.61.1-.88.16c.07.28.18.57.29.86l.29-.51m2.89-4.04C9.38 4.2 8 3.62 7.37 4c-.63.35-.82 1.82-.31 3.96a22.7 22.7 0 0 1 2.4-.36c.48-.67.99-1.31 1.51-1.9Z"></path></svg>',
10+
ReactNative: '<svg class="w-12 h-12" xmlns="http://www.w3.org/2000/svg" viewBox="-10.5 -9.45 21 18.9" fill="none"><circle cx="0" cy="0" r="2" fill="currentColor"></circle><g stroke="currentColor" stroke-width="1" fill="none"><ellipse rx="10" ry="4.5"></ellipse><ellipse rx="10" ry="4.5" transform="rotate(60)"></ellipse><ellipse rx="10" ry="4.5" transform="rotate(120)"></ellipse></g></svg>',
911
Angular: '<svg class="w-12 h-12 text-indigo-600" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="m12 2.5l8.84 3.15l-1.34 11.7L12 21.5l-7.5-4.15l-1.34-11.7L12 2.5m0 2.1L6.47 17h2.06l1.11-2.78h4.7L15.45 17h2.05L12 4.6m1.62 7.9h-3.23L12 8.63l1.62 3.87Z"></path></svg>',
1012
Svelte: '<svg class="w-12 h-12 text-indigo-600" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m15 8l-5 3l.821-.495c1.86-1.15 4.412-.49 5.574 1.352a3.91 3.91 0 0 1-1.264 5.42l-5.053 3.126c-1.86 1.151-4.312.591-5.474-1.251a3.91 3.91 0 0 1 1.263-5.42l.26-.16"></path><path d="m8 17l5-3l-.822.496c-1.86 1.151-4.411.491-5.574-1.351a3.91 3.91 0 0 1 1.264-5.42l5.054-3.127c1.86-1.15 4.311-.59 5.474 1.252a3.91 3.91 0 0 1-1.264 5.42l-.26.16"></path></g></svg>',
1113
Compose: '<svg class="w-12 h-12 text-indigo-600" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><path fill="currentColor" d="M12.135.003a2.577 2.577 0 0 0-1.42.344L2.55 5.06a2.577 2.577 0 0 0-.953.967l3.957 2.17a1.765 1.765 0 0 1 .603-.588l4.951-2.86a1.761 1.761 0 0 1 1.76 0l4.951 2.86a1.753 1.753 0 0 1 .526.46l3.921-2.265a2.577 2.577 0 0 0-.816-.744L13.291.347a2.577 2.577 0 0 0-1.152-.34Zm-.145 4.912a1.36 1.36 0 0 0-.68.182L6.36 7.953a1.345 1.345 0 0 0-.454.435l1.92 1.055a1.05 1.05 0 0 1 .31-.275l3.34-1.928a1.054 1.054 0 0 1 1.051 0l3.336 1.928a1.066 1.066 0 0 1 .238.199l.018-.01l-.002-.002l1.877-1.08a1.353 1.353 0 0 0-.373-.322l-4.95-2.86a1.357 1.357 0 0 0-.68-.178Zm10.432 1.149l-3.92 2.26a1.757 1.757 0 0 1 .2.812v5.715c0 .627-.332 1.21-.88 1.528l-4.95 2.86a1.761 1.761 0 0 1-.64.214v4.524a2.577 2.577 0 0 0 1.059-.313l8.162-4.713a2.577 2.577 0 0 0 1.289-2.23V7.297a2.577 2.577 0 0 0-.318-1.228Zm-20.937.238a2.577 2.577 0 0 0-.227.99v9.43c0 .918.491 1.767 1.293 2.229l8.162 4.713a2.57 2.57 0 0 0 1.225.336v-4.531a1.761 1.761 0 0 1-.833-.235L6.156 16.38a1.765 1.765 0 0 1-.877-1.528V9.136a1.776 1.776 0 0 1 .131-.676Zm16.67 2.223l-1.89 1.092a1.058 1.058 0 0 1 .124.46v3.856c0 .378-.2.72-.526.907l-3.336 1.93a1.04 1.04 0 0 1-.295.107v2.17c.152-.027.304-.078.44-.157l4.949-2.859a1.36 1.36 0 0 0 .68-1.18V9.136a1.36 1.36 0 0 0-.147-.607Zm-12.387.13a1.36 1.36 0 0 0-.088.481v5.715a1.36 1.36 0 0 0 .68 1.18l4.95 2.86c.194.112.412.166.627.177v-2.174a1.054 1.054 0 0 1-.46-.123L8.14 14.843a1.054 1.054 0 0 1-.532-.908v-3.853a.99.99 0 0 1 .077-.38l-.034-.013z"/></svg>',
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
import Templates, { Index } from "./Templates.mjs"
2+
3+
export default {
4+
components: { Templates },
5+
template:`
6+
<div class="mb-24 not-prose">
7+
<!-- Simple header -->
8+
<div class="mb-8">
9+
<h2 class="text-3xl font-bold tracking-tight text-gray-900 sm:text-4xl flex justify-between items-center">
10+
<div>{{ Index[name].name }}</div>
11+
<a class="group inline-flex items-center gap-2 px-4 py-2 rounded-lg bg-gray-900 hover:bg-gray-800 text-white text-sm font-medium transition-all duration-200 shadow-lg hover:shadow-xl transform hover:scale-105"
12+
:href="'https://github.com/NetCoreTemplates/' + name">
13+
<svg class="size-5 group-hover:rotate-12 transition-transform duration-200" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M12 2A10 10 0 0 0 2 12c0 4.42 2.87 8.17 6.84 9.5c.5.08.66-.23.66-.5v-1.69c-2.77.6-3.36-1.34-3.36-1.34c-.46-1.16-1.11-1.47-1.11-1.47c-.91-.62.07-.6.07-.6c1 .07 1.53 1.03 1.53 1.03c.87 1.52 2.34 1.07 2.91.83c.09-.65.35-1.09.63-1.34c-2.22-.25-4.55-1.11-4.55-4.92c0-1.11.38-2 1.03-2.71c-.1-.25-.45-1.29.1-2.64c0 0 .84-.27 2.75 1.02c.79-.22 1.65-.33 2.5-.33s1.71.11 2.5.33c1.91-1.29 2.75-1.02 2.75-1.02c.55 1.35.2 2.39.1 2.64c.65.71 1.03 1.6 1.03 2.71c0 3.82-2.34 4.66-4.57 4.91c.36.31.69.92.69 1.85V21c0 .27.16.59.67.5C19.14 20.16 22 16.42 22 12A10 10 0 0 0 12 2"/></svg>
14+
Source Code
15+
</a>
16+
</h2>
17+
<p class="mt-3 text-xl text-gray-600 dark:text-gray-400 mb-8">
18+
{{ description }}
19+
</p>
20+
</div>
21+
22+
<!-- Templates section with enhanced styling -->
23+
<div class="my-10 transform transition-all duration-300 hover:scale-[1.02]">
24+
<Templates :templates="[Index[name]]" />
25+
</div>
26+
27+
<!-- Screenshots with enhanced hover effects and layout -->
28+
<div class="flex flex-col lg:flex-row justify-center items-center gap-8 lg:gap-10 my-10">
29+
<!-- light screenshot -->
30+
<a class="group relative overflow-hidden rounded-2xl shadow-2xl hover:shadow-3xl transition-all duration-300 transform hover:scale-105 hover:-rotate-1"
31+
:href="'https://' + name + '.web-templates.io'">
32+
<div class="absolute inset-0 bg-gradient-to-tr from-blue-400 to-purple-500 opacity-0 group-hover:opacity-20 transition-opacity duration-300"></div>
33+
<img class="w-80 h-80 md:w-96 md:h-96 object-cover ring-4 ring-gray-200 group-hover:ring-indigo-400 transition-all duration-300"
34+
:src="'/img/pages/react/' + name + '.webp'"
35+
:alt="Index[name].name + ' light theme'">
36+
<div class="absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-6 opacity-0 group-hover:opacity-100 transition-opacity duration-300">
37+
<p class="text-white text-base font-semibold">Light Theme</p>
38+
</div>
39+
</a>
40+
41+
<!-- dark screenshot -->
42+
<a class="group relative overflow-hidden rounded-2xl shadow-2xl hover:shadow-3xl transition-all duration-300 transform hover:scale-105 hover:rotate-1"
43+
:href="'https://' + name + '.web-templates.io'">
44+
<div class="absolute inset-0 bg-gradient-to-tr from-purple-500 to-pink-400 opacity-0 group-hover:opacity-20 transition-opacity duration-300"></div>
45+
<img class="w-80 h-80 md:w-96 md:h-96 object-cover ring-4 ring-gray-200 group-hover:ring-purple-400 transition-all duration-300"
46+
:src="'/img/pages/react/' + name + '-dark.webp'"
47+
:alt="Index[name].name + ' dark theme'">
48+
<div class="absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-6 opacity-0 group-hover:opacity-100 transition-opacity duration-300">
49+
<p class="text-white text-base font-semibold">Dark Theme</p>
50+
</div>
51+
</a>
52+
</div>
53+
</div>
54+
`,
55+
props: {
56+
name:String,
57+
description:String
58+
},
59+
setup() {
60+
return { Index }
61+
}
62+
}

0 commit comments

Comments
 (0)