Giter Site home page Giter Site logo

innovaccer-hackercamp-19's Introduction

Assignment for SDE - Intern (Applications)

Project is based on SandBox API of ApiMedic API.

Installation

  1. Clone the repository using git clone and then change the directory to root of the project
git clone https://github.com/ays14/innovaccer-hackercamp-19.git
cd innovaccer-hackercamp-19
  1. Create .env file as per the sample EXAMPLE.env file in the root of your project. The username and password are the credentials for Sandbox Api for ApiMedic API. These credentials are API keys and can be found here. Please make an account here, if you don't have one to get your API keys.

Lines beginning with '#' are comments and are not required in .env By default, the working environment, 'env' is set equal to 'development'

  1. If you are working behind a Proxy Server then uncomment all the proxy blocks in the code and configure proxy configuration in .env.

Which blocks in code are to be uncommented? This is answered in Proxy Setup

  1. Use npm or yarn to install dependencies for the project
yarn

OR

npm install
  1. Make sure, MongoDB is running at your configured db_url in .env file. If not installed, then install from here

  2. Run the program either by npm or yarn using

yarn start

OR

npm start

yarn startDev or npm startDev script is for starting with nodemon.

The console logs the following if the app is running properly

[Database] 	Connected to database at: mongodb://localhost:27017

Project Folder Structure

Note: The folder tree does not include sub-directories for common/generated folders. For example - node_modules.

  • Sub-directories of the folders marked with ' * ' are not shown for clarity.
  • Folders are typed in bold
─── innovaccer-hackercamp-19
    ├── app.js
    ├── bin
    │   └── www
    ├── config.js
    ├── docs
    │   ├── api_data.js
    │   ├── api_data.json
    │   ├── api_project.js
    │   ├── api_project.json
    │   ├── css*
    │   ├── fonts*
    │   ├── img*
    │   ├── index.html
    │   ├── locales*
    │   ├── main.js
    │   ├── utils*
    │   └── vendor*
    ├── EXAMPLE.env
    ├── .env
    ├── .git*
    ├── .gitignore
    ├── models
    │   └── Conditions.js
    ├── node_modules*
    ├── package.json
    ├── public*
    ├── README.md
    ├── routes
    │   └── apiRoutes.js
    ├── services
    │   ├── index.js
    │   └── scrapper
    │       └── index.js
    └── views*
    ├── yarn-error.log
    └── yarn.lock

APIs

The project has 4 endpoints mounted at {server_ip}/ namely -

  1. Symptoms
  2. Diagnosis
  3. ConditionInfo
  4. MedicationInfo

Note: The project is completed while working behind a proxy server. There may be some proxy configuration in API Docs, which can be simply ignored for non-proxy server environment. It is mandatory for MedicationInfo, to be called after ConditionInfo has been called with same query.


Because sometimes NightmareJS instance doesn't destroy completely on slow web-servers, which it is trying to scrap. A request timeout may happen without launching Nighmare instance. This issue is being addressed by NighmareJS developers.

By default, NightmareJS instance's show property is set to true. This asks NightmareJS to load a GUI instance of the browser. It can be set to false in services/scrapper/index.js -> Line: 22

In the case, when either of the 'ConditionInfo' or 'MedicationInfo' show request timeout,

Please restart the server

and execute the same query then it will work fine.


The documentation regarding all of the four above listed APIs can be found at API Docs or in the docs/index.html where docs is a folder in the project.

Proxy setup

The code blocks to uncomment are commented with the line --> Uncomment for Proxy Setup <--

The line numbers for files are listed below

innovaccer-hackercamp-19's People

Contributors

ays14 avatar

Watchers

James Cloos 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.