Skip to content

用于软工三烫烫烫烫的锟斤拷小组的文献平台搜索项目

Notifications You must be signed in to change notification settings

Akihi2021/TTTT-Literature-Search

Repository files navigation

Swagger

Path: http://localhost:5000/v1/swagger Swagger is autogenerated API Document with integrated testing.

  1. All the API's provided are prepended with v1
  2. View the expected payload from front-end & Response Model returned by the backend
  3. Use try it out to test the APIs

NOTE: All Response returned by backend abide the rule below

{
   "code": 200/500.....
   "msg": message as explanation for `data`
   "data": {
               "success": "val1"
               "key1": "val2"
           }

RUN

When run successfully you should see swagger in the path above

Run on local machine

  1. Install Python Interpreter (v3.8)
  2. clone codes

git clone https://github.com/Akihi2021/TTTT-Literature-Search

  1. install requirements

pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple

  1. run project

python entrypoint.py

Run with docker

  1. pull docker image

docker pull vinokkk/tttt:{VERSION_TAG}

  1. run docker image

docker run -it -p 5000:5000 vinokkk/tttt:{VERSION_TAG}

Git Repo

https://github.com/Akihi2021/TTTT-Literature-Search

Dockerhub Repo

https://hub.docker.com/repository/docker/vinokkk/tttt/

Docker Related Questions

Workflow

  • For Developer
  1. Build
  2. Run
  3. Push
  • For User (Front End Developers)
  1. Pull
  2. Run

Docker Pull

docker pull vinokkk/tttt:{VERSION_TAG}

Docker Build

NOTE: need to run in the project root path

docker build -t vinokkk/tttt:{VERSION_TAG} .

Docker Push

docker push vinokkk/tttt:{VERSION_TAG}

Docker Run

docker run -it -p 5000:5000 vinokkk/tttt:{VERSION_TAG}

NOTE:

  1. -p flag binds local port 5000 to the docker container port 5000 which allows us to visit our service with URL localhost:5000
  2. When run successfully, you should see swagger on localhost:5000/v1/swagger

Docker Run With Codes Mounted

docker run -it -p 5000:5000 -v {ABSOLUTE_PATH_OF_YOUR_APP}:/app vinokkk/tttt:{VERSION_TAG}

e.g.

docker run -it -p 5000:5000 -v /Users/kim/Intern/momenta/codes/TTTT-Literature-Search:/app vinokkk/tttt:1.0

NOTE:

  1. -v flag mount our TTTT project to the /app directory of our container.

  2. Since python is a descriptive language, this will allow us to modify our code without having to build docker image each time, simply restart the container will do.

About

用于软工三烫烫烫烫的锟斤拷小组的文献平台搜索项目

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published