Code Monkey home page Code Monkey logo

.net_fullstack_project_backend's Introduction

.NET Core EF Core PostgreSQL

Fullstack Project

Table of Contents

Table of Contents

  1. Project Overview
  2. Docker
  3. GitHub Actions Workflow
  4. Features
  5. Project Setup Instructions
  6. Testing
  7. Architecture
  8. Database Design
  9. Endpoints
  10. Demo

Project Overview

Frontend

The frontend of the project has been deployed and is accessible in the repository at https://github.com/hasanmd91/.NET_fullstack_project_frontend: Live Link of the frontend Project https://ilhshoestore.netlify.app/

Backend

This backend project is build wtih ASP.NET Core, Entity Framework Core, and PostgreSQL and is deployed on Microsoft Azure. The backend provides endpoints for performing CRUD operations based on Authorization. Backend deployed link https://ecommershop.azurewebsites.net

Swagger Documentation

https://ecommershop.azurewebsites.net

Technologies

  • ASP.Net Core
  • Entity Framework Core
  • PostgreSql
  • Xunit
  • Microsoft Azure

Docker

To use the pre-built Docker image for this project, you can pull it from Docker Hub. Run the following command:

docker pull hasanmd91/ilhbackend

Once the image is pulled, you can run the Docker container using the following command:

docker run -p 8080:8080 hasanmd91/ilhbackend

Alternatively, you can run the docker-compose.yml file, you can use the following command to build and start the container

docker-compose up --build

GitHub Actions Workflow

The CI/CD pipeline is defined in the .github/workflows directory and it consists of the following stages:

  • Build: Build the project and dependencies.
  • Test: Run unit tests and any other relevant tests.
  • Docker: Build and push the docker image to the docker hub.

Features

User Management:

  • Users can register for an account and log in.
  • Users can view all available products and individual product details.
  • Users can post, delete and update products review.
  • The ability to search and sort products is supported.
  • Users can add products to their shopping cart.
  • Cart management functionality is available.
  • Users can order product by checkout no payment info is required

Admin Functionalities

  • Admins have the ability to view and delete user accounts.
  • Admins can view, edit, delete, and add new products.
  • Admins can view all orders and update order status
  • Admins can update a user to admin.

Project Setup Instructions

  • Clone the Project
  • Ensure that all required packages in every layer are installed according to the .csproj files. Navigate to each layer and execute:
dotnet restore
  • Create a local appsettings.json file in the root directory of the project. You can use the provided template below and adjust it as necessary:
{
  "ConnectionStrings": {
    "localDb": "YOUR_DATABASE_CONNECTION_STRING_HERE"
  },
  "Jwt": {
    "Issuer": "YOUR_ISSUER_VALUE",
    "Audience": "YOUR_AUDIENCE_VALUE",
    "Key": "YOUR_SECRET_KEY_VALUE"
  }
}

  • Insert your local database connection string under the "localDb" key in the appsettings.json file.
  • Provide appropriate values for Issuer, Audience, and Key under the Jwt section in the appsettings.json file.
  • Execute Entity Framework (EF) Core migrations to update the database schema. Navigate to the project containing the DbContext and execute:
dotnet ef migrations add <Migration_Name>
dotnet ef database update

  • Navigate to the Ecom.WebAPI folder and run the project using either of the following commands:
dotnet run

Testing

  • To run all the tests, use the following command in the Test directory of the solution:
dotnet test

Architecture

Architecture

DataBase Design

DataBase Design

Endpoints

Authentication

Method Path
POST /api/auth/login
GET /api/auth/profile

Category

Method Path
GET /api/category
POST /api/category
GET /api/category/{categoryId}
DELETE /api/category/{categoryId}
PATCH /api/category/{categoryId}

Order

Method Path
GET /api/order
POST /api/order
GET /api/order/{orderId}
DELETE /api/order/{orderId}
PATCH /api/order/{orderId}

Product

Method Path
GET /api/product
POST /api/product
GET /api/product/{productId}
DELETE /api/product/{productId}
PATCH /api/product/{productId}

Review

Method Path
POST /api/review
DELETE /api/review/{reviewId}
PATCH /api/review/{reviewId}

User

Method Path
GET /api/user
POST /api/user
GET /api/user/{userId}
PATCH /api/user/{userId}
DELETE /api/user/{userId}

Demo

Youtube Demo

.net_fullstack_project_backend's People

Contributors

hasanmd91 avatar alikiny avatar

Watchers

 avatar  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.