TaskZap is a simple job scheduling API built with FastAPI. It allows users to create and manage scheduled jobs that make HTTP requests based on cron expressions.
- Create scheduled jobs with custom URLs, HTTP methods, and cron schedules
- Configurable retry counts for failed requests
- Health check endpoint
- PostgreSQL database for persistence
- Docker Compose setup for easy deployment
TaskZap/
├── docker-compose.yaml # Docker Compose configuration for PostgreSQL and Redis
├── api-service/
│ ├── requirements.txt # Python dependencies
│ └── app/
│ ├── main.py # FastAPI application and endpoints
│ ├── models.py # SQLAlchemy models
│ ├── schemas.py # Pydantic schemas
│ └── database.py # Database configuration
└── README.md # This file
-
Clone the repository:
git clone <repository-url> cd TaskZap
-
Create a
.envfile in theapi-servicedirectory with the following variables:DATABASE_URL=postgresql://user:password@localhost:5432/dbname POSTGRES_USER=user POSTGRES_PASSWORD=password POSTGRES_DB=dbname -
Install dependencies:
cd api-service pip install -r requirements.txt
-
Start the database:
docker-compose up postgres
-
Run the API:
cd api-service uvicorn app.main:app --reload
The API will be available at http://localhost:8000.
-
Update the
.envfile with your database credentials. -
Run the entire stack:
docker-compose up
- GET
/health- Returns:
{"status": "ok"}
- Returns:
- POST
/jobs- Body:
{ "url": "https://example.com/webhook", "method": "POST", "cron": "0 * * * *", "retry_count": 3 } - Returns: Created job object
- Body:
id: Integer (auto-generated)url: String (required) - The URL to callmethod: String (default: "POST") - HTTP methodcron: String (required) - Cron expression for schedulingretry_count: Integer (default: 3) - Number of retries on failure
- FastAPI: Web framework
- SQLAlchemy: ORM for database interactions
- PostgreSQL: Database
- Pydantic: Data validation
- Uvicorn: ASGI server