/graph

Primary LanguagePHP

Graph

A web service that provides an API for clients to run algorithms and perform updates on the graphs.

Features

  • Uses Slim as the application Framework.
  • Uses Mysql and Doctrine for storing and querying data.
  • Uses PHP-DI
  • Uses symfony/console
  • Uses PHP dotenv

Prerequisites

1- Setup Using Makefile and docker

  • Run the app using make up
  • Hit localhost:8080.

2- Or Follow steps

  • Create your .env file.
  • RUN composer install
  • RUN to create schema ./vendor/bin/doctrine orm:schema-tool:update --force --complete
  • RUN to seed database ./vendor/bin/doctrine dbal:import ./.sql/db_seed.sql
  • RUN docker-composer up -d
  • Hit localhost:8080.

Endpoints

Run Algorithms

(i.e: run make fixtures first')

  • Depth first search make DFS
  • Breadth first search make BFS

Run Tests

  • make test

Done

  • Graph CRUD
  • Nodes CRUD.
  • Edges CRUD
  • Algorithms: DepthFirstSearch
  • Algorithms: BreadthFirstSearch
  • Add Commands for each algorithm
  • Setup docker
  • Add at least one Test class.

To Do

  • Handle directed graphs and loops
  • Create factories for create un/directed graph or edge
  • Add more algorithms implementations.
  • Add more test coverage.