Skip to content

AtharvaPanegai/garuda-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

83 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ Garuda API โ€“ Scalable API Health Monitoring System

Website
GitHub Issues
GitHub Stars

Garuda API Radar is a comprehensive API monitoring and alerting system designed to help you track your APIs' performance and availability in real time. This project provides a robust backend built with Node.js, Express, and MongoDB, along with various utilities and services to ensure your APIs are always up and running.


๐Ÿ”— Garuda Ecosystem

Garuda is a multi-service platform, and this repo serves as the core backend. Below are the other services in the ecosystem:

Service Description Repo Link
Garuda API (Backend) Main backend handling API monitoring and data processing ๐Ÿ”— Garuda API
Garuda UI (Frontend) Web dashboard for real-time API analytics ๐Ÿ”— Garuda UI
Garuda Caching Service Redis-based caching layer for optimized monitoring ๐Ÿ”— Garuda Caching
API Radar NPM package for auto-collecting API health metrics ๐Ÿ”— API Radar

๐Ÿš€ Features

โœ… Real-time API monitoring โ€“ Track uptime, response time & availability
โœ… Incident detection & alerting โ€“ Get alerts via email when APIs fail
โœ… Secure API key management โ€“ Protect APIs with unique keys
โœ… User authentication & authorization โ€“ Secure login & access control
โœ… Project & API tracking โ€“ Manage multiple projects efficiently
โœ… Detailed analytics & reporting โ€“ Get insights into API performance


๐Ÿ› ๏ธ Tech Stack

  • Backend: Node.js, Express.js
  • Database: MongoDB, Redis
  • Messaging & Streaming: Kafka, RabbitMQ
  • Frontend: React.js (UI repo linked above)

๐Ÿ“œ Table of Contents


โš“ Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/garuda-api-radar.git
    cd garuda-api-radar
  2. Install dependencies:

    npm install
  3. Create a .env file in the root directory and add the following environment variables:

    DB_CONNECTION_STRING=your_mongodb_connection_string
    PORT=4000
    JWT_SECRET=your_jwt_secret
    JWT_EXPIRY=7d
    COOKIE_TIME=7
    EMAIL_FROM=your_email@example.com
    EMAIL_AUTH_TOKEN=your_email_auth_token
  4. Start the server:

    npm start

๐Ÿ’ป Configuration

The application uses environment variables for configuration. Ensure you have a .env file with the necessary variables as shown in the installation section.

๐Ÿ˜Ž Usage

Running the Application

To run the application in development mode:

npm run dev

To run the application in production mode:

npm start

๐Ÿ“ƒ API Documentation

User Authentication

Sign Up

  • Endpoint: /api/v1/signup
  • Method: POST
  • Description: Register a new user.
  • Request Body:
    {
        "username": "john_doe",
        "emailId": "john@example.com",
        "phoneNumber": "1234567890",
        "companyName": "Example Inc",
        "password": "password123"
    }
  • Response:
    {
        "success": true,
        "token": "jwt_token",
        "user": {
            "username": "john_doe",
            "emailId": "john@example.com",
            "phoneNumber": "1234567890",
            "companyName": "Example Inc"
        }
    }

Sign In

  • Endpoint: /api/v1/signin
  • Method: POST
  • Description: Authenticate a user.
  • Request Body:
    {
        "email": "john@example.com",
        "password": "password123"
    }
  • Response:
    {
        "success": true,
        "token": "jwt_token",
        "user": {
            "username": "john_doe",
            "emailId": "john@example.com",
            "phoneNumber": "1234567890",
            "companyName": "Example Inc"
        }
    }

Project Management

Create Project

  • Endpoint: /api/v1/project/create
  • Method: POST
  • Description: Create a new project.
  • Request Body:
    {
        "userId": "user_id",
        "projectName": "New Project"
    }
  • Response:
    {
        "message": "Project Created successfully!",
        "project": {
            "projectName": "New Project",
            "customer": "user_id"
        }
    }

Create Project API Key(s)

  • Endpoint: /api/v1/project/createapikey
  • Method: POST
  • Description: Generate an API key for a project.
  • Request Body:
    {
        "userId": "user_id",
        "projectId": "project_id"
    }
  • Response:
    {
        "message": "API Key for project Created!",
        "apiKey": "generated_api_key"
    }

API Monitoring

Onboard APIs as per Hit

  • Endpoint: /api/v1/radar/monitorapi
  • Method: POST
  • Description: Process API hits and onboard APIs.
  • Request Body:
    {
        "projectId": "project_id",
        "method": "POST",
        "path": "/api/v1/signin",
        "headers": {
            "content-type": "application/json"
        },
        "statusCode": 200,
        "responseTime": "266.686 ms"
    }
  • Response:
    {
        "message": "Hit Recorded!"
    }

Incident Reporting

Get Cumulative Project Report

  • Endpoint: /api/v1/project/report
  • Method: POST
  • Description: Get a cumulative report for a project.
  • Request Body:
    {
        "projectId": "project_id"
    }
  • Response:
    {
        "message": "Project Report Generated Successfully!",
        "projectReport": {
            "project": {
                "projectName": "New Project",
                "customer": "user_id"
            },
            "totalApisCount": 5,
            "totalIncidentsReported": 2,
            "overAllStatusCode": 200,
            "projectAge": "2 days ago",
            "onCallPerson": "John Doe",
            "apiHitsReport": [
                {
                    "date": "2023-10-01",
                    "hits": 100
                }
            ],
            "statusSummaryArray": [
                {
                    "name": "Success",
                    "value": 90
                }
            ],
            "totalApisForProject": [
                {
                    "apiEndPoint": "/api/v1/signin",
                    "apiMethod": "POST"
                }
            ]
        }
    }

๐Ÿ‘ฉโ€๐Ÿ’ป Contributing

We welcome contributions to Garuda API Radar! Please follow these steps to contribute:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Make your changes and commit them (git commit -m 'Add new feature').
  4. Push to the branch (git push origin feature-branch).
  5. Create a pull request.

๐Ÿ‘ฎโ€โ™‚๏ธ Code of Conduct

Please adhere to the Contributor Covenant Code of Conduct when contributing to this project.

ยฉ License

This project is licensed under the MIT License. See the LICENSE file for details.

About

Garuda API - The core backend service for API Garuda, a real-time API health monitoring and alerting system. It efficiently tracks uptime, response times, and status codes, leveraging Redis and RabbitMQ for optimized performance. ๐Ÿš€

Topics

Resources

Stars

Watchers

Forks

Contributors