/wikipedia-streams

Discover the pace Wikipedia is developed. Uses React, Factory Pattern and Server-Sent events for the stream.

Primary LanguageTypeScript

Wikipedia Streams

Netlify Status

Live demo

https://wikipedia-streams.netlify.app

Showcase

Wikipedia Streams showcase

Rationale

I've created this project as programming excercise. I wanted to practice usage of Factory Method pattern in React world.

The idea is to show list of recent changes made on Wikipedia in Real Time. Wikipedia provides messages stream with type (edit, new, categorize, log). Every type can have different data and we might want to add different behaviour for them (like onNotificationClick, onUserClick etc). NotificationsFactory is used to achive the above, via creation of Notification components, based on type.

Messages are sent from Wikipedia in one-way stream, called Server-sent event. It operates on HTTP and use EventSource in the browser for receiving data.

More info

https://en.wikipedia.org/wiki/Factory_method_pattern
https://sourcemaking.com/design_patterns/factory_method
https://en.wikipedia.org/wiki/Server-sent_events
https://developer.mozilla.org/en-US/docs/Web/API/EventSource
https://wikitech.wikimedia.org/wiki/Event_Platform/EventStreams