HockeyPickup.Api is the core backend for HockeyPickup.
The main technology stack platform is .NET Core 9.0.
- Install Visual Studio 2022 (preview) or later, or Visual Studio Code. Ensure that
$ dotnet --version
is at least 9.0.
Create a new file at the root of the HockeyPickup.Api project named appsettings.json
with the following contents:
-
Get the
<DatabaseConnectionString>
from a local instance of SQL Server. -
Get the
<ServiceBusConnectionString>
from Azure portal. Currently Service Bus is not available to run locally. -
<InviteCode>
can be any string, required to register a new account. -
Create a
<JWTBase64Key>
:$ openssl rand -base64 32
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information",
"Microsoft.AspNetCore.Mvc.ApiExplorer": "Debug"
},
"Console": {
"IncludeScopes": true,
"LogLevel": {
"Default": "Debug",
"System": "Information",
"Microsoft": "Information",
"Microsoft.AspNetCore.Mvc.ApiExplorer": "Debug"
}
}
},
"AllowedHosts": "*",
"WEBSITE_CONTENTAZUREFILESCOMPATIBILITYOVERRIDE": 1,
"ConnectionStrings": {
"DefaultConnection": "<DatabaseConnectionString>",
"ServiceBusConnectionString": "<ServiceBusConnectionString>"
},
"JwtSecretKey": "<JWTSecretKey>",
"JwtIssuer": "HockeyPickupApi",
"JwtAudience": "https://api.hockeypickup.com/api/",
"ServiceBusCommsQueueName": "comms-dev",
"ServiceBusHealthCheckQueueName": "health-dev",
"RegistrationInviteCode": "<InviteCode>"
}
}
$ dotnet restore
$ dotnet tool restore
Open HockeyPickup.Api.sln solution in Visual Studio, and build the solution.
You'll see output in the console showing the various local URL access points.
Swagger root https://localhost:7042/index.html
GraphQL root https://localhost:7042/api/graphql
Unit testing and code coverage are setup and must be maintained. To run the tests and generate a coverage report, run the Powershell script from the command line.
$ powershell ./scripts/RunTests.ps1
This generates a coverage report in HockeyPickup.Api.Tests/coverage-html
. Open index.html
to view the report.
Postman is a useful tool for testing Apis.
HockeyPickup.Api uses sementic versioning, starting with 1.0.0.
The patch (last segment of the 3 segments) is auto-incremented via a GitHub action when a pull request is merged to master. The GitHub action is configured in .github/workflows/hockeypickup-api-version.yml. To update the major or minor version, follow the instructions specified in the bumping section of the action - use #major or #minor in the commit message to auto-increment the version.
We welcome useful contributions. Please read our contributing guidelines before submitting a pull request.
HockeyPickup.Api is licensed under the MIT license.