Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Spring Boot Neo4j Shortest Path

NotificationsYou must be signed in to change notification settings

Rapter1990/SpringBootNeo4jShortestPath

Repository files navigation

Main Information

📖 Information

  • Its aims to calculate the shortest path in terms of total connection and duration between two nodes
  • Here is the explanation of the project
    • Implement the process of CRUD for both City and its Route
    • Use Dijkstra Single-Source Shortest Path algorithm supported by Neo4j to calculate the path

🔨 Run the App

Maven>

1 ) Download Neo4j Desktop 1.4.15

2 ) Create a new Project and then create a new local dmbs with its version 4.2.1

3 ) Click Start Button

4 ) Download your project from this linkhttps://github.com/Rapter1990/SpringBootNeo4jShortestPath

5 ) Go to the project's home directory :cd SpringBootNeo4jShortestPath

6 ) Create a jar file though this commandmvn clean install

7 ) Run the project though this commandmvn spring-boot:run

Docker

1 ) InstallDocker Desktop. Here is the installationlink :https://docs.docker.com/docker-for-windows/install/

2 ) OpenTerminal underresources folder to runNeo4j onDocker Container

    docker-compose up -d

3 ) OpenNeo4j Browser in the brower

    http://localhost:7474/browser/

4 ) Rebuild image app if necessary

    docker build -t springbootneo4jshortestpath .

Explore Rest APIs

MethodUrlDescriptionValid Request BodyValid Request ParamsValid Request Params and BodyNo Request or Params
GETgetCityByIdGet City By IdInfo
GETgetAllCitiesGet All CitiesInfo
GETgetCityByNameGet City By NameInfo
POSTcreateCityCreate CityInfo
PUTupdateCityUpdate CityInfo
DELETEdeleteCityDelete CityInfo
GETgetByRouteIdGet Route By IdInfo
GETgetAllRoutesGet All Routes By City IdInfo
POSTcreateRouteCreate Route by City Id and Destination City IdInfo
PUTupdateRouteUpdate Route by City Id and Destination City IdInfo
DELETEdeleteRouteDelete Route By City Id and Route CityInfo
GETgetShortestPathGet Shortest Path by Total ConnectionInfo
GETgetShortestPathInTimeGet Shortest Path by Total HoursInfo

Used Dependencies

  • Spring Boot Web
  • Spring Boot Test
  • Neo4j
  • Docker
  • Mapper

Valid Request Body

    http://localhost:8077/api/v1/city    {        "name" : "İstanbul"    }
    http://localhost:8077/api/v1/shortestpath/shortest-path    {        "from" : "İstanbul",        "destination" : "Ankara"    }
    http://localhost:8077/api/v1/shortestpath/shortest-path-in-time    {        "from" : "İstanbul",        "destination" : "Ankara"    }

Valid Request Params

    http://localhost:8077/api/v1/city/id/{cityId}
    http://localhost:8077/api/v1/city/name/{cityName}
    http://localhost:8077/api/v1/city/{cityId}
    http://localhost:8077/api/v1/route/{routeId}
    http://localhost:8077/api/v1/route/{cityId}/routes
    http://localhost:8077/api/v1/route/{cityId}/routes

Valid Request Params and Body

    http://localhost:8077/api/v1/city/{cityId}    {        "name" : "Ankara"    }
    http://localhost:8077/api/v1/route/{cityId}/{destinationCityId}/create-route    {        "from" : "İstanbul",        "destination" : "Ankara",        "departureTime" : "9:00",        "arriveTime" : "11:30"    }
    http://localhost:8077/api/v1/route/{cityId}/update-route/{routeId}    {        "from" : "Ankara",        "destination" : "Antalya",        "departureTime" : "9:00",        "arriveTime" : "11:00"    }

No Request or Params

    http://localhost:8077/api/v1/city/cities

Screenshots

Click here to show the screenshots of project

Figure 1

Figure 2

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp