Giter Club home page Giter Club logo

top-k-words's Introduction

top-k-words

Web app that takes a text file and finds the top K most frequent words.

Requirements:

  • Java 17
  • Spring Boot 3

How to build app & run unit tests:

cd top-k-words
./gradlew clean build

How to run the app:

cd top-k-words
./gradlew run

How to test the app locally:

Postman could be used for friendly UI, but the instuctions are provided for CURL just to make testing simple ๐Ÿ™ƒ

Try send GET reqiest to default "hello" endpoint / to verify that the app is running at localhost:8080:

curl -X GET http://localhost:8080/

Then you need to authenticate using /auth/login endpoint:

The only credentials allowed are

curl -X POST http://localhost:8080/auth/login \
    -H 'Content-Type: application/json' \
    -d '{"email":"[email protected]","password":"test"}'

The responce should be in the following format:

{"token":"JWT_TOKEN"}

Using the JWT token, you can access /api/topk/analyze endpoint:

curl -X POST http://localhost:8080/api/topk/analyze \
    -F "[email protected]" -F "k=10" \
    -H "Authorization: Bearer JWT_TOKEN"

Feel free to experiment with the file content and K parameter.

NOTE!

3 sec delay was added to the file analysis to demonstrate caching impact on the app performance! Call /api/topk/analyze endpoint second time with the same parameters (same K value and same file content) to test caching.

top-k-words's People

Contributors

artemiiustiukhin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.