Giter Club home page Giter Club logo

enesserenli / anadoluparamapi_management Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 2.0 520 KB

This project is a WebApi project written in .NetCore 6. The project contains many structures such as repository pattern, Token-based authorization and authentication (JWT Token), Redis Cache, DependecyInjection and docker.. In addition, 2 database connections, MSSql and MongoDB, were made.

License: MIT License

C# 99.51% Dockerfile 0.49%
api-rest claims dependency-injection docker docker-container jwt-authentication jwt-token mongodb mongodb-driver netcore6 redis-cache repository-pattern restfull-api services swagger unitofwork unitofwork-pattern webapi

anadoluparamapi_management's Introduction

AnadoluParamApi_Management Project

  • In this project, you can create category-based products and add these products to your basket and shop. For example, you created a category called dairy products. You have created a subcategory named cheeses linked to this category. Finally, you can create a product named Sütaş Cheese under this sub-category and add it to your cart and shop.

  • You can list created products.

  • You can make a category-based product listing.

  • You can update and list your shopping cart.

  • You can list, update and delete all categories and subcategories.

How Can I Run the Project

  • First of all, you must have MSSql server and MongoDB installed on your computer. In the project, logging operations were made to MongoDB. Everything else is recorded in MSSql.

  • Afterwards, you need to enter your MSSql server information, MongoDB information and database information to the places specified in the code line below in the appconfig file within the AnadoluParamApi project.

 "ConnectionStrings": {
    "DbType": "SQL",
    "DefaultConnection": "server=DESKTOP-JOE5KI8\\SQLEXPRESS02;Database=AnadoluParamApiDB;Trusted_Connection=True; MultipleActiveResultSets=True;",
    "MongoConnection": "mongodb://localhost:27017",
    "DatabaseName": "AnadoluParamMongoDB"
  }
  • After entering your server information, open the 'Terminal' and enter the AnadoluParamApi.Data project. Create a migration with the 'dotnet ef migrations add initial' command. Since I created it in this project, you may not need to create it again.

  • However, you should still transfer the database into MSSql by running the 'dotnet ef database update' command. Or, you can restore the file with the .bak extension from which you pulled the project into MSSql and run it without doing these operations.

  • For RedisCache operations, your computer must have redis installed. Made in CategoryController only.

  • You can find RedisCache information in appconfig. Here you should replace it with your own information.

 "Redis": {
    "Host": "localhost",
    "Port": "6379",
    "InstanceName": "enessrnli"
  }
  • In Docker, I created a redis named enesrnli, which is localhost by default. I use this. You can create one yourself. Docker

  • After running the project, you need to register in the system to be able to make a request. You can register with the register shown in the photo below, and then you should get tokens with the account information you created through the login endpoint.

swaggerUI


  • You must copy the token you received and paste it into it by clicking on one of the lock icons on the right on swaggerUI. If so, you will be logged into the system. TokenResponse


  • There are 2 roles in the system. For this reason, if you create an account with the role of admin and member, you will receive unauthorized response only on endpoints with admin authority.

UseAccessToken

anadoluparamapi_management's People

Contributors

enesserenli avatar

Stargazers

 avatar  avatar

Watchers

 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.