Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
# an explicit RID produced an assets file that didn't satisfy
# `publish -r linux-x64 --no-restore`.
- name: Publish (linux-x64, framework-dependent)
run: dotnet publish WebApplication1.csproj -c Release -r linux-x64 --self-contained false -o ./publish-linux
run: dotnet publish GroundShareAPI.csproj -c Release -r linux-x64 --self-contained false -o ./publish-linux

# Zip on Linux so path separators are forward slashes. Paired with
# WEBSITE_RUN_FROM_PACKAGE=1 on the App Service, the deploy mounts the
Expand Down
23 changes: 17 additions & 6 deletions 02-Server/Controllers/ComparisonsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -228,15 +228,26 @@ private async Task<GisFeatures> FetchGisFeatures(double lat, double lng)

await Task.WhenAll(tasks.Values);

bool anyLayerResponded = tasks.Values.Any(t => t.Result >= 0);
// Await each completed task to surface results without resorting
// to .Result (matches the pattern used in GeoController.cs).
int construction = await tasks["construction"];
int permits = await tasks["permits"];
int nightWork1 = await tasks["nightWork1"];
int nightWork2 = await tasks["nightWork2"];
int roadWork1 = await tasks["roadWork1"];
int roadWork2 = await tasks["roadWork2"];
int cityPlans = await tasks["cityPlans"];

bool anyLayerResponded = new[] { construction, permits, nightWork1, nightWork2, roadWork1, roadWork2, cityPlans }
.Any(v => v >= 0);

var gis = new GisFeatures
{
ConstructionSiteCount = Math.Max(0, tasks["construction"].Result),
PermitCount = Math.Max(0, tasks["permits"].Result),
NightWorkCount = Math.Max(0, tasks["nightWork1"].Result) + Math.Max(0, tasks["nightWork2"].Result),
RoadWorkCount = Math.Max(0, tasks["roadWork1"].Result) + Math.Max(0, tasks["roadWork2"].Result),
CityPlanCount = Math.Max(0, tasks["cityPlans"].Result),
ConstructionSiteCount = Math.Max(0, construction),
PermitCount = Math.Max(0, permits),
NightWorkCount = Math.Max(0, nightWork1) + Math.Max(0, nightWork2),
RoadWorkCount = Math.Max(0, roadWork1) + Math.Max(0, roadWork2),
CityPlanCount = Math.Max(0, cityPlans),
HasGisData = anyLayerResponded,
};

Expand Down
4 changes: 2 additions & 2 deletions 02-Server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src

# Copy csproj first for layer caching on restore
COPY WebApplication1.csproj .
COPY GroundShareAPI.csproj .
RUN dotnet restore

# Copy everything else and publish
Expand All @@ -43,4 +43,4 @@ EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD curl -f http://localhost:8080/api/health || exit 1

ENTRYPOINT ["dotnet", "WebApplication1.dll"]
ENTRYPOINT ["dotnet", "GroundShareAPI.dll"]
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.5.0" />
<PackageReference Include="Azure.Identity" Version="1.21.0" />
<PackageReference Include="Azure.Storage.Blobs" Version="12.27.0" />
<PackageReference Include="BCrypt.Net-Next" Version="4.0.3" />
<PackageReference Include="FluentValidation.AspNetCore" Version="11.3.1" />
<PackageReference Include="Google.Apis.Auth" Version="1.73.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.11" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.3" />
<PackageReference Include="Serilog.AspNetCore" Version="10.0.0" />
<PackageReference Include="Serilog.Sinks.ApplicationInsights" Version="5.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="6.1.1" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2" />
</ItemGroup>

</Project>
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<AssemblyName>GroundShareAPI</AssemblyName>
<RootNamespace>GroundShareAPI</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.5.0" />
<PackageReference Include="Azure.Identity" Version="1.21.0" />
<PackageReference Include="Azure.Storage.Blobs" Version="12.27.0" />
<PackageReference Include="BCrypt.Net-Next" Version="4.0.3" />
<PackageReference Include="FluentValidation.AspNetCore" Version="11.3.1" />
<PackageReference Include="Google.Apis.Auth" Version="1.73.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.11" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.3" />
<PackageReference Include="Serilog.AspNetCore" Version="10.0.0" />
<PackageReference Include="Serilog.Sinks.ApplicationInsights" Version="5.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="6.1.1" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2" />
</ItemGroup>

</Project>
6 changes: 6 additions & 0 deletions 02-Server/GroundShareAPI.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@GroundShareAPI_HostAddress = http://localhost:5227

GET {{GroundShareAPI_HostAddress}}/api/health
Accept: application/json

###
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.2.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebApplication1", "WebApplication1.csproj", "{19317912-AC4B-45A3-1276-85453B678B5B}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GroundShareAPI", "GroundShareAPI.csproj", "{19317912-AC4B-45A3-1276-85453B678B5B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
6 changes: 0 additions & 6 deletions 02-Server/WebApplication1.http

This file was deleted.

1 change: 1 addition & 0 deletions 03-Client/android/app/capacitor.build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ android {

apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle"
dependencies {
implementation project(':capacitor-app')
implementation project(':capacitor-camera')
implementation project(':capacitor-filesystem')
implementation project(':capacitor-geolocation')
Expand Down
3 changes: 3 additions & 0 deletions 03-Client/android/capacitor.settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
include ':capacitor-android'
project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/android/capacitor')

include ':capacitor-app'
project(':capacitor-app').projectDir = new File('../node_modules/@capacitor/app/android')

include ':capacitor-camera'
project(':capacitor-camera').projectDir = new File('../node_modules/@capacitor/camera/android')

Expand Down
10 changes: 10 additions & 0 deletions 03-Client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion 03-Client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@
"build": "vite build",
"dev": "vite",
"test": "vitest run",
"test:watch": "vitest"
"test:watch": "vitest",
"build:android": "vite build && cap sync android",
"run:android": "vite build && cap sync android && cap run android",
"open:android": "vite build && cap sync android && cap open android"
},
"dependencies": {
"@capacitor/android": "^8.3.1",
"@capacitor/app": "^8.1.0",
"@capacitor/camera": "^8.1.0",
"@capacitor/cli": "^8.3.1",
"@capacitor/core": "^8.3.1",
Expand Down
2 changes: 2 additions & 0 deletions 03-Client/src/app/SwipeBackProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { Outlet } from "react-router";
import { useSwipeBack } from "./hooks/useSwipeBack";
import { useAndroidBackButton } from "./hooks/useAndroidBackButton";
import { AuthProvider } from "./context/AuthContext";

export function SwipeBackProvider() {
useSwipeBack();
useAndroidBackButton();
return (
<AuthProvider>
<Outlet />
Expand Down
Loading
Loading