Skip to content

📋 Node.js + Express used with the node-cron module to fetch API data and interract with a Supabase (PostgreSQL) database

Notifications You must be signed in to change notification settings

AndrewJBateman/node-cron-postgresql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚡ Node CRON PostgreSQL

  • Node.js + Express used with the node-cron module to fetch RSS feed data in XML format and interract with a web-based PostgreSQL database
  • Note: to open web links in a new window use: ctrl+click on link

GitHub repo size GitHub pull requests GitHub Repo stars GitHub last commit

📄 Table of contents

📚 General info

  • An RSS (Really Simple Syndication) feed is coded in XML (Extensible Markup Language) with stripped-down content so is quicker to load.
  • RSS parser used to convert XML to JS object

📷 Screenshots

Image

📶 Technologies

  • Node.js v18 Javascript runtime using the Chrome V8 engine
  • Express v4 web framework for node
  • node-cron v3 tiny task scheduler in pure JavaScript for node.js based on GNU crontab, to schedule a task in node.js using full crontab syntax.
  • config v3 to organize hierarchical configurations for app deployment
  • rss-parser v3 to convert RSS feed to JS object
  • uuid v9 to create version 4 (random) RFC4122 UUIDs

💾 Setup

  • npm i to install dependencies
  • Create .env and add database credentials - see .env.example
  • npm run dev runs app in the development mode with auto-restart.
  • Open http://localhost:3000 to view it in the browser: /api to view supabase data, /api/cron to view cron data from XML feed that is not already in the supabase database

🔧 Testing

  • tba

💻 Code Examples

  • supabase.service.ts supabase client access function that can be imported into other files for supabase operations
import { createClient } from "@supabase/supabase-js";
import config from "config";

const dbUrl = config.get<string>("dbUrl");
const dbKey = config.get<string>("dbKey");

const supabase = createClient(dbUrl, dbKey);

export default supabase;

🆒 Features

  • tba

📋 Status, Testing & To-Do List

  • Status: Working
  • To-Do: Add other RSS feeds with separate database storage. Add frontend?

👏 Inspiration

📁 License

  • This project is licensed under the terms of the MIT license.

✉️ Contact

  • Repo created by ABateman, email: gomezbateman@yahoo.com

About

📋 Node.js + Express used with the node-cron module to fetch API data and interract with a Supabase (PostgreSQL) database

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published