Giter Site home page Giter Site logo

geekyserver's Introduction

Installation

git clone https://github.com/beckachuu/temp-backend.git
cd temp-backend
pip install -r requirements.txt
python Geeky.py

Port: 5000


Database diagram:

db_diagram


URLs:

(Fields that aren't mandatory: still need to be included, values can be set to null)

  • GET /login
  • GET /logout

Account APIs

  • GET /my_account
  • POST /my_account: edit user info

JSON structure: { "username": string, "name": string, "phone": string, "profile_pic": string, "theme": int (0 or 1), "receive_email": int (0 or 1) "bio": string }

  • DELETE /my_account
  • GET /my_notification

Ratings APIs

  • GET /my_ratings
  • POST /my_ratings

JSON structure: { "book_id": int (mandatory), "stars": int (mandatory), "content": string }

  • PUT /my_ratings : edit rating

JSON structure: same as above

  • DELETE /my_ratings?book_id={int}: remove user rating from a book (admin only)

Collections APIs

  • GET /my_collections/all
  • POST /my_collections/{string:collname}

JSON structure: { "books": int[] (mandatory) }

  • PATCH /my_collections/{string:collname}?new_name={string} : rename collection
  • PUT /my_collections/{string:collname}?book_id={string} : remove book from collection
  • DELETE /my_collections/{string:collname}

Admin APIs

  • GET /user_list
  • POST /change_role?username={string}&user_role={int} (0: normal user, 1: admin)
  • POST /ban_user?username={string}&restrict_due={datetime} (restrict_due format: Year-Month-Day Hour:Minute:Second)

Books APIs

  • GET / : main page (not finished)
  • GET /books/search?query={string} : search books by authors or books name
  • GET /books/search_image?query={image url} : search books by image! :3
  • GET /books/filter : filter books

Params (no param is mandatory): { "genres": strings (each string separated by a comma), "sort_by_year": 'asc'/'des', "min_rating": int, "min_pages": int, "max_pages": int }

  • GET /books?book_id={int} : get detail info of a book
  • POST /books : post a new book (admin only)

JSON structure: { "title": string (mandatory), "translator": string, "cover": string, "page_count": int (mandatory), "public_year": int (mandatory), "content": string (mandatory), "descript": string (mandatory), "republish_count": int, "genres": string LIST (mandatory), "authors": int LIST (for author_id) (mandatory) }

  • PUT /books : change detail for a book (admin only)

JSON structure: same as above, plus "book_id" (POST /books), no field is mandatory

  • DELETE /books?book_id={int}

Bookmarks and Notes APIs

  • GET /my_bookmark?book_id={int} : get bookmark or note
  • POST /my_bookmark?bm_name={"bookmark"/"note"}&state

JSON structure (for update bookmark): { "book_id": int (mandatory), "line_pos": int } JSON structure (for update note): { "book_id": int (mandatory), "content": string }

  • DELETE /my_bookmark?book_id={int}&bm_name={"bookmark"/"note"} : delete bookmark or note

Authors APIs

  • GET /authors/search?query={string}
  • GET /authors?author_id={int}
  • POST /authors

JSON structure: { "author_name": string (mandatory), "bio": string, "social_account": string, "website": string, "profile_pic": string, "quote": string }

  • POST /subscribe?author_id={int}
  • DELETE /subscribe?author_id={int} : unsubscribe

geekyserver's People

Contributors

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