Skip to content

API to match the Customer SPA as part of the SpiderTracks assessment

License

Notifications You must be signed in to change notification settings

burger-mtbkr/customer-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spidertracks Customer API

This is a .Net 7 API with a swagger ui utilising a JsonFlatFileDataStore. I have added some assumptions and future improvements. The api is secured using token based authentication.

The repository includes workflows that will do the following:

  • On pull request run the unit tests
  • When pushing a tag with a release- prefix:
    • A release will be created in the repository.
    • The image will be published to docker hub
    • The image will be published as a github package

1. How to test the api:

Local debugging:

  • Clone this repository.
  • Using Visual Studio 2022 community : Open the Solution file under src/Customer/service.
  • Select the docker Launch Profile and press play.
  • The browser should open. You can then navigate to http://localhost:<port>/swagger/index.html.:eyes:

Testing the api through Swaggers:

Note: you do not need to do this if you plan to use the Customer SPA

  • The api is secured so you will need to signup to it.:lock:
  • Go the /api/signup POST method and signup.
  • After signing up you will receive a token in the response of your request
  • Scroll to the top of the page and click the green Authorize button
  • Enter: Bearer <token>. <token> being what was returned from your /api/signup request.
  • After you have authenticated you can start creating customers then leads.

Notes:

  • You only need to signup once - after that you can use the api/login endpoint to request a new token if required.
  • If you prefer not to use Swagger I have included a postman collection for the api.