Giter Club home page Giter Club logo

merchandisemanagement's Introduction

Merchandise Management API

What is that?

Proof-of-concept project of e-commerce merchandising management system implementation.

How to run it?

Architecture and project decisions

In general, I can say that it was a project where I tried to write code in accordance with SOLID and DRY principles. Apart from that, I have tried to summarize the parts that I think are important below.

"Facade" structure

I tried to write simple and well-organized code in accordance with the DDD structure, by passing domain objects as parameters to the "Facade" functions. I preferred to use the "Facade" structure in order to keep the code more tidy and to facilitate maintainability.

"OperationResult" class

I used this class to keep the communication between client and api stable. Because, thanks to this class, the client side can obtain some standard parameters in almost every condition in the response to be returned.

"CustomApplicationException" class

I used this class to return a negative response directly to the client from the facade layer in the api. Here, ExceptionHandlerMiddleware catches the thrown exception and turns it into a response suitable for the client and returns to the client.

HealthChecks

There are situations where we need to monitor the applications we develop with various tools. In these cases, the API you develop can be a real life saver if it provides health check endpoints.

Swagger

I integrate Swagger into almost every API I develop. I think it is very useful when experimenting with endpoints during the development period.

Code-first approach & EF Core & EF Core migrations

I think that writing the code first and then transferring the resulting data and schemas to the database via migration adds order to the backend development. I preferred the EFCore orm package because it provides all kinds of convenience in these parts. Also, its compatibility with Microsoft.AspNetCore.Identity was one of the reasons that pushed me to use EfCore.

Api versioning

When the request or response content of an endpoint changes, this can sometimes cause client-side corruption. And if the client fails to apply this change to all devices that have access to the app at the same time (for example: mobile apps), this can cause more serious problems. That's why I add versioning to API endpoints. And if there is a need to make changes that can break the client side in this way, I write the same function by increasing its version. Later, when the client-side dev team says it's okay to delete the outdated function, I also delete the outdated function to reduce code pollution. And in this way, we get a more stable API - client interaction.

Docker & docker-compose

I used docker and docker-compose technologies because of the benefits such as facilitating the first-run process of the API, minimizing the problems that may arise from environment differences, and easily scaling.

Logging & NLog

I think logging is an indispensable part of almost every project. NLog is a package that I use in all the projects I have developed and that I am satisfied with. Therefore, I used NLog in this project for logging operations.

โš ๏ธ Note: Since it is a poc project, I created and hosted the sql server in docker. And I did not add a fixed volume to keep the data constant/persistent. In some cases, it may cause data loss (For example: deleting the container completely, or turning off the docker engine). It will also be useful to specify a fixed volume on docker-compose.yml when performing these operations on a normal server.

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.