REST API for monitoring external services with Discord alerts.
API REST para monitoramento de serviços externos com alertas via Discord.
A backend application built with Java and Spring Boot designed to automatically monitor external services. It periodically checks registered URLs, stores their status history (UP/DOWN), and sends Discord alerts whenever status changes occur.
- ✔ Layered architecture (controller → service → repository)
- ✔ DTO separation between persistence and API models
- ✔ Scheduled automatic monitoring (every 60 seconds)
- ✔ Discord webhook integration
- ✔ Persistent history using H2 in-memory database
- ✔ Clean RESTful endpoints
- ✔ Runs every 60 seconds
- ✔ Checks all enabled services
- ✔ Stores history for each check
- ✔ Sends alerts when status changes
If no service is registered or enabled, the monitoring process (AutoCheck) continues running normally. In this case, the following message will appear in the application console/log:
⚠ No registered or enabled services.| Method | Endpoint | Description |
|---|---|---|
| GET | /health | Check if API is running |
| GET | /services | List all services |
| POST | /services | Create new service |
| PUT | /services/{id} | Update service |
| DELETE | /services/{id} | Delete service |
| GET | /services/{id}/history | Service history |
git clone https://github.com/Hadzab/monitor-saude-api.git
cd monitor-saude-api
mvn clean install
mvn spring-boot:run
Access:
http://localhost:8080/healthYou can test the endpoints using Postman, Insomnia, or any REST client.
Base URL:
http://localhost:8080Example – Create Service:
POST http://localhost:8080/services
{
"name": "Netflix",
"url": "https://www.netflix.com"
}
Example – Get All Services:
GET http://localhost:8080/servicesExample – Get Service History:
GET http://localhost:8080/services/{id}/historyAdd to application.properties:
discord.webhook.url=⚠ Do NOT commit your webhook URL.
- Authentication & Authorization
- Monitoring dashboard
- Email/SMS alerts
- Dynamic interval configuration
Aplicação backend desenvolvida em Java com Spring Boot para monitoramento automático de serviços externos. Verifica URLs periodicamente, registra histórico de status (UP/DOWN) e envia alertas ao Discord quando há mudanças.
- ✔ Arquitetura em camadas (controller → service → repository)
- ✔ Uso de DTOs separando modelo de persistência da API
- ✔ Monitoramento automático a cada 60 segundos
- ✔ Integração com webhook do Discord
- ✔ Histórico persistido com banco H2 em memória
- ✔ Endpoints REST organizados
- ✔ Executa a cada 60 segundos
- ✔ Verifica todos os serviços habilitados
- ✔ Armazena histórico de cada verificação
- ✔ Envia alertas quando o status muda
Caso nenhum serviço esteja cadastrado ou habilitado, o processo de monitoramento (AutoCheck) continua sendo executado normalmente. Nesse caso, a seguinte mensagem será exibida no console/log da aplicação:
⚠ Nenhum serviço cadastrado ou habilitado.| Método | Endpoint | Descrição |
|---|---|---|
| GET | /health | Verifica se a API está funcionando |
| GET | /services | Lista todos os serviços |
| POST | /services | Cria novo serviço |
| PUT | /services/{id} | Atualiza serviço |
| DELETE | /services/{id} | Remove serviço |
| GET | /services/{id}/history | Histórico do serviço |
git clone https://github.com/Hadzab/monitor-saude-api.git
cd monitor-saude-api
mvn clean install
mvn spring-boot:run
Acesse por:
http://localhost:8080/healthVocê pode testar os endpoints utilizando Postman, Insomnia ou qualquer cliente REST.
URL base:
http://localhost:8080Exemplo – Criar Serviço:
POST http://localhost:8080/services
{
"name": "Netflix",
"url": "https://www.netflix.com"
}
Exemplo – Listar Serviços:
GET http://localhost:8080/servicesExemplo – Histórico do Serviço:
GET http://localhost:8080/services/{id}/historyAdicionar no application.properties:
discord.webhook.url=⚠ Não comite sua URL de webhook.
- Autenticação e autorização
- Dashboard de monitoramento
- Alertas por e-mail/SMS
- Configuração dinâmica de intervalos
Hadassa — Java Backend Developer
⭐ Se você gostou deste projeto, deixe uma estrela no GitHub!
Este projeto está licenciado sob a Licença MIT.