Coder Social home page Coder Social logo

metabolights_api's Introduction

metabolights_api

Instructions to Setup

There are two ways to setup this app. The first way is simple using docker. The second way may be complex without docker

Method 1: Using Docker (Recommended)

  • Install Docker and docker compose on your system
  • clone this repo
  • go to the root of the app and type:
    docker-compose build
    docker-compose up

Everything should hopefully work. If things dont work, feel free to shoot an email

Method 2: Without Docker

  • use python 3.7 to create a virtual env
  • clone this repo
  • install the requirements using the requirements.txt file
  • Make sure you have postgres installed in your system
  • if you have problems setting up postgres, use sqlite(you will have to edit the settings)

Loading fixture data

There is some data which I have provided as initial data. Use the following command to import data:

docker-compose run app sh -c "python manage.py loaddata fixtures/initial_data.json"

Running the project

There are 2 parts to run the project. The first is running the tests and the second is running APIs.

Running tests

To run tests

docker-compose run app sh -c "python manage.py test"

Kindly note that, the coverage is not 100% currently, I had to skip up tests for file upload because of time constraint

APIs

Accessing the APIs is very easy. You can use django rest framework's swagger to do API operations. Do the following to access the API:

  • Start the container if not already running
docker-compose up
  • List All studies localhost:8000/api/study/

  • Study Detail localhost:8000/api/study/1

  • Create study: Go to localhost:8000/api/study/ and use the HTML form to create a new study

  • List all StudyFiles localhost:8000/api/study/studyFile

  • If study file doesnt exists localhost:8000/api/study/studyFile and use the HTML form to upload a new studyfile The size limit is 1MB and only text and csv files are allowed

  • Filter study files by study id localhost:8000/api/study/studyFile?study=1

Apart from these feel free to do similar operations on Authors, Keyword and Publications: localhost:8000/api/author/ localhost:8000/api/study/keywords localhost:8000/api/study/publications

metabolights_api's People

Contributors

dollardhingra avatar

Watchers

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