Skip to content

xmixalis/BasketExercise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 

Repository files navigation

Basket API .NET Core v2.1

Basket API project is a set of complete Basket .NET Core Web API with an API Client and a User Interface application.

The complete code of the project can be found on GitHub and consists of the following projects.

  • Project for the Basket API targeting .NET Core v2.1
  • Infrastructure project targeting .NET Standard v2.0
  • API Client project targeting .NET Standard v2.0
  • Shared Models project to be used by the API Client as well as the Web API
  • Web Front-end project targeting .NET Core v2.1
  • Test projects that are provided as seperate projects

The Web API and Web UI projects are hosted as Azure services and documentation for the API can be found in the Home page of the API url..

You can also visit the Web UI prototype in order to test the API operations.

Assumptions of the current implementation.

  • System uses in memory database to store data
  • If a user is not authenticated then a unique ID is stored in a cookie and is mapped with a unique Basket ID.
  • When a user logs in , a new Basket is created (or retrieved if exists) for the user. An improvement could be to transfer the anonymous basket to the User.
  • The user updates the quantities or removes the items for each item separately.
  • API Client project is configured to create a Nuget package configuration file in order to be deployed as a .NET Standard v2.0 library.
  • Checkout library can be integrated with the current Web UI once it have been created as a different library.
  • Base API address can be configured in the Web UI project changing the "APIBaseUrl" setting in appsettings.json.
  • Live Web UI and API have been connected with Azure Application Insights for performance monitoring.

In order to integrate with the API using the API client provided yoy have to add a using statetement for the client library and access one of the services provided with the client;

Example of using the API Client

using BasketApi.Client;
BasketApiClient client = new BasketApiClient("http://apibaseurl");
BasketModelResponse basket = await client.BasketService.GetBasketForUser(userId);

About

Basket API exercise project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages