Giter VIP home page Giter VIP logo

newsgpt's Introduction

This repository is outdated. Please see an updated version of NewsGPT here: https://github.com/parsaghaffari/newsgpt-streamlit

NewsGPT

Hello 👋🏻 You can use NewsGPT to get the latest news about anything–any topic, category, entity or event. See it in action here.

NewsGPT is powered by GPT-3 and AYLIEN News API. The source code of NewsGPT can be accessed here. NewsGPT is developed using ChatGPT.

NewsGPT demo

The project consists of a Flask backend (in the api folder) and a React frontend (in the client folder).

To run NewsGPT locally:

1. Start the backend

Create a config.yml file which contains your OpenAI and News API credentials (see config.yml.example for a template).

cd api/
pip install -r requirements.txt
python3 -m flask run --host=0.0.0.0 --port=5001

Note: If you run the API on a different port you will need to update api_url in src/App.js.

2. Start the frontend

cd client/
npm install
npm start build

(Use .env for configuring the local development server)

You should now have NewsGPT running on your local machine (by default on port 3005). Open http://HOSTADDRESS/ in your browser to access the app.

Server configuration

Follow the next steps to run NewsGPT on a production web server. Ensure you have Nginx up and running on your server.

Config based on the following articles:

1. Configure Nginx

Assuming Ubuntu. Copy and configure the Nginx config file news-gpt.io.conf to /etc/nginx/conf.d/. Don't forget to restart Nginx afterwards to load the new config.

Follow this guide to obtain a Let's Encrypt SSL cert and add it to Nginx server (the configuration is already there, you just need to point it to the right cert and key files).

Ensure your firewall is set to allow HTTP and HTTPS traffic to the server.

2. Build the React app and copy to Nginx folder

Before you build the app you need to make sure the value of api_url in src/App.js points to your local production API server e.g. https://${window.location.hostname}/api.

cd client/
npm run build
cp -R build/ /var/www/

If you open your server's address in a browser now you should see the frontend of NewsGPT.

3. Configure uwsgi to serve the Flask API

Copy the uwsgi service description from wsgi.service to /etc/systemd/system. Start the service using sudo systemctl start wsgi. Make sure wsgi.ini is configured properly.

newsgpt's People

Contributors

parsaghaffari avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

newsgpt's Issues

Create articles

Hello, You can add articles of the most recent news, For example, add photos and description of the news without having to leave the site

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.