diff --git a/QuickDish.sln b/QuickDish.sln new file mode 100644 index 0000000..23c0569 --- /dev/null +++ b/QuickDish.sln @@ -0,0 +1,55 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31903.59 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{BEDF4556-0366-45BC-B0F3-9FF4EB11B9CB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QuickDish.Domain", "src\QuickDish.Domain\QuickDish.Domain.csproj", "{63C229FA-5E13-457A-868E-25B0C9C58AA6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QuickDish.Application", "src\QuickDish.Application\QuickDish.Application.csproj", "{A53CDB6D-8EAD-4C1D-A175-A64C90CF4B6B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QuickDish.Infrastructure", "src\QuickDish.Infrastructure\QuickDish.Infrastructure.csproj", "{86A26505-418B-49A8-99B6-52DE52C1B2F4}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QuickDish.Api", "src\QuickDish.Api\QuickDish.Api.csproj", "{21F9F0FA-71DD-42ED-AAB4-88AF11F8B6AB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QuickDish.Client", "src\QuickDish.Client\QuickDish.Client.csproj", "{AAEC702A-326A-40B8-9E02-04767A66D084}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {63C229FA-5E13-457A-868E-25B0C9C58AA6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {63C229FA-5E13-457A-868E-25B0C9C58AA6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {63C229FA-5E13-457A-868E-25B0C9C58AA6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {63C229FA-5E13-457A-868E-25B0C9C58AA6}.Release|Any CPU.Build.0 = Release|Any CPU + {A53CDB6D-8EAD-4C1D-A175-A64C90CF4B6B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A53CDB6D-8EAD-4C1D-A175-A64C90CF4B6B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A53CDB6D-8EAD-4C1D-A175-A64C90CF4B6B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A53CDB6D-8EAD-4C1D-A175-A64C90CF4B6B}.Release|Any CPU.Build.0 = Release|Any CPU + {86A26505-418B-49A8-99B6-52DE52C1B2F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {86A26505-418B-49A8-99B6-52DE52C1B2F4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {86A26505-418B-49A8-99B6-52DE52C1B2F4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {86A26505-418B-49A8-99B6-52DE52C1B2F4}.Release|Any CPU.Build.0 = Release|Any CPU + {21F9F0FA-71DD-42ED-AAB4-88AF11F8B6AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {21F9F0FA-71DD-42ED-AAB4-88AF11F8B6AB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {21F9F0FA-71DD-42ED-AAB4-88AF11F8B6AB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {21F9F0FA-71DD-42ED-AAB4-88AF11F8B6AB}.Release|Any CPU.Build.0 = Release|Any CPU + {AAEC702A-326A-40B8-9E02-04767A66D084}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AAEC702A-326A-40B8-9E02-04767A66D084}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AAEC702A-326A-40B8-9E02-04767A66D084}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AAEC702A-326A-40B8-9E02-04767A66D084}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {63C229FA-5E13-457A-868E-25B0C9C58AA6} = {BEDF4556-0366-45BC-B0F3-9FF4EB11B9CB} + {A53CDB6D-8EAD-4C1D-A175-A64C90CF4B6B} = {BEDF4556-0366-45BC-B0F3-9FF4EB11B9CB} + {86A26505-418B-49A8-99B6-52DE52C1B2F4} = {BEDF4556-0366-45BC-B0F3-9FF4EB11B9CB} + {21F9F0FA-71DD-42ED-AAB4-88AF11F8B6AB} = {BEDF4556-0366-45BC-B0F3-9FF4EB11B9CB} + {AAEC702A-326A-40B8-9E02-04767A66D084} = {BEDF4556-0366-45BC-B0F3-9FF4EB11B9CB} + EndGlobalSection +EndGlobal diff --git a/src/QuickDish.Api/Controllers/WeatherForecastController.cs b/src/QuickDish.Api/Controllers/WeatherForecastController.cs new file mode 100644 index 0000000..a770abe --- /dev/null +++ b/src/QuickDish.Api/Controllers/WeatherForecastController.cs @@ -0,0 +1,32 @@ +using Microsoft.AspNetCore.Mvc; + +namespace QuickDish.Api.Controllers; + +[ApiController] +[Route("[controller]")] +public class WeatherForecastController : ControllerBase +{ + private static readonly string[] Summaries = new[] + { + "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" + }; + + private readonly ILogger _logger; + + public WeatherForecastController(ILogger logger) + { + _logger = logger; + } + + [HttpGet(Name = "GetWeatherForecast")] + public IEnumerable Get() + { + return Enumerable.Range(1, 5).Select(index => new WeatherForecast + { + Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)), + TemperatureC = Random.Shared.Next(-20, 55), + Summary = Summaries[Random.Shared.Next(Summaries.Length)] + }) + .ToArray(); + } +} diff --git a/src/QuickDish.Api/Program.cs b/src/QuickDish.Api/Program.cs new file mode 100644 index 0000000..48863a6 --- /dev/null +++ b/src/QuickDish.Api/Program.cs @@ -0,0 +1,25 @@ +var builder = WebApplication.CreateBuilder(args); + +// Add services to the container. + +builder.Services.AddControllers(); +// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle +builder.Services.AddEndpointsApiExplorer(); +builder.Services.AddSwaggerGen(); + +var app = builder.Build(); + +// Configure the HTTP request pipeline. +if (app.Environment.IsDevelopment()) +{ + app.UseSwagger(); + app.UseSwaggerUI(); +} + +app.UseHttpsRedirection(); + +app.UseAuthorization(); + +app.MapControllers(); + +app.Run(); diff --git a/src/QuickDish.Api/Properties/launchSettings.json b/src/QuickDish.Api/Properties/launchSettings.json new file mode 100644 index 0000000..fd466a9 --- /dev/null +++ b/src/QuickDish.Api/Properties/launchSettings.json @@ -0,0 +1,41 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:54692", + "sslPort": 44361 + } + }, + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "http://localhost:5235", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "https://localhost:7164;http://localhost:5235", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/src/QuickDish.Api/QuickDish.Api.csproj b/src/QuickDish.Api/QuickDish.Api.csproj new file mode 100644 index 0000000..75d2448 --- /dev/null +++ b/src/QuickDish.Api/QuickDish.Api.csproj @@ -0,0 +1,18 @@ + + + + net8.0 + enable + enable + + + + + + + + + + + + diff --git a/src/QuickDish.Api/QuickDish.Api.http b/src/QuickDish.Api/QuickDish.Api.http new file mode 100644 index 0000000..12ba3fd --- /dev/null +++ b/src/QuickDish.Api/QuickDish.Api.http @@ -0,0 +1,6 @@ +@QuickDish.Api_HostAddress = http://localhost:5235 + +GET {{QuickDish.Api_HostAddress}}/weatherforecast/ +Accept: application/json + +### diff --git a/src/QuickDish.Api/WeatherForecast.cs b/src/QuickDish.Api/WeatherForecast.cs new file mode 100644 index 0000000..720e144 --- /dev/null +++ b/src/QuickDish.Api/WeatherForecast.cs @@ -0,0 +1,12 @@ +namespace QuickDish.Api; + +public class WeatherForecast +{ + public DateOnly Date { get; set; } + + public int TemperatureC { get; set; } + + public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); + + public string? Summary { get; set; } +} diff --git a/src/QuickDish.Api/appsettings.Development.json b/src/QuickDish.Api/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/src/QuickDish.Api/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/src/QuickDish.Api/appsettings.json b/src/QuickDish.Api/appsettings.json new file mode 100644 index 0000000..10f68b8 --- /dev/null +++ b/src/QuickDish.Api/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/src/QuickDish.Application/Class1.cs b/src/QuickDish.Application/Class1.cs new file mode 100644 index 0000000..61c2c16 --- /dev/null +++ b/src/QuickDish.Application/Class1.cs @@ -0,0 +1,6 @@ +namespace QuickDish.Application; + +public class Class1 +{ + +} diff --git a/src/QuickDish.Application/QuickDish.Application.csproj b/src/QuickDish.Application/QuickDish.Application.csproj new file mode 100644 index 0000000..a097382 --- /dev/null +++ b/src/QuickDish.Application/QuickDish.Application.csproj @@ -0,0 +1,13 @@ + + + + + + + + net8.0 + enable + enable + + + diff --git a/src/QuickDish.Client/App.xaml b/src/QuickDish.Client/App.xaml new file mode 100644 index 0000000..1c4d5c7 --- /dev/null +++ b/src/QuickDish.Client/App.xaml @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/src/QuickDish.Client/App.xaml.cs b/src/QuickDish.Client/App.xaml.cs new file mode 100644 index 0000000..9f74cd9 --- /dev/null +++ b/src/QuickDish.Client/App.xaml.cs @@ -0,0 +1,11 @@ +namespace QuickDish.Client; + +public partial class App : Application +{ + public App() + { + InitializeComponent(); + + MainPage = new AppShell(); + } +} diff --git a/src/QuickDish.Client/AppShell.xaml b/src/QuickDish.Client/AppShell.xaml new file mode 100644 index 0000000..7b6c791 --- /dev/null +++ b/src/QuickDish.Client/AppShell.xaml @@ -0,0 +1,15 @@ + + + + + + diff --git a/src/QuickDish.Client/AppShell.xaml.cs b/src/QuickDish.Client/AppShell.xaml.cs new file mode 100644 index 0000000..a75dd91 --- /dev/null +++ b/src/QuickDish.Client/AppShell.xaml.cs @@ -0,0 +1,9 @@ +namespace QuickDish.Client; + +public partial class AppShell : Shell +{ + public AppShell() + { + InitializeComponent(); + } +} diff --git a/src/QuickDish.Client/MainPage.xaml b/src/QuickDish.Client/MainPage.xaml new file mode 100644 index 0000000..e486696 --- /dev/null +++ b/src/QuickDish.Client/MainPage.xaml @@ -0,0 +1,36 @@ + + + + + + + +