Giter VIP home page Giter VIP logo

store-management-service-2's Introduction

store-management-service-2

제품 쇼핑몰을 관리할 수 있는 관리 페이지 서비스


목차


개발 기간

2022.10.21 ~ 2022.10.27 : 기능 구현

2022.10.29 : Azure 배포

2022.11.7 : AWS EC2 배포



프로젝트 개요

💭 프로젝트 설명

장바구니 기능과 일자별로 총 매출, 제품별 판매수량, 제품별 매출을 볼 수 있는 쇼핑몰 관리 페이지


🧹 사용 기술

  • Back-End : Python, Django, Django REST Framework, Dj Rest Auth, Django Allauth, Djangorestframework Simplejwt
  • Database : SQLite, PostgreSQL
  • Cloud : Azure
  • ETC : Git, Github

📰 모델링

  • 실제 모델링

Untitled (1)

  • 원하던 모델링

Untitled


🛠 API Test

image

Test Coverage : 87 % image

  • 유저(3) :

    • username으로 로그인 시 실패하는 테스트
    • email로 로그인 시 성공하는 테스트
    • JWT Token이 제대로 발급되는지 확인하는 테스트
  • 장바구니(7) :

    • CartViewSet CRUD 확인하는 테스트
    • CartItemViewSet에 제품 추가, 수량조절, 삭제가 정상 작동하는지 확인하는 테스트
  • 주문(2)

    • OrderViewSet Update 실패하는 테스트
    • OrderViewSet에 제품 정보가 잘 포함되는지 확인하는 테스트
  • 상품(5)

    • ProductViewSet CRRUD 확인하는 테스트

🔍 SQL

    일자별 총 매출 = SELECT (date("order".order_date)) AS day, 
                  SUM("order".total_price) AS day_total_sales 
                  FROM "order" 
                  WHERE "order".order_state="주문완료" 
                  GROUP BY day 
                  ORDER BY day ASC

    일자별 제품별 판매수량 = SELECT (date(order_date)) AS day, 
                       "order".product_id, SUM("order".product_quantity) 
                        AS sales_quantity_per_product 
                        FROM "order" 
                        WHERE "order".order_state = "주문완료" 
                        GROUP BY "order".product_id, day 
                        ORDER BY day ASC

    일자별 제품별 매출 = SELECT (date(order_date)) AS day, 
                    "order"."product_id", 
                     SUM("order"."total_price") AS sales_per_product 
                     FROM "order" 
                     WHERE "order"."order_state" = "주문완료" 
                     GROUP BY "order"."product_id", day
                     ORDER BY "day" ASC

API ENDPOINT

accounts - Dj Rest Auth

URL Method Description
api/accounts/password/reset POST 이메일을 통한 사용자 비밀번호 재설정
api/accounts/password/reset/confirm POST 사용자 비밀번호 재설정 및 새로운 토큰 발급
api/accounts/password/change POST 기존 비밀번호를 통해 비밀번호 재설정
api/accounts/login POST 사용자 로그인(토큰 반환)
api/accounts/logout POST 사용자 로그아웃
api/accounts/token/verify POST 토큰 유효성 확인
api/accounts/token/refresh POST refresh 토큰을 통한 access 토큰 재발급
api/accounts/registration POST 사용자 회원가입

cart

URL Method Action Description
api/carts GET List 장바구니 전체 목록 조회
api/carts POST Create 장바구니 생성
api/carts/int:pk GET Retrieve 장바구니 세부내역 조회
  • 그 외 update, destory 불가
URL Method Action Description
api/cart-items GET List 장바구니 상품 전체 목록 조회
api/cart-items POST Create 장바구니 상품 생성
api/cart-items/int:pk GET Retrieve 장바구니 상품 세부내역 조회
api/cart-items/int:pk PUT Update 장바구니 상품 업데이트
api/cart-items/int:pk PATCH Partial_Update 장바구니 상품 세부내역 부분 업데이트
api/cart-items/int:pk DELETE Delete 장바구니 상품 삭제

orders

URL Method Action Description
api/orders GET List 주문서 전체 목록 조회
api/orders POST Create 주문서 생성
api/orders/int:pk GET Retrieve 주문서 세부내역 조회
  • update,delete 불가
URL Method Description
api/orders/summary/v1 GET 요약(SQL)
api/orders/summary/v2 GET 요약 웹페이지 (ORM)

products

URL Method Action Description
api/products GET List 상품 전체 목록 조회
api/products POST Create 상품 생성
api/products/int:pk GET Retrieve 상품 세부내역 조회
api/products/int:pk PUT Update 상품 세부내역 업데이트
api/products/int:pk PATCH Partial_Update 상품 세부내역 부분 업데이트
api/products/int:pk DELETE Delete 상품 삭제

  • API 명세서

  • 배포

    • 서버의 유연성 위해 Azure database for postgresql flexible server(Azure)Amazon Elastic Compute Cloud(Amazon EC2) 이용하여 구현 및 배포

    • 현재는 비용 및 보안 상의 이유로 배포 중단

    • Azure 배포 화면 image

    • Amazon EC2 배포 화면 image


TIL

store-management-service-2's People

Contributors

song-hee-1 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.