https://github.com/j-t-mcc/uptime-backend-api
Website Uptime & Certificate Monitoring API built using Laravel.
https://github.com/j-t-mcc/uptime-backend-api
laravel-application laravel-fortify laravel-sanctum spa
Last synced: 3 months ago
JSON representation
Website Uptime & Certificate Monitoring API built using Laravel.
- Host: GitHub
- URL: https://github.com/j-t-mcc/uptime-backend-api
- Owner: J-T-McC
- License: mit
- Created: 2020-12-06T21:06:04.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-02-28T22:46:45.000Z (4 months ago)
- Last Synced: 2025-03-27T04:41:29.576Z (4 months ago)
- Topics: laravel-application, laravel-fortify, laravel-sanctum, spa
- Language: PHP
- Homepage: https://uptime.tysonmccarney.com
- Size: 1.58 MB
- Stars: 11
- Watchers: 4
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Website Uptime & Certificate Monitoring API
[](https://github.com/J-T-McC/uptime-backend-api/actions/workflows/run_tests.yml)This is an uptime API to be paired with [Uptime VueJS](https://github.com/J-T-McC/uptime-frontend-vue) (or what ever else you want to use it for).
This is also a personal playground for trying out ecosystem tools and libraries.
You can try it out at [https://uptime.tysonmccarney.com/](https://uptime.tysonmccarney.com/)
## Requirements
* PHP ^8.3
## Local Installation (docker via sail)```shell script
# create your environment file
cp -p .env.example .env;# install composer dependencies (or run `composer install` if you have composer & PHP installed locally)
# see https://laravel.com/docs/11.x/sail#installing-composer-dependencies-for-existing-projects
docker run --rm \
-u "$(id -u):$(id -g)" \
-v "$(pwd):/var/www/html" \
-w /var/www/html \
laravelsail/php84-composer:latest \
composer install --ignore-platform-reqs# build & start the docker container. ensure you add your test domain to your host file
./vendor/bin/sail build && ./vendor/bin/sail up -d;# run the migrations
./vendor/bin/sail artisan migrate;# optional test data ([email protected] / password)
./vendor/bin/sail artisan db:seed --class=LocalDatabaseSeeder;# optional assign admin role to a user
# admin role grants access to api.my-domain.com/admin filament and laravel pulse dashboard
./vendor/bin/sail artisan admin:assign-role-to-user --user-id=1 --role-id=1;```
Some things to make note of while populating your .env:
1. Laravel Sanctum requires your SPA and backend to share the same root domain.
2. Make sure your SESSION_DOMAIN value allows cookies to be valid for both domains
3. Make sure your SANCTUM_STATEFUL_DOMAINS value is set to your SPA domain```dotenv
APP_URL=https://api.my-domain.com
APP_SPA_URL=https://app.my-domain.com
SANCTUM_STATEFUL_DOMAINS=app.my-domain.com
SESSION_DOMAIN=.my-domain.com```
Run the scheduler to check for uptime and expiring certificates:
```shell script
php artisan schedule:run
```
## Admin Panel and OpenAPI Documentation
1. Admin Panel: [http://api.laravel.test/admin](hhttp://api.laravel.test/admin)
2. OpenAPI Documentation: [http://api.laravel.test/docs/api](hhttp://api.laravel.test/docs/api)## Notification Channels
Currently supports:
* Slack Webhooks
* Discord Webhooks
* PagerDuty v2 Events API## License
MIT