Skip to content

sunjay-dev/CronJob-Scheduler

Repository files navigation

CronJob-Scheduler

CronJob image

A simple yet powerful cron job scheduler to automate recurring API requests (GET/POST) using Agenda.js. Schedule jobs, view logs, and control execution — all from a modern web dashboard.


🚀 Features

  • 🕒 Schedule recurring jobs using cron expressions
  • 📡 Supports GET, POST and many other requests options with custom headers/body
  • 🧠 Built on Agenda.js for robust background processing
  • 📊 View job execution logs and status (success/failure)
  • ✨ Toggle jobs on/off without deleting them
  • 💻 Clean React + Tailwind
  • 🔐 JWT-based authentication
  • ⚡ Dedicated Job Runner for background execution

🛠️ Tech Stack

MongoDB TypeScript React TailwindCSS Chart.js Lucide-React Express.js Redux-toolKit Agenda.js PNPM Passport.js Resend Zod Upstash Pino Docker


🏗️ Current Architecture

CronJob architecture Image

📦 Installation

⚠️ Before you start, make sure you have the following installed:

  • pnpm (package manager used in this project)
  • TypeScript (tsc compiler)

1. Clone the repository

git clone https://github.com/sunjay-dev/CronJob-Scheduler.git
cd CronJob-Scheduler

2. Setup Backend (Required)

cd Backend
pnpm install
cp .env.example .env
# Update .env with your MongoDB URI (Other fields are optional until you're testing them)

pnpm run dev

3. Setup Frontend (Required)

cd Frontend
pnpm install

# Update VITE_BACKEND_URL in .env (defaults to http://localhost:3000)

pnpm run dev

4. Setup Job Runner

⚡ Required for actual scheduling

cd job-runner
pnpm install
cp .env.example .env
# Make sure the MongoDB URI matches the backend
pnpm run dev

4. Setup Email Service (Optional)

⚡ Only needed if you want to test/run email service.

cd email-service
pnpm install
cp .env.example .env
# Update .env with your RESEND_EMAIL_API_KEY, SENDEREMAIL, and EMAIL_SERVICE_SECRET

pnpm run dev

🖥️ Folder Structure

CronJob-Scheduler/
├── Backend/        # Server (Express + Agenda.js)
├── Frontend/       # Client (React + Tailwind)
├── job-runner/     # Background worker (Agenda.js)
├── email-service/  # Email microservice (Express + Resend)
├── README.md

🧭 Roadmap

  • Create/Update/Delete jobs
  • Job toggle (enable/disable)
  • Execution logs viewer
  • Support for PUT/DELETE requests
  • User account settings
  • Google login config
  • Forget password
  • Email notifications on failure
  • Retry on failure + backoff strategy
  • Convert to Micro-service architecture

🤝 Contributing

Contributions, suggestions, and improvements are always welcome!

About

An Agenda.js-powered cron job scheduler to automate API/webhook calls. Built with Agenda.js, Express, and React.

Topics

Resources

License

Stars

Watchers

Forks