Skip to content

This service provides an api to store artefacts with their related meta-data and tags and performs machine learning on them

License

Notifications You must be signed in to change notification settings

hpi-sam/ask-your-repository-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Elija · Ask your Repository Backend API

Coverage StatusCode style: black

This repo is part of the "Ask your Repository" Bachelor project containing the following repos:

Setup service

  • If you have docker installed you can simply run docker-compose up -d and skip the rest of this readme.

  • Install Python 3.7:

    • On Windows:
      • Click: Add path
      • At the end of installation allow usage of paths longer than 260 characters
      • See: Setup Python
    • On Unix systems its highly recommended to use pyenv instead for this as it makes swapping python versions much easier.
      You can use the installer from here for easy installation.
  • Installing dependencies: -Setup Poetry:

    • Install Poetry

    • Install dependencies via: poetry install

    • Copy .env.example into new .env file

    • It's highly recommended you have docker installed it makes environment setup much easier: https://www.docker.com/get-started

    • Install Neo4j

      • Neo4J is our GraphDB you can find more info and an install guide on it here: https://neo4j.com/
      • To run tests you need a neo4j installation on the ports specified in .env.testing
      • To simply run the application locally I recommend seting up a docker container with neo4j with this command:
        docker run \
        --publish=7474:7474 --publish=7687:7687 \
        --volume=$HOME/neo4j/data:/data \
        --volume=$HOME/neo4j/logs:/logs \
        neo4j:3.0
        
    • Install Elasticsearch

      • Setup Elasticsearch
      • Don't forget to set JAVA_HOME path to the path of java jdk
      • You can setup a local ES docker container with this command:
        docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:6.5.2
        
  • Setup elasticsearch development and testing

    • Rename config directory to config.development in your elasticsearch installation directory
    • Copy the contents of elasticsearch.example.yml in this repository into elasticsearch.yml in config.development
    • Make a new directory named config.test and copy the contents of config.development into it
    • Edit the elasticsearch.yml by replacing every occurence of development with test and change the port to 9400
    • Start both services by running ES_PATH_CONF=config.development ./bin/elasticsearch-service.bat install elasticsearch-development ./bin/elasticsearch-service.bat start elasticsearch-development and ES_PATH_CONF=config.test ./bin/elasticsearch-service.bat install elasticsearch-test ./bin/elasticsearch-service.bat start elasticsearch-test
    • Unfortunately sometimes a service crashes, then you neet to run both commands again

Install dependencies

  • Run: poetry install

Setup database

  • Install constraints for neo4j for development and testing database (adapt the urls if you have a different setup):
    • Run: poetry run neomodel_install_labels application application.models --db bolt://:@localhost:7687
    • Run: poetry run neomodel_install_labels application application.models --db bolt://:@localhost:17687

Download Wordkit for synonyms

  • Run: poetry run shovel utils.download_wordkit

Running tests

  • Run: poetry run mamba specs

Running linter

  • Run: poetry run black --check .
  • Run: poetry run flake8 ./

Running auto-formater

  • Run: poetry run black .

Autoformating and linting can be automized if you have Pre-Commit installed on user.

Start service

  • Run: poetry run flask run

Documentation

Further documentation can be found in the wiki.

License

This project is licensed under the terms of the MIT license.

About

This service provides an api to store artefacts with their related meta-data and tags and performs machine learning on them

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages