In this assignment, you need to create a rss processor and deploy it.
- Use Nodejs
- Query hackernews each 5 minutes on https://hnrss.org/newest?points=10 endpoint and send transformed results to elasticsearch server
- Code should be ready to add another rss endpoint with specifics for that endpoint formatter of its data to the structure stored in elasticsearch by using adapter pattern
- Data sent to elastic should use batch API in index “rss_feed”
- Requests logs should be sent to “rss_logs” via post API
- ElasticsearchService api should be extracted into service and use proxy pattern
- Be running in cron
*/5 * * * *
with a fetch backoff strategy of (400ms, 1s, 2s) per each rss endpoints separate. - Use prettier and eslint.
- Have helpful and sane logging.
- You can set up a good environment and the correct data flow.
- A good structure.
- Clean understandable code.
- Use GitHub and break the progress into several commits.
- Don’t reinvent the wheel - Use good libraries where it makes sense.
-
Queries rss endpoint and data is converted into correct structure
- Data is queried from each endpoint one by one
- Each endpoint has assigned formatter
- Rss structure should be like this for any incoming rss feed(formatters should have default values)
type RSS_FEED = { title: string, timestamp: Date, link: string, creator: string, points: number, comments: number }
-
Requests logs are gathered and converted into correct structure
- Each rss request gathers meta information
- This information is gathered and transformed into
type RSS_LOGS = { url: string, request_time: number, amount_returned: number, status: "success" | "failure" }
-
Elastic is configured to accept logs into 2 indexes with non-dynamic mappings
-
Rss feeds and rss logs are sent into related indexes
-
Create dashboard with data charts
- Line chart of amount of post in last 12h per 5 minutes
- Heat map between points and comments
-
Deploy app to fly.io / heroku / other hosting...
-
Bonus (Optional)
- Use typescript to make sure everything has a bit of documentation
- Add visualization (in Kibana or custom UI) of which shared articles domain are most popular(medium etc), required additional fields
- Make sure you have NodeJS and Docker installed on your machine
- Run
npm install
in checkout directory - OPTIONAL: setup
.env
file using provided example - Build TypeScript code using
npm run build
- Build docker containers by running
docker-compose build
- Start docker containers by running
docker-compose up
- Enjoy :)