Skip to content

Commit 2a71248

Browse files
committed
Add v32 VueNuxt template
1 parent 1451d39 commit 2a71248

61 files changed

Lines changed: 32040 additions & 11 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*/node_modules
2+
*/npm-debug.log

Dockerfile

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,19 @@
11
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
2-
WORKDIR /source
2+
WORKDIR /app
33

44
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - \
55
&& apt-get install -y --no-install-recommends nodejs \
66
&& echo "node version: $(node --version)" \
77
&& echo "npm version: $(npm --version)" \
88
&& rm -rf /var/lib/apt/lists/*
99

10-
COPY VueNuxtTemplate/package.json .
11-
COPY VueNuxtTemplate/npm-shrinkwrap.json .
12-
13-
RUN npm --prefix VueNuxtTemplate install
14-
1510
COPY . .
1611
RUN dotnet restore
1712

18-
WORKDIR /source/VueNuxtTemplate
19-
RUN dotnet publish -c release -o /app --no-restore
13+
WORKDIR /app/VueNuxt
14+
RUN dotnet publish -c release -o /out --no-restore
2015

2116
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS runtime
2217
WORKDIR /app
23-
COPY --from=build /app ./
24-
ENTRYPOINT ["dotnet", "VueNuxtTemplate.dll"]
18+
COPY --from=build /out ./
19+
ENTRYPOINT ["dotnet", "VueNuxt.dll"]

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010

1111
$ x new vue-nuxt ProjectName
1212

13+
Alternatively write new project files directly into an empty repository, using the Directory Name as the ProjectName:
14+
15+
$ git clone https://github.com/<User>/<ProjectName>.git
16+
$ cd <ProjectName>
17+
$ x new vue-nuxt
18+
1319
## Description
1420

1521
Nuxt is an opinionated structured framework for rapidly developing Web Applications utilizing developer-friendly [Vue Single Page Components](https://vuejs.org/v2/guide/single-file-components.html) and featuring Hot module replacement that together with [.NET Core's watched builds](https://docs.servicestack.net/templates-websites#watched-net-core-builds) provides an highly productive development experience.
@@ -45,7 +51,7 @@ Whilst Nuxt.js is a JavaScript (ES 6/7) App it still benefits from [ServiceStack
4551
$ npm run dtos
4652

4753
This will update the Servers `dtos.ts` and generate its corresponding `dtos.js` which can be imported as normal classes as seen in
48-
[gateway.js](https://github.com/NetCoreTemplates/vue-nuxt/blob/master/VueNuxtTemplate/src/shared/gateway.js#L3). Despite the App not being built with TypeScript, developing using a "TypeScript-aware" IDE like VS Code will still be able to utilize the TypeScript classes in [@servicestack/client](https://github.com/ServiceStack/servicestack-client) and the generated `dtos.ts` to provide a rich, typed intelli-sense experience.
54+
[gateway.js](https://github.com/NetCoreTemplates/vue-nuxt/blob/master/VueNuxt/src/shared/gateway.js#L3). Despite the App not being built with TypeScript, developing using a "TypeScript-aware" IDE like VS Code will still be able to utilize the TypeScript classes in [@servicestack/client](https://github.com/ServiceStack/servicestack-client) and the generated `dtos.ts` to provide a rich, typed intelli-sense experience.
4955

5056
## Generate Static Production Build
5157

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using ServiceStack;
4+
using VueNuxt.ServiceModel;
5+
6+
namespace VueNuxt.ServiceInterface
7+
{
8+
public class MyServices : Service
9+
{
10+
public object Any(Hello request)
11+
{
12+
return new HelloResponse { Result = $"Hello, {request.Name}!" };
13+
}
14+
15+
public object Any(GetLinks request) => new GetLinksResponse
16+
{
17+
Results = new Dictionary<string, string>
18+
{
19+
{"servicestack.net", "https://servicestack.net"},
20+
{"StackOverflow", "http://stackoverflow.com/search?q=servicestack"},
21+
{"Customer Forums", "https://forums.servicestack.net"},
22+
{"Issue Tracker", "https://github.com/ServiceStack/Issues"},
23+
{"Feature Requests", "http://servicestack.uservoice.com/forums/176786-feature-requests"},
24+
{"Release Notes", "https://servicestack.net/release-notes"},
25+
{"Live Demos", "https://github.com/ServiceStackApps/LiveDemos"},
26+
{".NET Core Live Demos", "https://github.com/NetCoreApps/LiveDemos"},
27+
{"Gistlyn", "http://gistlyn.com"},
28+
}
29+
};
30+
31+
public object Any(GetPost request) => new GetPostResponse
32+
{
33+
Id = request.Id,
34+
Title = $"Title {request.Id}",
35+
Description = $"Post Description {request.Id}",
36+
};
37+
}
38+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net5</TargetFramework>
5+
</PropertyGroup>
6+
7+
<ItemGroup>
8+
<PackageReference Include="ServiceStack" Version="5.*" />
9+
</ItemGroup>
10+
11+
<ItemGroup>
12+
<ProjectReference Include="..\VueNuxt.ServiceModel\VueNuxt.ServiceModel.csproj" />
13+
</ItemGroup>
14+
15+
</Project>

VueNuxt.ServiceModel/GetLinks.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using System.Collections.Generic;
2+
using ServiceStack;
3+
4+
namespace VueNuxt.ServiceModel
5+
{
6+
[Route("/links")]
7+
public class GetLinks : IReturn<GetLinksResponse> {}
8+
9+
public class GetLinksResponse
10+
{
11+
public Dictionary<string,string> Results { get; set; }
12+
}
13+
}

VueNuxt.ServiceModel/GetPost.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using System.Collections.Generic;
2+
using ServiceStack;
3+
4+
namespace VueNuxt.ServiceModel
5+
{
6+
[Route("/posts")]
7+
public class GetPost : IReturn<GetPostResponse>
8+
{
9+
public int Id { get; set; }
10+
}
11+
12+
public class GetPostResponse
13+
{
14+
public int Id { get; set; }
15+
public string Title { get; set; }
16+
public string Description { get; set; }
17+
}
18+
}

VueNuxt.ServiceModel/Hello.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using ServiceStack;
2+
3+
namespace VueNuxt.ServiceModel
4+
{
5+
[Route("/hello")]
6+
[Route("/hello/{Name}")]
7+
public class Hello : IReturn<HelloResponse>
8+
{
9+
public string Name { get; set; }
10+
}
11+
12+
public class HelloResponse
13+
{
14+
public string Result { get; set; }
15+
}
16+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
As part of our [Physical Project Structure](https://docs.servicestack.net/physical-project-structure) convention we recommend maintaining any shared non Request/Response DTOs in the `ServiceModel.Types` namespace.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netstandard2.0</TargetFramework>
5+
</PropertyGroup>
6+
7+
<ItemGroup>
8+
<PackageReference Include="ServiceStack.Interfaces" Version="5.*" />
9+
</ItemGroup>
10+
11+
<ItemGroup>
12+
<Folder Include="Types\" />
13+
</ItemGroup>
14+
15+
</Project>

0 commit comments

Comments
 (0)