Nodejs + postgreSQL backend to summarise Indian news articles using GPT4
Features supported as of 2 jun 2023:
- read and parse sitemaps of news websites (currently supports only Hindustan Times)
- categorise based on time posted and category (world-news, entertainment, etc)
- crawl webpages using Playwright and ARIA selectors to get news content
- access OpenAI GPT4 API and receive summaries
- store all content and summaries in PostgreSQL database
-
Install dependencies using npm
-
Create and host a PostgreSQL DB
(App is currently tested with DB hosted on Render.com)
- Add a .env file with the params:
DBConnLink=
OPENAI_API_KEY=
Example .env file (note these credentials are incorrect):
DBConnLink=postgres://me:1JaCdkEuiREpyVkMmMD5qCc6i6xkoOfY@dpg-choth0m7jbva90hsr2eg-a.singapore-postgres.render.com/news_7oav
OPENAI_API_KEY=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
-
Run app using
node index.js
-
Call endpoints defined in
router.js
using Postman or any other HTTP client. Calllocalhost:3000/init-db
once to initialise database tables, then calllocalhost:3000/main
(App can be run locally or hosted on a service such as Render)