Reminder Application is a simple task management tool built with Laravel. It allows users to create reminders for various tasks and manage them easily.
To install the application, follow these steps:
- Clone the repository using the command below:
git clone https://github.com/mdabagh/reminder.git-
Create a new database for the application.
-
Copy the
.env.examplefile to.envand update the database information. You can do this using the command below:
cp .env.example .env- Install the dependencies using Composer. Run the command below to install the dependencies:
composer install- Generate an application key using the command below:
php artisan key:generate- Run the database migrations using the command below:
php artisan migrate- (Optional) Seed the database with initial data using the commands below:
php artisan db:seed --class=CategoriesMainSeeder
php artisan db:seed --class=UsersTableSeederThe above commands will create a test user with thefollowing credentials:
Username: [email protected]
Password: 12345678
To use the application, follow these steps:
-
Register a new account or login with an existing one.
-
Create a new category for your reminders.
-
Create a new reminder and assign it to a category.
-
View, edit, or delete your reminders as needed.
To set up a cron job in CentOS 7 to send reminders using the Reminder Application, follow these steps:
-
Create a bash script file with the
curlcommand inside. For example, create a file namedreminder-curl.shwith the following content:#!/bin/bash token="YOUR_TOKEN" curl -X POST -d "token=${token}" http://www.example.com/reminders/check >/dev/null 2>&1 ``` Replace `YOUR_TOKEN` with your own token.
-
Make the bash script file executable with the command:
chmod +x reminder-curl.sh
-
Edit the cron job file with the command:
crontab -e ``` -
Add a new line to the end of the file to specify the frequency of the cron job and the path to the bash script file. For example, to run the script every 10 minutes, add the following line:
*/10 * * * * /path/to/reminder-curl.sh ``` Replace `/path/to` with the actual path to the bash script file.
-
Save and exit the file. The cron job will now run according to the specified schedule.
To configure the token in Linux, you need to set the token value in the .env file in the Reminder Application. Here's how you can do it:
-
Open the
.envfile in the Reminder Application. -
Find the line that starts with
APP_TOKEN=and set the value to your token. For example:APP_TOKEN=123456789 ```
-
Save and close the file.
That's it! You have now set up a cron job in CentOS 7 to send reminders using the Reminder Application, and configured the token for the application.
A simple API built with Laravel Sanctum for managing reminders and categories.
To authenticate with the API, send a POST request to /api/login with your email and password in the request body. You will receive an API token in the response, which can be used to authenticate subsequent requests.
The following endpoints are available in the API:
To access reminders endpoints, authentication with an API token is required.
GET /api
POST /api/reminders/store
GET /api/reminders/{id}/edit
PUT /api/reminders/{id}
DELETE /api/reminders/{id}
To access categories endpoints, authentication with an API token is required.
POST /api/categories/store
To use the API, send requests with the required parameters. For GET requests, include your API token in the Authorization header.
For example, to get all reminders:
GET /api
Authorization: Bearer your-api-token
To create a new category:
POST /api/categories/store
Authorization: Bearer your-api-token
For more information on the available endpointsand their parameters, see the documentation in the code.
This API provides a simple and secure way to manage reminders and categories. By following the instructions in this document, you can easily authenticate with the API and use its endpoints to create, read, update, and delete reminders and categories.
