Web service implemented using .Net. Asp.Net Core was used as a web framework. Neo4j was used as a persistent storage due to access patterns described by task. It's hard to think about better option that graph database for this particular scenario. There are two types of objects used in database:
- Vertex of type
Personwith attributesidandtopics - Directed Edge of type
Trustwith attributelevel
# Go into the folder with Solution.sln and run
docker-compose upService will be available on port 8080. When docker runs open http://localhost:8080/swagger on your browser to see swagger docs and try api.
Requirements to run tests
# Go into the folder with Solution.sln and run
dotnet test Solution.slnSolution covered with component tests which spins up Neo4j db in container and Asp.Net Core Web Api in memory.
GraphBuilder was created to simplify graph creation during on component test which also make it visual event in code. Checkout BroadcastMessageEndpointTests.cs
Example of one of the graphs generated by one of the component tests:
- Rewrite
GetBroadcastReceiversAsyncmethod ofPeopleRepositoryto use Neo4j native implementation of BFS as a result redundant allocation will be avoided and method will be simplified - Fix open api for
/api/people/{personId}/trust_connectionsendpoint - Add unit tests

