|
1 | 1 | # Schedy |
2 | 2 |
|
3 | | -Lightweight HTTP-based task scheduler that lets you schedule and execute tasks at specified times. |
| 3 | +> **A self-hostable, ultra-lightweight HTTP task scheduler for the weird and wonderful automation you want.** |
| 4 | +
|
| 5 | +Schedy lets you schedule HTTP POST requests to any endpoint at any time, with custom headers and payloads. Perfect for webhooks, bots, reminders, integrations, and all sorts of automation—without the bloat. |
| 6 | + |
| 7 | +--- |
4 | 8 |
|
5 | 9 | ## Features |
6 | 10 |
|
7 | | -- Schedule tasks via HTTP API |
8 | | -- Executes tasks at the right time using Go routines and timers |
9 | | -- Simple and easy to integrate |
| 11 | +- 🕒 **Schedule HTTP tasks** for any time in the future |
| 12 | +- 🪶 **Ultra-lightweight**: single binary, no external dependencies except BadgerDB |
| 13 | +- 🏠 **Self-hostable**: run anywhere Go runs (Linux, macOS, Windows, ARM, x86) |
| 14 | +- 🔒 **Custom headers**: add auth, content-type, or anything else |
| 15 | +- 🧬 **Flexible payloads**: send JSON, form data, or plain text |
| 16 | +- 🦄 **Weirdly simple**: no UI, no cron, just HTTP |
10 | 17 |
|
11 | | -## Getting Started |
| 18 | +--- |
12 | 19 |
|
13 | | -### Prerequisites |
| 20 | +## Quick Start |
14 | 21 |
|
15 | | -- Go 1.18+ installed |
| 22 | +### 1. Download the Binary |
16 | 23 |
|
17 | | -### Installation |
| 24 | +Head to [Releases](https://github.com/ksamirdev/schedy/releases) and grab the latest `schedy` binary for your OS/architecture. No build required! |
| 25 | + |
| 26 | +### 2. Run |
18 | 27 |
|
19 | 28 | ```bash |
20 | | -git clone https://github.com/ksamirdev/schedy.git |
21 | | -cd schedy |
22 | | -go build -o schedy cmd/schedy/main.go |
| 29 | +./schedy |
23 | 30 | ``` |
24 | 31 |
|
25 | | -### Usage |
| 32 | +Schedy will listen on `:8080` by default. |
26 | 33 |
|
27 | | -Start the scheduler server: |
| 34 | +--- |
| 35 | + |
| 36 | +## API |
| 37 | + |
| 38 | +### Schedule a Task |
| 39 | + |
| 40 | +Send a POST to `/tasks`: |
28 | 41 |
|
29 | 42 | ```bash |
30 | | -./schedy |
| 43 | +curl -X POST http://localhost:8080/tasks \ |
| 44 | + -H "Content-Type: application/json" \ |
| 45 | + -d '{ |
| 46 | + "execute_at": "2025-05-26T15:00:00Z", |
| 47 | + "url": "https://webhook.site/your-endpoint", |
| 48 | + "headers": {"Content-Type": "application/x-www-form-urlencoded", "Authorization": "Bearer TOKEN"}, |
| 49 | + "payload": "foo=bar&baz=qux" |
| 50 | + }' |
31 | 51 | ``` |
32 | 52 |
|
33 | | -### API Endpoints |
| 53 | +#### Request Fields |
| 54 | +- `execute_at`: When to run (RFC3339, UTC) |
| 55 | +- `url`: Where to POST |
| 56 | +- `headers`: (optional) Map of HTTP headers |
| 57 | +- `payload`: (optional) Anything: JSON, string, bytes, form data, etc. |
34 | 58 |
|
35 | | -- `POST /tasks` — Schedule a new task |
| 59 | +#### Examples |
36 | 60 |
|
37 | | -### Example |
| 61 | +**JSON payload (default):** |
| 62 | +```bash |
| 63 | +curl -X POST http://localhost:8080/tasks \ |
| 64 | + -H "Content-Type: application/json" \ |
| 65 | + -d '{ |
| 66 | + "execute_at": "2025-05-26T15:00:00Z", |
| 67 | + "url": "https://example.com/webhook", |
| 68 | + "payload": {"hello": "world"} |
| 69 | + }' |
| 70 | +``` |
38 | 71 |
|
39 | | -Schedule a task: |
| 72 | +**Form data:** |
| 73 | +```bash |
| 74 | +curl -X POST http://localhost:8080/tasks \ |
| 75 | + -H "Content-Type: application/json" \ |
| 76 | + -d '{ |
| 77 | + "execute_at": "2025-05-26T15:00:00Z", |
| 78 | + "url": "https://example.com/form", |
| 79 | + "headers": {"Content-Type": "application/x-www-form-urlencoded"}, |
| 80 | + "payload": "foo=bar&baz=qux" |
| 81 | + }' |
| 82 | +``` |
40 | 83 |
|
| 84 | +**Plain text:** |
41 | 85 | ```bash |
42 | | -curl -X POST http://localhost:8080/tasks -d '{"execute_at":"2025-05-26T15:00:00Z","url":"https://webhook.site/8a741093-35cc-4085-9c0d-1e7f0c98ef9c", "payload": {"key": "value"}}' -H "Content-Type: application/json" |
| 86 | +curl -X POST http://localhost:8080/tasks \ |
| 87 | + -H "Content-Type: application/json" \ |
| 88 | + -d '{ |
| 89 | + "execute_at": "2025-05-26T15:00:00Z", |
| 90 | + "url": "https://example.com/text", |
| 91 | + "headers": {"Content-Type": "text/plain"}, |
| 92 | + "payload": "hello world!" |
| 93 | + }' |
43 | 94 | ``` |
44 | 95 |
|
45 | | -## Contributing |
| 96 | +--- |
| 97 | + |
| 98 | +## Why Schedy? |
| 99 | +- No cron, no YAML, no UI, no cloud lock-in |
| 100 | +- Just HTTP, just works |
| 101 | +- For hackers, tinkerers, and anyone who wants to automate the weird stuff |
46 | 102 |
|
47 | | -We welcome contributions! Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details. |
| 103 | +--- |
48 | 104 |
|
49 | | -## Code of Conduct |
| 105 | +## Contributing |
50 | 106 |
|
51 | | -This project adheres to a [Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. |
| 107 | +PRs, issues, and weird use-cases welcome! See [CONTRIBUTING.md](CONTRIBUTING.md). |
52 | 108 |
|
53 | 109 | ## License |
54 | 110 |
|
55 | | -MIT License. See [LICENSE](LICENSE) for details. |
| 111 | +MIT. See [LICENSE](LICENSE). |
0 commit comments