Skip to content

A NestJS-based Cron Job Service that allows users to CRUD cron jobs stored in MongoDB, supports scheduled execution, webhooks, and rate limiting for stability and scalability.

Notifications You must be signed in to change notification settings

ShinichiShi/cron

Repository files navigation

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

🚀 Cron Job Service in NestJS with MongoDB

📌 Overview

This is a NestJS-based Cron Job Service that allows users to create, update, delete, and retrieve cron jobs stored in MongoDB. The service supports scheduled execution, webhooks, and rate limiting for stability and scalability.

🛠️ Features

  • CRUD Operations for managing cron jobs.
  • Scheduled Execution using NestJS @nestjs/schedule.
  • Webhook Support to receive and store external data.
  • Rate Limiting & API Throttling using @nestjs/throttler.
  • Scalability with MongoDB storage and optimized queries.
  • History Tracking for cron job triggers and responses.

📦 Tech Stack


🚀 Getting Started

To setup the project, kindly refer to SETUP.md

🌐 Live Service

You can access the live backend service at: https://cron-z85p.onrender.com

Append the endpoints documented below to interact with the service.


📌 Cron Jobs

Method Endpoint Description
POST /cron-jobs Create a new cron job
GET /cron-jobs Get all cron jobs
GET /cron-jobs/:id Get a specific cron job
PUT /cron-jobs/:id Update a cron job
DELETE /cron-jobs/:id Delete a cron job

Request Body (Create/Update)

curl -X POST http://localhost:3000/cron-jobs   
     -H "Content-Type: application/json"  
     -d '{
    "name": "Test API",
    "triggerLink": "https://api.animechan.io/v1/quotes/random",
    "apiKey": "",
    "schedule": "*/30 * * * * *",
    "startDate": "2025-04-24T07:54:02.992Z" #add your latest timestamp
  }'

📌 Webhooks

Method Endpoint Description
POST /webhooks Receive webhook data
GET /webhooks Get all received webhooks

Screenshots

screenshot1 screenshot2

📜 License

This project is licensed under the MIT License.

About

A NestJS-based Cron Job Service that allows users to CRUD cron jobs stored in MongoDB, supports scheduled execution, webhooks, and rate limiting for stability and scalability.

Topics

Resources

Stars

Watchers

Forks