This repo is part of the "Ask your Repository" Bachelor project containing the following repos:
- Elija - Ask your Repository Backend API
- Jona - Ask your Repository Web Frontend
- Tobito - Ask your Repository Dialogflow Adapter
- Ask your Repository Docker Deployment
- Ask your Repository Project Documentation
-
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.
- On Windows:
-
Installing dependencies: -Setup 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
andES_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
- Run:
poetry install
- 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
- Run:
- Run:
poetry run shovel utils.download_wordkit
- Run:
poetry run mamba specs
- Run:
poetry run black --check .
- Run:
poetry run flake8 ./
- Run:
poetry run black .
Autoformating and linting can be automized if you have Pre-Commit installed on user.
- Run:
poetry run flask run
Further documentation can be found in the wiki.
This project is licensed under the terms of the MIT license.