Good News is a web application that showcases positive news around the world.
This project was developed thanks to the amazing idea by Angie Byron for the MongoDB World Hackathon and the motive was simple - modern news is chiefly depressing and vastly filled with negativity, so why don't we create an application that displays just the good things going on in the world?!
The overall objective of this project is hence to change the user's focus to the ray of sunshine in a world that seems to be blinded by the dark clouds.
The 'goodnews' application displays news with a higher average tone which implies relative positivity and also significant impact using the GoldsteinScale.
For details on the average tone and Goldstein Metrics see the GDELT Event CodeBook
For limitations based on this project's usage of these metrics, see Limitations
This project's source of news is the GDELT dataset which is a Global Dataset of Event, Languages and Tones. This dataset covers news from every country in the world with a reach of over a 100 languages!
More information on the GDELT dataset here
- Frontend
- React
- Bootstrap
- Backend
- Node.js
- Express
- MongoDB
- Atlas
- Realm Functions
- Realm Triggers
- Charts
- Mongoose ODM For more information on what these technologies are used for in this project, check the technologies details section
.
├── .vscode/ - Visual Studio Code configuration files
├── backend/ - Backend App
│ ├── routes/ - Handles API calls for routes
│ ├── scripts/ - scripts to publish
│ ├── app.js - Adds middleware to the express server
│ ├── constants.js - Defines the constants for the endpoints and port
│ └── server.js - Configures Port and HTTP Server
├── frontend/ - Frontend App
│ ├── public/ - public static files
│ ├── scripts/ - scripts to publish
│ ├── src/ - react app folder
│ │ ├── components - React components for each page
│ │ ├── App.js - React routing
│ └─└── index.js - React root component
└── README.md
The frontend is based on create-react-app.
The most important scripts in the package.json
are:
- start: serves the frontend in development on http://localhost:3000/.
- build: Builds the app for production to the
build
folder. - publish: Builds the app for production and moves the output to the
publish
folder. - test: Launches the test runner in the interactive watch mode.
To start the frontend application manually:
- Open a terminal and navigate to the
frontend
folder path. - Use
yarn install
ornpm install
to install frontend dependencies. - Use
yarn start
ornpm start
to start frontend app in development.
The backend is based on Express Generator.
The most important scripts in the package.json
are:
- start: serves the backend in development on http://localhost:3001/.
- publish: copies the backend files to the
publish
folder.
To start the backend application manually:
- Open a terminal and navigate to the
backend
folder path. - Use
yarn install
ornpm install
to install backend dependencies. - Use
yarn start
ornpm start
to start backend app in development.
This project makes use of the Average Tone metric from the GDELT dataset to display positive news.
However, in GDELT 2.0's Global Knowledge Graph there are more specific tones which might yield better accuracy in identifying and displaying positive data, but the process of getting this GKG data from the GDELT dataset, writing a new field file, reshaping, and working with afore-mentioned data is beyond the scope of this hackathathon.
Below are a few possible features that if added, would improve this project
- A search bar (based on Atlas search) for searching for positive news about a particular subject (puppies?)
- Based on the original idea, a mobile app which notifies users of occassional good news updates.
Contributions are welcome and usage of the project is guided by the attached License .
-
Realm Triggers - this project makes use of scheduled mongoDB Realm Triggers to update the events collection with recent data from the GDELT dataset (which is updated every 15 minutes).
-
Realm functions - these are serverless functions that operate on data directly in the project's Atlas clusters.
- The serverless functions used for this project are responsible for handling the updating of the collection with recent gdelt data and also the fetching and updating of the collection's data with metadata information (this last feature of the function was still a work-in-progress as at the time of this edit).
- See this video and this repo for details on how this works.
- Also note this discussion on the MongoDB forum for a fix on the function.
-
Charts - MongoDB Charts provide an easy-to-use means of visualising data which is interactive and updates periodically based on changes in the data source.
- This project uses MongoDB Charts to visualise data in interesting formats such as goodnews per day, total goodnews per country, and two geo-spatial representations of goodnews data in countries.