Fast API web server and Neo4j Graph Database back-end.
-
Add a dev.ini file inside config folder with following content. Assumption you have a neo4j instance running in background.
[neo4j] uri=<enter_link_to_test_db_here> username=<enter_test_username> password=<enter_test_password>
Or you can use following command to do it. You will have to run this from root folder (i.e. neo4j_python/) of the project.
sh create_dev.sh
Note: This creates a dev.ini file with dummy info. You may want to change this as per your credentials.
In order to setup neo4j database (on linux), use this:
sudo docker run \ --name testneo4j \ -p7474:7474 -p7687:7687 \ -d \ -v $HOME/neo4j/data:/data \ --env NEO4J_AUTH=neo4j/test \ neo4j:latest
Above command creates a
neo4j
docker container exposing ports7474
and7687
, and storing data at path$HOME/neo4j/data
with database username asneo4j
and password astest
. For more info, refer here -
Create a virtualenv, you can use any of your choice. I prefer using virtualenv.
python -m pip install virtualenv python -m virtualenv --python=python
-
Install dependencies using this
pip install -r requirements.txt
-
Run command
uvicorn src.main:app --reload
to start FastAPI webserver.