commit 4ffd3433f94299f7ad5f82d911df9794ef86adc9 Author: Shahovalov MIkhail Date: Sun Apr 19 12:22:24 2026 +0300 Init diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..cd967fc --- /dev/null +++ b/.dockerignore @@ -0,0 +1,25 @@ +**/.dockerignore +**/.env +**/.git +**/.gitignore +**/.project +**/.settings +**/.toolstarget +**/.vs +**/.vscode +**/.idea +**/*.*proj.user +**/*.dbmdl +**/*.jfm +**/azds.yaml +**/bin +**/charts +**/docker-compose* +**/Dockerfile* +**/node_modules +**/npm-debug.log +**/obj +**/secrets.dev.yaml +**/values.dev.yaml +LICENSE +README.md \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..add57be --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +bin/ +obj/ +/packages/ +riderModule.iml +/_ReSharper.Caches/ \ No newline at end of file diff --git a/.idea/.idea.GymLogAI/.idea/.gitignore b/.idea/.idea.GymLogAI/.idea/.gitignore new file mode 100644 index 0000000..89f9de0 --- /dev/null +++ b/.idea/.idea.GymLogAI/.idea/.gitignore @@ -0,0 +1,15 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Rider ignored files +/modules.xml +/contentModel.xml +/.idea.GymLogAI.iml +/projectSettingsUpdater.xml +# Ignored default folder with query files +/queries/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/.idea/.idea.GymLogAI/.idea/encodings.xml b/.idea/.idea.GymLogAI/.idea/encodings.xml new file mode 100644 index 0000000..df87cf9 --- /dev/null +++ b/.idea/.idea.GymLogAI/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/GymLogAI.API/Dockerfile b/GymLogAI.API/Dockerfile new file mode 100644 index 0000000..3cd76ea --- /dev/null +++ b/GymLogAI.API/Dockerfile @@ -0,0 +1,23 @@ +FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base +USER $APP_UID +WORKDIR /app +EXPOSE 8080 +EXPOSE 8081 + +FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build +ARG BUILD_CONFIGURATION=Release +WORKDIR /src +COPY ["GymLogAI.API/GymLogAI.API.csproj", "GymLogAI.API/"] +RUN dotnet restore "GymLogAI.API/GymLogAI.API.csproj" +COPY . . +WORKDIR "/src/GymLogAI.API" +RUN dotnet build "./GymLogAI.API.csproj" -c $BUILD_CONFIGURATION -o /app/build + +FROM build AS publish +ARG BUILD_CONFIGURATION=Release +RUN dotnet publish "./GymLogAI.API.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "GymLogAI.API.dll"] diff --git a/GymLogAI.API/GymLogAI.API.csproj b/GymLogAI.API/GymLogAI.API.csproj new file mode 100644 index 0000000..4958600 --- /dev/null +++ b/GymLogAI.API/GymLogAI.API.csproj @@ -0,0 +1,20 @@ + + + + net10.0 + enable + enable + Linux + + + + + + + + + .dockerignore + + + + diff --git a/GymLogAI.API/GymLogAI.API.http b/GymLogAI.API/GymLogAI.API.http new file mode 100644 index 0000000..b4be8a2 --- /dev/null +++ b/GymLogAI.API/GymLogAI.API.http @@ -0,0 +1,6 @@ +@GymLogAI.API_HostAddress = http://localhost:5202 + +GET {{GymLogAI.API_HostAddress}}/weatherforecast/ +Accept: application/json + +### diff --git a/GymLogAI.API/Program.cs b/GymLogAI.API/Program.cs new file mode 100644 index 0000000..e1c66f6 --- /dev/null +++ b/GymLogAI.API/Program.cs @@ -0,0 +1,48 @@ +namespace GymLogAI.API; + +public class Program +{ + public static void Main(string[] args) + { + var builder = WebApplication.CreateBuilder(args); + + // Add services to the container. + builder.Services.AddAuthorization(); + + // Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi + builder.Services.AddOpenApi(); + + var app = builder.Build(); + + // Configure the HTTP request pipeline. + if (app.Environment.IsDevelopment()) + { + app.MapOpenApi(); + } + + app.UseHttpsRedirection(); + + app.UseAuthorization(); + + var summaries = new[] + { + "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" + }; + + app.MapGet("/weatherforecast", (HttpContext httpContext) => + { + var forecast = 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(); + return forecast; + }) + .WithName("GetWeatherForecast"); + + app.Run(); + } +} \ No newline at end of file diff --git a/GymLogAI.API/Properties/launchSettings.json b/GymLogAI.API/Properties/launchSettings.json new file mode 100644 index 0000000..115d2ed --- /dev/null +++ b/GymLogAI.API/Properties/launchSettings.json @@ -0,0 +1,23 @@ +{ + "$schema": "https://json.schemastore.org/launchsettings.json", + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": false, + "applicationUrl": "http://localhost:5202", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": false, + "applicationUrl": "https://localhost:7225;http://localhost:5202", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/GymLogAI.API/WeatherForecast.cs b/GymLogAI.API/WeatherForecast.cs new file mode 100644 index 0000000..efa2658 --- /dev/null +++ b/GymLogAI.API/WeatherForecast.cs @@ -0,0 +1,12 @@ +namespace GymLogAI.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; } +} \ No newline at end of file diff --git a/GymLogAI.API/appsettings.Development.json b/GymLogAI.API/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/GymLogAI.API/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/GymLogAI.API/appsettings.json b/GymLogAI.API/appsettings.json new file mode 100644 index 0000000..10f68b8 --- /dev/null +++ b/GymLogAI.API/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/GymLogAI.sln b/GymLogAI.sln new file mode 100644 index 0000000..f881c31 --- /dev/null +++ b/GymLogAI.sln @@ -0,0 +1,21 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GymLogAI.API", "GymLogAI.API\GymLogAI.API.csproj", "{42540161-196B-43B8-998E-FA9BDD01A74C}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E5E8EB24-8CA7-40EC-9C3F-70C72D7E0589}" + ProjectSection(SolutionItems) = preProject + compose.yaml = compose.yaml + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {42540161-196B-43B8-998E-FA9BDD01A74C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {42540161-196B-43B8-998E-FA9BDD01A74C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {42540161-196B-43B8-998E-FA9BDD01A74C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {42540161-196B-43B8-998E-FA9BDD01A74C}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..51ba784 --- /dev/null +++ b/compose.yaml @@ -0,0 +1,7 @@ +services: + gymlogai.api: + image: gymlogai.api + build: + context: . + dockerfile: GymLogAI.API/Dockerfile +