Skip to content

Commit 458a663

Browse files
authored
Add recipe list feature and update dependencies (#727)
1 parent 02ccbc9 commit 458a663

17 files changed

Lines changed: 235 additions & 137 deletions

File tree

Menu.ApiServiceDefaults/Menu.ApiServiceDefaults.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Swashbuckle.AspNetCore" Version="9.0.3" />
10+
<PackageReference Include="Swashbuckle.AspNetCore" Version="9.0.4" />
1111
</ItemGroup>
1212

1313
<ItemGroup>

Menu.AppHost/Menu.AppHost.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<Sdk Name="Aspire.AppHost.Sdk" Version="9.4.0" />
3+
<Sdk Name="Aspire.AppHost.Sdk" Version="9.4.2" />
44

55
<PropertyGroup>
66
<OutputType>Exe</OutputType>

Menu.AppHost/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
.WithParentRelationship(sql);
1515

1616
var menuApi = builder.AddProject<Projects.MenuApi>("apiservice")
17-
.WithHttpEndpoint()
17+
.WithHttpEndpoint(port: 65273)
1818
.WithReference(sql)
1919
.WaitForCompletion(menuDB)
2020
.WithEnvironment("Auth0Domain", auth0Domain)
@@ -24,7 +24,7 @@
2424
.WithReference(menuApi)
2525
.WithEnvironment("VITE_MENU_API_URL", menuApi.GetEndpoint("http"))
2626
.WaitFor(menuApi)
27-
.WithHttpEndpoint(env: "PORT", port: 65276)
27+
.WithHttpEndpoint(env: "PORT", port: 65276, targetPort: 5173)
2828
.WithPnpmPackageInstallation()
2929
.PublishAsDockerFile();
3030

Menu.AppHost/appsettings.Development.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,5 @@
44
"Default": "Information",
55
"Microsoft.AspNetCore": "Warning"
66
}
7-
},
8-
"Parameters": {
9-
"Auth0Domain": "dev-oz81ytsjd1h4r1lz.uk.auth0.com",
10-
"Auth0Audience": "http://localhost:65273"
117
}
128
}

Menu.ServiceDefaults/Menu.ServiceDefaults.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<FrameworkReference Include="Microsoft.AspNetCore.App" />
1212

1313
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="9.8.0" />
14-
<PackageReference Include="Microsoft.Extensions.ServiceDiscovery" Version="9.4.1" />
14+
<PackageReference Include="Microsoft.Extensions.ServiceDiscovery" Version="9.4.2" />
1515
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.12.0" />
1616
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.12.0" />
1717
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.12.0" />

MenuApi/MenuApi.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,17 @@
3030
</ItemGroup>
3131

3232
<ItemGroup>
33-
<PackageReference Include="Aspire.Microsoft.Data.SqlClient" Version="9.3.0" />
33+
<PackageReference Include="Aspire.Microsoft.Data.SqlClient" Version="9.4.2" />
3434
<PackageReference Include="Dapper" Version="2.1.66" />
3535
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.23.0" />
36-
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.5" />
37-
<PackageReference Include="Microsoft.Extensions.ApiDescription.Server" Version="9.0.5">
36+
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.8" />
37+
<PackageReference Include="Microsoft.Extensions.ApiDescription.Server" Version="9.0.8">
3838
<PrivateAssets>all</PrivateAssets>
3939
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
4040
</PackageReference>
41-
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.21.2" />
41+
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.22.1" />
4242
<PackageReference Include="Riok.Mapperly" Version="4.2.1" />
43-
<PackageReference Include="Vogen" Version="7.0.4" />
43+
<PackageReference Include="Vogen" Version="8.0.1" />
4444
</ItemGroup>
4545

4646
<ItemGroup>

MenuApi/Program.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,22 @@
4141
});
4242
builder.Services.AddAuthorizationBuilder();
4343

44+
// Add CORS policy before building the app
45+
builder.Services.AddCors(options =>
46+
{
47+
options.AddPolicy("AllowAll", policy =>
48+
{
49+
policy.AllowAnyOrigin()
50+
.AllowAnyHeader()
51+
.AllowAnyMethod();
52+
});
53+
});
54+
4455
var app = builder.Build();
56+
57+
// Use CORS middleware before authentication/authorization
58+
app.UseCors("AllowAll");
59+
4560
app.UseAuthentication();
4661
app.UseAuthorization();
4762

ui/menu-website/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"build": "run-p type-check \"build-only {@}\" --",
1111
"build-only": "vite build",
1212
"dev": "vite",
13-
"aspire": "vite",
13+
"aspire": "vite --port 5173",
1414
"format": "prettier --write \"**/*.{js,ts,vue,scss,html,md,json}\" --ignore-path .gitignore",
1515
"lint": "eslint . \"./src/**/*.{ts,js,cjs,mjs,vue}\"",
1616
"lint-fix": "eslint . \"./src/**/*.{ts,js,cjs,mjs,vue}\" --fix",
@@ -78,5 +78,5 @@
7878
"npm": ">= 6.13.4",
7979
"yarn": ">= 1.21.1"
8080
},
81-
"packageManager": "pnpm@10.13.1+sha512.37ebf1a5c7a30d5fabe0c5df44ee8da4c965ca0c5af3dbab28c3a1681b70a256218d05c81c9c0dcf767ef6b8551eb5b960042b9ed4300c59242336377e01cfad"
81+
"packageManager": "pnpm@10.17.0+sha512.fce8a3dd29a4ed2ec566fb53efbb04d8c44a0f05bc6f24a73046910fb9c3ce7afa35a0980500668fa3573345bd644644fa98338fa168235c80f4aa17aa17fbef"
8282
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<script setup lang="ts">
2+
import { useRouter } from 'vue-router';
3+
4+
const router = useRouter();
5+
6+
const goToRecipesPage = async () => {
7+
await router.push('/recipes');
8+
};
9+
</script>
10+
11+
<template>
12+
<q-btn flat @click="goToRecipesPage">Recipes</q-btn>
13+
</template>
14+
15+
<style scoped></style>

ui/menu-website/src/layouts/MainLayout.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<q-header elevated>
44
<q-toolbar>
55
<q-toolbar-title> Menu</q-toolbar-title>
6+
<recipe-list-button />
67
<new-recipe-header-button v-if="isAuthenticated" />
78
<profile-button v-if="isAuthenticated" />
89
<logout-button v-if="isAuthenticated" />
@@ -22,6 +23,7 @@ import { useAuth } from '@/services/auth';
2223
import LoginButton from '@/components/buttons/LoginButton.vue';
2324
import ProfileButton from '@/components/buttons/ProfileButton.vue';
2425
import NewRecipeHeaderButton from '@/components/buttons/NewRecipeHeaderButton.vue';
26+
import RecipeListButton from '@/components/buttons/RecipeListButton.vue';
2527
2628
const { isAuthenticated } = useAuth();
2729
</script>

0 commit comments

Comments
 (0)