Coder Social home page Coder Social logo

compounds's Introduction

Exscientia™ Compounds API

Overview

Web Application

A Java-based web application which provides a CRUD REST API for compounds and their associated assay results. It is backed by an in-memory relational database.

Database

The database schema is generated by the ORM framework (JPA/Hibernate) via annotations in the Java code. The database tables are automatically populated from a SQL population script (src/main/resources/data.sql). Both of the above happen each time the web application starts up. As a consequence, any changes are not persisted between invocations of the web application.

Python (SQL generation) Script

The SQL population script is generated from the provided data/compounds.json and data/schema.json files using a Python script (scripts/json2sql.py). As of this writing, this is done manually, prior to building the application. Note: A pre-generated SQL population script is provided for ease of deployment.

See the Usage section below for build and run instructions.

Notable Features

  • Dockerisation (we use Docker™ containers to build and run the web application)
  • Integration tests (to test the API's web-service endpoints)
  • Swagger (provides a web-based interface to the API for testing and comprehension)
  • Pageable (optional endpoint with paging metadata provided for Compound collections)

Usage

Working from the root directory of the project, instructions are as follows:

  1. Execute the build script (this may take a few minutes the first time you run it)

  2. Execute the run script to start the web application

    ./scripts/build.sh ./scripts/run.sh

You can exercise the web-service endpoints by navigating your browser to: http://localhost:8080/swagger-ui/

Alternatively, you can use the supplied "collection" file (./postman_collection.json) in Postman™ to try it out from there.

Future Improvements

  • Data validation on POST and PUT operations
  • Implement filtering and ordering features
  • Make the API more "hypermedia-driven" by following HATEOAS principles in the API design
  • Improve automation by moving database script generation into the Docker™ configuration
  • One or two of the (ORM) auto-generated SQL queries are inefficient and should be optimised
  • The integration tests are nowhere near complete but hopefully demonstrate the general approach
  • The Python script (json2sql.py) is obscenely hard-coded and non-intuitive but served its purpose at the time
  • The Swagger API documentation could be prettier and more helpful

compounds's People

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.