Inspired by the project https://github.com/FudanSELab/train-ticket which is a train ticket booking system based on microservice architecture which contains 41 microservices.
The goal of this project is to create a RESTful API for querying a system architecture, loaded from a provided JSON file. The API should provide a way to filter the routes between the service.
The provided JSON file contains a list of "nodes" which are individual components of the system, along with their properties such as their name, kind (whether it is a service or a database, for example), language, path, and whether it is publicly exposed. Some nodes also have a "vulnerabilities" section which lists potential security issues, including the file name and severity level of each vulnerability.
In addition, there are "edges" which represent the connections between the nodes. Each edge specifies the starting node and the ending node or nodes it connects to.
- TypeScript
- Node.js - Express
- Neo4J
- Docker
- Node.js
- Neo4J
- Docker Compose
- Clone the repository:
git clone https://github.com/yahavamar/TrainTicket.git
- Navigate to the project directory:
cd TrainTicket
- Build and start the Docker containers:
docker-compose up -d
- Install the dependencies:
npm install
To run the application, execute the following commands:
npx tsc
The compiled files will be located in the dist directory.
npx ts-node-dev dist/server.js
The application will start running on http://localhost:3000.
Navigate to http://localhost:3000/graphql.
-
returnAllRoutesEndsInSink
- Get list of GraphPath object contains all the routes that ends in Sink. -
returnRoutesContainsVulnerabilities
- Get list of GraphPath object contains all the routes that have vulnerabilities. -
returnAllPathsFromPublicExposedToSink
- Get list of GraphPath object contains all the routes that start in a public service and ends in Sink.
{
returnAllRoutesEndsInSink {
source
dest
segments {
source {
name
kind
}
dest {
name
kind
}
}
}
}