DevChallenge XVII. Backend Online Round
https://github.com/alexandear/article-similarity.git
HTTP server to store and search similar articles.
Run server and storage containers with Compose:
docker-compose up
API is accessible via http://localhost:80/.
API's description is in the docs/API file.
Additionally, server serves HTML documentation. Run docker-compose up and visit http://localhost:80/docs.
To find similarity between the content of articles used Levenshtein algorithm for words. Before Levenshtein algorithm is applied content preprocessing:
a, an, the and punctuation .,!?-; \t\n\r;See SCALEME file.
There are HTTP server written on Golang and mongodb storage.
Prerequisites:docker,docker-compose,go@1.15,makemust be installed.
Consistent code style enforced by gofmt, EditorConfig tools and golangci-lint linter.
Format code:
make format
Run linter:
make lint
There are unit and integration tests. Unit tests placed in _test.go files,
end-to-end in test directory.
Run unit tests:
make test
End-to-end test suite builds server from sources, runs docker-compose up and perform requests to server container.
It can be executed:
make test-it
Build docker image article-similarity:latest:
make docker
Build, run linter and tests in dev docker image article-similarity-dev:latest:
make docker-dev
There are configured GitHub actions for build, lint, run unit and integration tests. See .github/workflows directory.