Skip to content

alexkhil/devchallenge-backend-2022

Repository files navigation

DevChallenge 2022 Backend

Table of Content

Summary

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 Person with attributes id and topics
  • Directed Edge of type Trust with attribute level

Run

# Go into the folder with Solution.sln and run
docker-compose up

Expected result run

Service will be available on port 8080. When docker runs open http://localhost:8080/swagger on your browser to see swagger docs and try api.

Test

Requirements to run tests

# Go into the folder with Solution.sln and run
dotnet test Solution.sln

Solution 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: test graph

TODO

  • Rewrite GetBroadcastReceiversAsync method of PeopleRepository to 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_connections endpoint
  • Add unit tests

About

DEV Challenge 2022 C# solution for online round

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published