Skip to content

sunsreddit/sidebar

Repository files navigation


Logo

☀️ Phoenix Suns Sidebar Generator 📊

An automated service that updates the r/SUNS sub-reddit sidebar with the latest Phoenix Suns roster & schedules!
Explore the docs »

View Project · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Contributing
  5. Roadmap
  6. License
  7. Contact

About The Project

As our amazing basketball community grows, the r/SUNS subreddit is developing tools like this sidebar generator to help automate tasks which helps promote the highest quality of content. The "Phoenix Suns Sidebar Generator" retrieves the latest NBA data and creates a subreddit sidebar tables with the pertinent details of game scores, players, and other fun statistics.

Getting Started

The following prerequisites and requirements are necessary for the success of this project:

Prerequisites

  • Node
  • Docker

Usage

Setup your project environment by installing node dependencies (npm i), add variables, add parameters, & select a deployment method:

I. Environment Variables

Rename .env.sample to .env and add the variables with the appropriate values.

TZ=America/New_York # TimeZone  
CRON=0|1 # Enable Cron support
VERSION=1.0.0 # package.json project version
CLIENT_ID=ABcD0fghIj2kLMNopqRSTUv # See Reddit API documentation
CLIENT_SECRET=A1Bc_D_EfG2hIjK3LmnoPQrs4tu # See Reddit API documentation
ACCESS_TOKEN=abcDeFghiJKlMnOPqRsTUVWxYz01234567890... #See Reddit API documentation
REFRESH_TOKEN=01234567890123-abcDEfGhIJKLmnopqRst0UV12Wxy-z # See Reddit API documentation

II. Configuration Parameters

Rename config/parameters.sample to config/parameters.jsonand add the keys with the appropriate values.

III. Main Module

  • Run the following NPM script: npm run start or node ./bin/index.mjs

IV. Cron

  • Specify a cron schedule in config/parameters.json
  • Add CRON=1 in .env
  • Run the following NPM script: npm run start:cron or node ./bin/cron.mjs

V. Docker

  • Add version number to the VERSION in .env

  • Add CRON=1 in .env

  • For no prompting, build with the following NPM script: npm run build:docker:force

  • For prompting, build with the following NPM script: npm run build:docker

    # example
    #
    docker run -d --env-file .env --name sidebar-1.0.0 sunsreddit/sidebar:1.0.0

Contributing

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/project-id)
  3. Commit your Changes (git commit -m 'Add the thing')
  4. Push to the Branch (git push origin feature/project-id)
  5. Open a Pull Request

Roadmap

TO DO Description Status
Usage Add "Usage" instructions in the README.md
Automation A Docker service that automates the projects actions
Unit Tests Jest UTs for all project modules
GitHub Actions Continuous integration and project automation 🚧 Ongoing

License

Distributed under the MIT License. See LICENSE for more information.

Contact

u/bruxc u/bruxc

(back to top)

About

Phoenix Suns Sidebar Generator

Resources

License

Stars

Watchers

Forks

Packages

No packages published