Skip to content

Commit

Permalink
Update README for how to start the app with Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
madmikeross committed Dec 23, 2023
1 parent a821570 commit 0638e68
Showing 1 changed file with 10 additions and 22 deletions.
32 changes: 10 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,19 @@
An application for finding optimal routes between systems in EVE Online.

## How to use
### Pre-requisites
You will need a locally installed neo4j service. User and pass should be `neo4j` and `neo4jneo4j` respectively, or
change them yourself in `main.rs` as they are temporarily hard coded for convenience. After installing neo4j, you need
to install the data science library. Follow these [installation instructions](https://neo4j.com/docs/graph-data-science/current/installation/neo4j-server/).

In order to build the application and run it, you will need to [install Rust](https://www.rust-lang.org/tools/install).
### Running with Docker
Make sure you have Docker engine installed, then run `docker compose up`. This should build a container for Neo4j,
install the graph-data-science plugin, and also build a container for the eve-graph app.

### Building the database
Run the crate `cargo run` to start a local web server at `127.0.0.1:8008`. Next you need to pull down the public system
stargate and wormhole data with a series of requests (you can use Postman to issue POST requests if you prefer a gui).
```bash
curl -X POST 127.0.0.1:8008/systems/refresh
curl -X POST 127.0.0.1:8008/stargates/refresh
curl -X POST 127.0.0.1:8008/wormholes/refresh
```
These requests should each take a few seconds to complete, but if you are waiting minutes, something has gone wrong.
### Collecting data
You need to exercise the system refresh, stargate refresh, and wormhole refresh endpoints to hydrate the database
with data on first run. Also, every time you restart the database, the in memory "graph" of data that the gds plugin
uses will need to be rebuilt, calling to refresh wormholes also refreshes this "graph" (and you should call to refresh
wormholes regularly).

### Finding the shortest route
If you want to find the shortest route between two systems, say Cleyd and Jita, simply issue a get request to
`127.0.0.1:8008/routes/Cleyd/to/Jita` (can be done in a browser, with curl, or via Postman).
`127.0.0.1:8008/routes/Amarr/to/Jita` (can be done in a browser, with curl, or via Postman).

### Finding a safe route
In game, you can route via only high security systems, while this may seem safe, you can always be attacked in game.
Expand All @@ -38,9 +31,4 @@ Next, you need to build the `jump-risk` graph in neo4j. Refer to the `build_jump
module for the query you should run. Last, you need to run a query similar to the `find_shortest_route` function in the
database module with a couple modifications in order to find the safest path. Simply substitute `jump-risk` for
`system-map` and `risk` for `cost` (and put in your source and destination system names) and you should have a "safe" route
which is also likely shorter than the high sec route.

### Running with Docker
A fully functioning docker build for the app is not yet complete. Neo4j will come up, but we still need to install the
data science plugin. The app will start, but requests to ESI from within the container are completing too quickly, and
better logging needs to be added to debug the issue further.
which is also likely shorter than the high sec route.

0 comments on commit 0638e68

Please sign in to comment.