diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..003d49c2e7bcf118d9fd9b8681a6bbe0c3728acd --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +/*/bin +/*/obj +appsettings.Development.json +/*/Properties diff --git a/WeatherStack.API/Program.cs b/WeatherStack.API/Program.cs new file mode 100644 index 0000000000000000000000000000000000000000..48863a6d6cd2d107e6cb4ed88c281c131244e2f6 --- /dev/null +++ b/WeatherStack.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/WeatherStack.API/WeatherStack.API.csproj b/WeatherStack.API/WeatherStack.API.csproj new file mode 100644 index 0000000000000000000000000000000000000000..caf632eb5ce978b80c0833a3a068bc451ed891e7 --- /dev/null +++ b/WeatherStack.API/WeatherStack.API.csproj @@ -0,0 +1,18 @@ +<Project Sdk="Microsoft.NET.Sdk.Web"> + + <PropertyGroup> + <TargetFramework>net8.0</TargetFramework> + <Nullable>enable</Nullable> + <ImplicitUsings>enable</ImplicitUsings> + </PropertyGroup> + + <ItemGroup> + <PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" /> + </ItemGroup> + + <ItemGroup> + <ProjectReference Include="..\WeatherStack.Services\WeatherStack.Services.csproj" /> + <ProjectReference Include="..\WeatherStack.Utility\WeatherStack.Utility.csproj" /> + </ItemGroup> + +</Project> diff --git a/WeatherStack.API/appsettings.json b/WeatherStack.API/appsettings.json new file mode 100644 index 0000000000000000000000000000000000000000..10f68b8c8b4f796baf8ddeee7551b6a52b9437cc --- /dev/null +++ b/WeatherStack.API/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/WeatherStack.Repository/WeatherStack.Repository.csproj b/WeatherStack.Repository/WeatherStack.Repository.csproj new file mode 100644 index 0000000000000000000000000000000000000000..dc3d83790687ca3921e3312d55ea30621d20d8ee --- /dev/null +++ b/WeatherStack.Repository/WeatherStack.Repository.csproj @@ -0,0 +1,13 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <ItemGroup> + <ProjectReference Include="..\WeatherStack.Utility\WeatherStack.Utility.csproj" /> + </ItemGroup> + + <PropertyGroup> + <TargetFramework>net8.0</TargetFramework> + <ImplicitUsings>enable</ImplicitUsings> + <Nullable>enable</Nullable> + </PropertyGroup> + +</Project> diff --git a/WeatherStack.Services/WeatherStack.Services.csproj b/WeatherStack.Services/WeatherStack.Services.csproj new file mode 100644 index 0000000000000000000000000000000000000000..0bd6c32c0d11cd26e4a52a673b4117a968eb05af --- /dev/null +++ b/WeatherStack.Services/WeatherStack.Services.csproj @@ -0,0 +1,15 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <ItemGroup> + <ProjectReference Include="..\WeatherStack.Repository\WeatherStack.Repository.csproj" /> + <ProjectReference Include="..\WeatherStack.Utility\WeatherStack.Utility.csproj" /> + </ItemGroup> + + + <PropertyGroup> + <TargetFramework>net8.0</TargetFramework> + <ImplicitUsings>enable</ImplicitUsings> + <Nullable>enable</Nullable> + </PropertyGroup> + +</Project> diff --git a/WeatherStack.Utility/WeatherStack.Utility.csproj b/WeatherStack.Utility/WeatherStack.Utility.csproj new file mode 100644 index 0000000000000000000000000000000000000000..e2f7b993cae683967c8a0464ed33c9e9503b7ebc --- /dev/null +++ b/WeatherStack.Utility/WeatherStack.Utility.csproj @@ -0,0 +1,13 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <TargetFramework>net8.0</TargetFramework> + <ImplicitUsings>enable</ImplicitUsings> + <Nullable>enable</Nullable> + </PropertyGroup> + + <ItemGroup> + <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.10" /> + </ItemGroup> + +</Project> diff --git a/weatherstack.sln b/weatherstack.sln new file mode 100644 index 0000000000000000000000000000000000000000..34235d4e45653d24a13eba300739f7347d98a5ba --- /dev/null +++ b/weatherstack.sln @@ -0,0 +1,47 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.002.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WeatherStack.API", "WeatherStack.API\WeatherStack.API.csproj", "{41B55E30-36E4-4A03-BA91-843299DA3B08}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WeatherStack.Services", "WeatherStack.Services\WeatherStack.Services.csproj", "{4DC557D8-8EC6-412B-83AE-EC1789E5EEC5}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WeatherStack.Utility", "WeatherStack.Utility\WeatherStack.Utility.csproj", "{178C13D9-E233-465E-9EC7-E67F25BF6685}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WeatherStack.Repository", "WeatherStack.Repository\WeatherStack.Repository.csproj", "{A40A9B39-F5B8-4C3B-9F2B-6C24158F8584}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {41B55E30-36E4-4A03-BA91-843299DA3B08}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {41B55E30-36E4-4A03-BA91-843299DA3B08}.Debug|Any CPU.Build.0 = Debug|Any CPU + {41B55E30-36E4-4A03-BA91-843299DA3B08}.Release|Any CPU.ActiveCfg = Release|Any CPU + {41B55E30-36E4-4A03-BA91-843299DA3B08}.Release|Any CPU.Build.0 = Release|Any CPU + {B973943C-0F3E-4A0D-8630-F755642DF6B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B973943C-0F3E-4A0D-8630-F755642DF6B3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B973943C-0F3E-4A0D-8630-F755642DF6B3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B973943C-0F3E-4A0D-8630-F755642DF6B3}.Release|Any CPU.Build.0 = Release|Any CPU + {4DC557D8-8EC6-412B-83AE-EC1789E5EEC5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4DC557D8-8EC6-412B-83AE-EC1789E5EEC5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4DC557D8-8EC6-412B-83AE-EC1789E5EEC5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4DC557D8-8EC6-412B-83AE-EC1789E5EEC5}.Release|Any CPU.Build.0 = Release|Any CPU + {178C13D9-E233-465E-9EC7-E67F25BF6685}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {178C13D9-E233-465E-9EC7-E67F25BF6685}.Debug|Any CPU.Build.0 = Debug|Any CPU + {178C13D9-E233-465E-9EC7-E67F25BF6685}.Release|Any CPU.ActiveCfg = Release|Any CPU + {178C13D9-E233-465E-9EC7-E67F25BF6685}.Release|Any CPU.Build.0 = Release|Any CPU + {A40A9B39-F5B8-4C3B-9F2B-6C24158F8584}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A40A9B39-F5B8-4C3B-9F2B-6C24158F8584}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A40A9B39-F5B8-4C3B-9F2B-6C24158F8584}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A40A9B39-F5B8-4C3B-9F2B-6C24158F8584}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {80B66021-6168-4781-916A-61B4E8B718D6} + EndGlobalSection +EndGlobal