{"id":24075501,"url":"https://github.com/vivekanand-vr/alertingsystem","last_synced_at":"2026-05-01T21:33:30.914Z","repository":{"id":268745688,"uuid":"905319264","full_name":"vivekanand-vr/alertingSystem","owner":"vivekanand-vr","description":"Spring Boot application designed to monitor and track failed API requests and send alert notifications via email.","archived":false,"fork":false,"pushed_at":"2024-12-28T09:08:52.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-09T19:05:13.578Z","etag":null,"topics":["mongodb","redis","spring-mail"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vivekanand-vr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-18T15:31:54.000Z","updated_at":"2024-12-28T09:08:55.000Z","dependencies_parsed_at":"2024-12-18T17:29:18.412Z","dependency_job_id":"ab652987-fa5a-4762-b1b6-c8a7f9170ce9","html_url":"https://github.com/vivekanand-vr/alertingSystem","commit_stats":null,"previous_names":["vivekanand-vr/alertingsystem"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vivekanand-vr%2FalertingSystem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vivekanand-vr%2FalertingSystem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vivekanand-vr%2FalertingSystem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vivekanand-vr%2FalertingSystem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vivekanand-vr","download_url":"https://codeload.github.com/vivekanand-vr/alertingSystem/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240947648,"owners_count":19883029,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mongodb","redis","spring-mail"],"created_at":"2025-01-09T19:05:56.126Z","updated_at":"2025-10-19T13:38:53.854Z","avatar_url":"https://github.com/vivekanand-vr.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Alerting System for Monitoring Failed API Requests\n\n### Overview\nSpring Boot application for monitoring failed API requests with features:\n- Request validation and caching\n- Failed request logging\n- IP-based alert system\n- Redis caching for optimized performance\n- Email notifications for multiple failed API requests\n\n### Prerequisites\n- Java 17, Maven, Redis, MongoDB, Gmail account (for SMTP email alerts)\n\n### Technology Stack\n- Spring Boot 3.2.1, Redis, MongoDB, Java Mail Sender, Lombok, Jackson JSR310\n\n## Configuration Steps\n\n### 1. Clone the Repository\n```bash\ngit clone https://github.com/vivekanand-vr/alertingSystem.git\ncd alertingSystem\n```\n\n### 2. Configure Server Values\n- Create `application.properties`\n- Add threshold and email address\n- Add number of threads for handling traffic\n\n```properties\n# Alert Configuration\nalert.threshold=5\nalert.email=admin@email.com\n\n# Server Configuration for High Traffic\nserver.tomcat.threads.max=200\nserver.tomcat.max-connections=10000\n```\n\n### 3. Setup Redis\n- Install Redis\n- Start Redis server\n- Verify connection: `redis-cli ping`\n```properties\n# Redis Configuration\nspring.redis.host=localhost\nspring.redis.port=6379\n\n# Jackson Configuration\nspring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false\nspring.jackson.date-format=yyyy-MM-dd HH:mm:ss\n```\n\n### 4. Configure MongoDB\n- Open `src/main/resources/application.properties`\n- Ensure MongoDB is running locally\n- Default connection: `mongodb://localhost:27017/\u003cyour-db-name\u003e`\n\n### 5. Configure Email Settings\n- Open `src/main/resources/application.properties`\n- Update email configuration:\n```properties\nspring.mail.host=smtp.gmail.com\nspring.mail.port=587\nspring.mail.username=your-email@gmail.com\nspring.mail.password=your-app-password\n```\n\n### 6. Generate App Password for Gmail\n- Go to Google Account\n- Security \u003e 2-Step Verification\n- App Passwords \u003e Select App (Mail) \u003e Generate\n- Use generated password in `application.properties`\n\n### 7. Build and Run the Application\n```bash\n# Build the project\nmvn clean package\n\n# Run the application\nmvn spring-boot:run\n```\n\n## API Endpoints\n\n### 1. Submit Endpoint\n- **URL:** `/api/submit`\n- **Method:** POST\n- **Required Headers:**\n  - `Authorization: Bearer FIXED_SECRET_TOKEN_2024`\n  - `X-Custom-Header: SomeValue`\n- **Required Params:**\n  - `clientId`\n  - `version`\n- **Request Body:** JSON with `name` and `description`\n\n---\n\n### 2. Metrics Endpoint\n- **URL:** `/api/metrics`\n- **Method:** GET\n- Returns list of failed requests\n\n## Example Request\n```bash\ncurl -X POST \"http://localhost:8080/api/submit?clientId=123\u0026version=1.0\" \\\n     -H \"Authorization: Bearer FIXED_SECRET_TOKEN_2024\" \\\n     -H \"X-Custom-Header: SomeValue\" \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\"name\":\"John Doe\",\"description\":\"Sample Description\"}'\n```\n\n## Architecture\n- Failed requests cached in Redis (10-minute window)\n- Batch writes to MongoDB on threshold breach\n- Email alerts sent for suspicious activity\n- Path validation for /api/submit endpoint\n\n## Logging\n- Failed requests are logged in MongoDB\n- Email alerts sent when failure threshold is reached\n\n## Email Notification Snapshot\n![image](https://github.com/user-attachments/assets/175dfee7-bc0b-44f2-891f-893ce7af1996)\n\n\n## Customization\nModify `application.properties` to adjust:\n- Alert threshold\n- Alert email\n- MongoDB connection\n- SMTP settings\n\n## Troubleshooting\n- Verify Redis and MongoDB services\n- Check SMTP credentials\n- Confirm network configurations\n- Monitor Redis cache status\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvivekanand-vr%2Falertingsystem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvivekanand-vr%2Falertingsystem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvivekanand-vr%2Falertingsystem/lists"}