Welcome to the Message Scheduler! This app lets you schedule messages to be sent at specific times, with options for repeating intervals. It's perfect for reminders, notifications, and more!
This project is a message scheduling application built using Flask, SQLite, jQuery, and Bootstrap. It allows users to schedule messages, manage servers and topics, and view sent and scheduled messages.
This guide will help you set up and run the Message Scheduler Application using Docker and Docker Compose. Follow the steps below to get your application up and running in your home lab.
Make sure you have Docker and Docker Compose installed on your machine.
.
├── Dockerfile
├── app
│ ├── main.py
│ ├── scheduler.py
│ ├── database.py
│ ├── templates
│ │ └── index.html
│ ├── static
│ ├── css
│ │ └── styles.css
│ ├── js
│ │ └── scripts.js
└── README.md
-
Build the Docker images:
podman build -t ntfy-scheduler .
-
Run the Docker containers:
podman run -d -p 5000:5000 --rm --name ntfy-scheduler localhost/ntfy-scheduler:latest
This command will start the application and the database service. The web application will be available at
http://localhost:5000
. -
Stopping the containers:
podman stop ntfy-scheduler
-
Clone the repository:
git clone https://github.com/savitojs/ntfy-scheduler.git cd ntfy-scheduler
-
Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate
-
Install the required dependencies:
pip install -r requirements.txt
-
Run the application:
bash entrypoint.sh
-
Open your web browser and go to
http://localhost:5000
.
Here’s a quick tour of the files and what they do:
- The main Flask application file. It sets up the routes and starts the server.
- Handles all database operations, including initialization, adding, editing, and retrieving messages, servers, and topics.
- Contains the scheduling logic, including checking for messages to send and handling the message sending process.
- The main HTML file for the app. It includes the form for scheduling messages and sections for viewing scheduled and sent messages.
- Contains the client-side JavaScript for handling form submissions, dynamic content loading, and interaction with the API.
- Custom styles for the application.
Here’s a quick rundown of the API endpoints and what they do:
- Schedule a new message.
- Required Data:
message
,datetime
,server
,topic
- Optional Data:
interval
,custom_days
,timezone
,header_title
,header_priority
,header_tags
- Get all scheduled messages.
- Get all sent messages.
- Delete a scheduled message by ID.
- Edit an existing scheduled message.
- Required Data:
message
,datetime
,server
,topic
,interval
,custom_days
,timezone
,headers
- Get all topics.
- Add a new topic.
- Required Data:
name
- Delete a topic by ID.
- Get all servers.
- Add a new server.
- Required Data:
address
- Delete a server by ID.
- Get the default server.
- Set the default server.
- Required Data:
server
- Get the default topic.
- Set the default topic.
- Required Data:
topic
-
Schedule a Message: Fill out the form on the main page to schedule a new message. You can set a specific time and choose if the message should repeat.
-
View Scheduled Messages: Click on "View Scheduled Messages" to see all messages that are scheduled to be sent.
-
View Sent Messages: Click on "View Sent Messages" to see all messages that have been sent.
-
Manage Topics: Click on "Manage Topics" to add or delete topics.
-
Manage Servers: Click on "Manage Servers" to add or delete servers.
Feel free to fork the repository and submit pull requests. I appreciate any contributions to make this project better!
This project is licensed under the MIT License. See the LICENSE file for more details.
Enjoy scheduling your messages with our awesome app! 🚀