Skip to content

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

Notifications You must be signed in to change notification settings

dawidjaniga/wikipedia-streams

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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