GithubHelp home page GithubHelp logo

book-store-backend's Introduction

Hi there ๐Ÿ‘‹

book-store-backend's People

Contributors

dravog7 avatar megajith avatar

Watchers

 avatar  avatar

Forkers

megajith

book-store-backend's Issues

Wishlist,Orders and Coupons

Many to Many

  • Wishlist (create,list,delete)
    • userId
    • title
    • manytomany(bookId)
  • Order (create,list,update)
    • userId
    • address
    • couponId
    • status ("in-progress","placed","cancelled") (enum type)
    • manytomany(bookId)
  • Coupon (create,list)
    • couponId
    • code
    • expiry

NOTES

  • only admin can list coupons

  • user can search for a particular coupon code

  • Order status should be a string when outputted from controller as JSON

  • Orders once placed

    • cannot add books
    • cannot change coupon
    • cannot edit address
    • can be cancelled

DB Design

Models

  • User (create,list,update,delete) docs
    • username
    • password
    • role (user/admin)
  • Category (create,list,update,delete)
    • CategoryId auto
    • CategoryName varchar(100)
    • Description varchar(500)
    • Image
    • Status boolean
    • Position int (used to sort)
    • CreatedAt datetime
  • Book (create,list,update,delete)
    • BookId auto
    • CategoryId foreign key
    • Title varchar(100)
    • ISBN (long number)
    • Year int
    • Price float
    • Description varchar(500)
    • Position int
    • Status boolean
    • Image
    • createdAt datetime (to show latest books)

Many to Many

  • Wishlist (create,list,delete)
    • userId
    • title
    • manytomany(bookId)
  • Order (create,list,update)
    • userId
    • address
    • couponId
    • placed boolean (denote if order been placed)
    • manytomany(bookId)
  • Coupon (create,list)
    • couponId
    • code
    • expiry

NOTES

  • CodeFirst database setup

Books and Categories

book and category webAPI setup (model and controller)

  • Category (create,list,update,delete)
    • CategoryId auto
    • CategoryName varchar(100)
    • Description varchar(500)
    • Image
    • Status boolean
    • Position float (used to sort)
    • CreatedAt datetime
  • Book (create,list,update,delete)
    • BookId auto
    • CategoryId foreign key
    • Title varchar(100)
    • ISBN (long number)
    • Year int
    • Price float
    • Description varchar(500)
    • Position float
    • Status boolean
    • Image
    • createdAt datetime (to show latest books)

NOTES

  • Position is a float instead of int to allow easy arrangement,
    Example: say books A,B,C have positions 1,2,3 respectively and admin wants to put C in between A and B. we can set C = A+B/2 = 1+2/2 = 1.5

  • Should allow sorting by position in List View

  • admin only create,update and delete access (Authorize with role admin Attribute)

  • Should allow filtering by categoryId in books controller list View

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.