Skip to content

The Bank API is a design reference project suitable to bootstrap development for a compliant and modern API.

License

Notifications You must be signed in to change notification settings

agarbutt/bank-api

 
 

Repository files navigation

Bank API 🏦

CC BY-NC-SA 4.0 GitHub commit activity

Scalar landing page

Aspire

The Bank API is a design reference project suitable to bootstrap development for a compliant and modern API.

Technology stack

Prerequisites

If not using the Dev Container, install:

Quick start

  • (Optionally) regenerate the GitHub downstream API client by going to the Kiota workspace and clicking Re-generate under clients.

  • Generate a new JWT-token for secured endpoints:

    dotnet user-jwts create --scope "bank_api" --role "banker"
  • Run dotnet build to output the OpenAPI definition

  • Validate the OpenAPI definition by going to the generated.json definition and check for problems via the Spectral extension.

Run in Aspire minimal mode

This mode just runs the ASP.NET Core API.

  1. Start the standalone Aspire Dashboard for developer visualization:

    docker run --rm -it `
    -p 18888:18888 `
    -p 4317:18889 `
    --name aspire-dashboard `
    mcr.microsoft.com/dotnet/aspire-dashboard:latest

    Copy the url shown in the resulting output when running the container, and replace 0.0.0.0 with localhost, eg http://localhost:18888/login?t=123456780abcdef123456780 and open that in your browser, or you can also paste the key after /login?t= when the login dialog is shown. The token will change each time you start the container.

  2. Run the launch config C#: Api Debug (with standalone Aspire).

Run in Aspire mode

This mode starts the API in the context of .NET Aspire. Do not run in Aspire mode inside the Dev Container, it is not yet suitable for that.

  1. Make sure the docker runtime is started.

  2. Run the launch config C#: App Host Debug (via Aspire).

Considerations

  1. OpenID Connect isn't fully supported in Scalar yet: scalar/scalar#3656

  2. Running tests works in VSCode. However, debugging tests doesn't work with TUnit in VSCode yet, please see: microsoft/vscode-dotnettools#1616 (comment)

  3. To extend OpenTelemetry logging to Application Insights, expand the OpenTelemetry exporter

Please see the Reddit r/dotnet post about this project for more considerations and information.

License

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

CC BY-NC-SA 4.0

About

The Bank API is a design reference project suitable to bootstrap development for a compliant and modern API.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 98.3%
  • Bicep 1.7%