arthur404dev / Job-Scheduler

NodeJS + Redis Job Scheduler Boilerplate with easy scalability and parallel running

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Job Scheduler

Job Scheduler Logo

This project was a boilerplate creation for a Job Scheduling microservice integrated with Redis. Feel free to use it and modify as you wish.


Technologies used:

  • Node.js
  • Redis
  • Bull
  • Bull Board
  • DotEnv
  • Express
  • Nodemailer
  • Sucrase
  • Nodemon
  • Npm-run-all

Configuration:

After cloning the respository, install the dependencies:

yarn install

or

npm install

Then proceed with the creation of your .Env file to store your environment variables, for Redis and your chosen mail solution:

# Mail Environment Variables

MAIL_HOST=***
MAIL_PORT=***
MAIL_USER=***
MAIL_PASS=***

# Redis Environment Variables

REDIS_HOST=***
REDIS_PORT=***

I used Docker to instantiate my Redis solution, Try it here!

If you opt for docker, here's the Redis version i've used for this project:

docker run --name redis -p 6379:6379 -d -t redis:alpine

Usage:

If you want to test using the same rest client i've used with my settings, you can click the button below:

Run in Insomnia}

The server should run both the queue scheduler and the server itself utilizing:

yarn dev

or

npm dev

Bull Board:

I've added also an option of Admin Dashboard built in the Bull package, it's called Bull Board and it's a good tool to have in hand.

Bull Board PrintScreen

Important: If you opt for utilizing the Bull Board remember to add authentication to your admin/jobs route, otherwise any user should be able to see all your job entries.

About

NodeJS + Redis Job Scheduler Boilerplate with easy scalability and parallel running


Languages

Language:JavaScript 100.0%