Skip to content

prohunterallen/thelibrarian

Repository files navigation

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads CircleCI Coverage Discord Backers on Open Collective Sponsors on Open Collective Support us

Description

Nest framework TypeScript starter repository.

Installation

$ yarn install

GUI API

PostMan Collection download

Running the app

# development
$ yarn run start NODE_ENV=development

# watch mode
$ yarn run start:dev NODE_ENV=development

API Member Section

#Add Member
POST => /api/member/add
{
    "username": "test3",
    "password": "11111111",
    "name": "Jhone Doe",
    "email": "[email protected]"
}

#Login Member
POST => /api/member/login
{
    "username": "test2",
    "password": "11111111"
}

#Show All Member filtering by pagination and keywords
GET => /api/member?keyword=<name||username||memberNo>&page=1&pageSize=10
#possible to searh all of Fullname, Username and Member Number

#Get Profile by ID
GET => /api/member/<id>

#Updat profile by ID
PUT => /api/member/<id>
{
    "name": "Rimuru Tempest",
    "email":"[email protected]"
}

#Update Password
PUT => /api/member/password/reset/<id>
{
    "current":"22222222",
    "new":"11111111",
    "confirm" : "11111111"
}

#Toggle Suspended Account
PUT => /api/member/<id>/suspended/toggle/

#Delete Member
DELETE => /api/member/delete/<id>
{
    "password":"11111111"
}

#Update Profile Images
PATCH => /api/member/<id>/profile-image
{
  "image": file.path
}

API Books Section

#Get All books by conditions
GET =>/api/books/keyword=<title|isbn|author>?page=1&pageSize=10&orderby=stock&sorting=desc

#Add New Book
POST =>/api/books/add
{
  "title": "Harry Potter",
  "author": "JK Rowling",
  "isbn": "ISB123123123",
  "qrCode": "asdfasdfasdfasdf",
  "barcode": "123123123123",
  "price": 590.00,
  "stock": 10,
  "category": "novel"
}

Requirement

  • NestJS Microservice ✅
  • MongoDB ✅
  • Redis

#1.1 ออกแบบระบบร้านหนังสือ โดยมี service

  • User Service
  • Book Service

#1.2 ออกแบบ Features ของ User Service

  • เพิ่ม / ลบ / แก้ไขข้อมูล User ✅
  • แสดงรายการ User แบบ pagination ( สามารถ filter ตามชื่อผู้ใช้งาน , ชื่อ - นามสกุล ได้ ) ✅
  • แสดงรายการ User สามารถแสดงจำนวนหนังสือทั้งหมดที่แต่ละ user ซื้อไปได้
  • แสดงรายการ User สามารถแสดงวันที่ซื้อหนังสือล่าสุดของแต่ละ user ได้
  • ระบบ Login (เมื่อมีการล็อคอินผิดพลาด 3 ครั้งจะถูกระงับ 10 วินาที)
  • ระบบรายงานจำนวนสมาชิกใหม่
  • ระบบรายงานจำนวนสมาชิกที่เข้าใช้ระบบ
  • ระบบเปลี่ยน Password ✅
  • Change Profile Image ✅
  • JWT ✅
  • ระงับการใช้งาน User ✅

#1.3 ออกแบบ Features ของ Book Service ดังนี้

  • เพิ่ม ✅ / ลบ / แก้ไขข้อมูล Book
  • แสดงหนังสือ ( filter ตามหมวดหมู่ , เรียงลำดับหนังสือที่เหลือมาก - น้อย , ราคาต่ำ - สูง ) ✅
  • ระบบบันทึกการซื้อหนังสือของ user
  • ระบบรายงานหนังสือที่ถูกขายในแต่ละหมวดหมู่ ,จัดอันดับหนังสือที่ถูกขายเยอะที่สุด , หนังสือที่ใกล้จะหมด
  • ระบบจัดอันดับผู้ที่ซื้อหนังสือ จำนวนกี่เล่ม แบ่งเป็นหมวดหมู่ละกี่เล่ม ราคาเท่าไหร่
  • User ที่ถูกระงับการใช้งานจะไม่สามารถซื้อหนังสือได้

#Optional

  • Book's images cover or preview
  • ระบบรายงานสามารถระบุวันเวลาที่ต้องการได้ หรือ เลือกเป็นรายวัน / เดือน / ปี

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published