book-store-backend's Introduction
book-store-backend's People
Forkers
megajithbook-store-backend's Issues
Wishlist,Orders and Coupons
- 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)
- 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
Orders: adding quantity to each item
This requires additional field in the ManyToMany autogenerated table "OrderBooks".
Find a way to implement same using code first
Authentication
Setup token based authentication with user and admin roles
- User docs
Books: Setting up authorize attributes
Assign correct Auth attributes to Book and Category API
Books: Incorporate sortBy and filtering in Books/Category
- SortBy
- position
- createdAt
- Filters
- status
- title (using LIKE case insensitive) (ideally split by space , LIKE a1 or LIKE a2 ...)
- ISBN (full)
- categoryId
- Author
Auth: Deactivate/activate users
- Admin only access
- Deactivate/activate accounts of users
Books: Image Upload and serving
setting up uploading for image files corresponding to each book or category
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
Auth: List of users for admin
Route to List users for admin
Auth: adding extra data into /Token route return
/Token return should contain the role names of logged in user to decide on level of access
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.