Coder Social home page Coder Social logo

paymentapi's Introduction

Build Status

Build and run

Visual Studio

Hit Ctrl F5 :)

Visual Studio Code

Hit Ctrl F5 :)

Terminal

Navigate to project directory PaymentAPI/PaymentAPI in a console and run

dotnet restore

dotnet build

dotnet run

Nagivate to http://localhost:5000

Swagger will describe the endpoints.

Testing

If you aren't using an IDE with built-in testing features, execute the following command at a command prompt in the PaymentAPI.UnitTests or PaymentAPI.IntegrationTests folder:

dotnet test

Testing notes

Some issues getting the integration tests to run, solved by using AddDbContextPool instead of AddDbContext in the APIWebApplicationFactory ConfigureWebHost, that took some problem solving :D I'd be keen to add some database cleanup between tests too, I've made them robust enough to work in any order by working on different records but they'd be easy to break if someone added one and didn't realise that record was already being modified by another test.

Continuous Integration

Built using https://github.com/stuartdotnet/paymentapi/blob/master/azure-pipelines.yml

TODO run integration tests

TODO build release pipeline to an Azure Web App

Self Publishing

From PaymentAPI/PaymentAPI run

dotnet publish -o <your local directory>

dotnet PaymentAPI.dll

Configuration

Set your machine's local Environment setting by creating a setting called ASPNETCORE_ENVIRONMENT and setting it to Development or Production

Notes

  • Simple repo multi tier architecture as such a small application, but I've tried to separate concerns as well as possible, and keep the services separate. For example, the balance and the payments come from different services, and are only put together at the Application level, making this easier if these domains need to be split into different projects for a microservice transition.
  • Different error handling for different environments

TODO

  • SSL
  • No authentication yet, hence the need to pass account id instead of using logged in user. Would use IdentityServer4
  • Integration tests, clean up data between them
  • More testing scenarios, cover more unhappy paths
  • Production config, keyvault

paymentapi's People

Watchers

Stuart Dobson avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.