Skip to content

ZerfyT/cron-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Cron Task Manager

A modern, full-featured web interface for managing cron tasks with advanced features, built with Next.js and Python Flask.

πŸš€ Features

Core Functionality

  • βœ… Create, edit, and delete cron tasks with intuitive interface
  • βœ… Enable/disable tasks with toggle switches
  • βœ… Run tasks immediately to test them before scheduling
  • βœ… View task logs and execution results in real-time
  • βœ… Search and filter tasks with instant results
  • βœ… Backup and restore crontab files with one-click operations

Advanced Features

  • Cron Expression Generator with visual builder and helpers
  • Clipboard Integration for pasting cron expressions
  • Real-time Synchronization between cron expression and individual fields
  • Human-readable Explanations of cron expressions
  • Clear Task Logs with one-click log clearing
  • Performance Optimizations with caching and rate limiting
  • Security Features with input validation and sanitization
  • Health Monitoring with system status checks

πŸ› οΈ Tech Stack

Frontend

  • Framework: Next.js 15 + React 19
  • UI Components: shadcn/ui
  • Icons: Lucide React
  • Animations: Framer Motion
  • TypeScript: Full type safety
  • Package Manager: Bun or npm

Backend

  • Framework: Python3 Flask with CORS support
  • Cron Parsing: croniter library
  • Security: Input validation and sanitization
  • Performance: Caching and rate limiting
  • Logging: Structured logging with file and console output

πŸš€ Getting Started

Prerequisites

  • Node.js 20+ or Bun
  • Python 3.8+ with pip
  • Git for cloning the repository

πŸ“¦ Installation

1. Clone the Repository

git clone https://github.com/ZerfyT/cron-manager.git
cd cron-manager

2. Frontend Setup

# Install dependencies
bun install
# or
npm install

# Start development server
bun dev
# or
npm run dev

3. Backend Setup

# Navigate to server directory
cd server

# Install Python dependencies
pip install -r requirements.txt

# Start the Flask server
python app.py

4. Access the Application

πŸ”§ Configuration

Environment Variables

Frontend (.env.local):

NEXT_PUBLIC_API_URL=http://127.0.0.1:5000/api

Backend (server/.env):

# Logging
CRON_LOG_DIR=/tmp/cron-app-logs

# Security
MAX_COMMAND_LENGTH=1000
COMMAND_TIMEOUT=60
RATE_LIMIT_REQUESTS=1000
RATE_LIMIT_WINDOW=3600

# Flask
FLASK_DEBUG=False
FLASK_HOST=127.0.0.1
FLASK_PORT=5000

πŸ”Œ API Endpoints

Task Management

  • GET /api/tasks - Get all cron tasks
  • POST /api/tasks - Create a new task
  • PUT /api/tasks/:id - Update an existing task
  • DELETE /api/tasks/:id - Delete a task
  • POST /api/tasks/:id/toggle - Toggle task enabled/disabled
  • POST /api/tasks/:id/run - Run a task immediately

Log Management

  • GET /api/logs/:id - Get task execution log
  • DELETE /api/logs/:id - Clear task log

Backup & Restore

  • GET /api/crontab/backup - Download crontab backup
  • POST /api/crontab/restore - Upload and restore crontab

System

  • GET /api/health - Health check endpoint

🎯 Key Features Explained

Cron Expression Generator

  • Visual Builder: Drag-and-drop interface for creating cron expressions
  • Crontab Guru Style: Interactive explanation of cron expressions
  • Helpers Guide: Comprehensive documentation and examples
  • Real-time Preview: See when your tasks will run

Advanced Task Management

  • Clipboard Integration: Paste cron expressions directly from clipboard
  • Real-time Sync: Changes in cron expression field sync with individual fields
  • Human-readable Explanations: Understand what your cron expressions do
  • Log Management: View and clear task execution logs
  • Immediate Testing: Run tasks instantly to verify they work

Security & Performance

  • Input Validation: All inputs are validated and sanitized
  • Rate Limiting: Prevents abuse with configurable limits
  • Command Sanitization: Removes potentially dangerous characters
  • Caching: Optimized performance with intelligent caching
  • Error Handling: Comprehensive error handling and logging

πŸš€ Deployment

Manual Deployment

  1. Build Frontend:

    bun run build
  2. Deploy Backend:

    cd server
    pip install -r requirements.txt
    gunicorn -w 4 -b 0.0.0.0:5000 app:app

πŸ“ License

MIT License - see LICENSE file for details.

πŸ™ Acknowledgments

  • shadcn/ui for the beautiful UI components
  • Crontab Guru for cron expression inspiration
  • Next.js for the amazing React framework
  • Flask for the lightweight Python web framework

About

A modern, full-featured web interface for managing cron tasks with advanced features, built with Next.js and Python Flask.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors