A full-stack API testing and monitoring tool built with Flask. Test any HTTP endpoint, track response times, set performance thresholds, and visualize analytics — all from a futuristic neon-themed dashboard.
- API Testing — Send GET, POST, PUT, PATCH, DELETE requests with custom headers, body, and query params
- Response Monitoring — Track status codes, response times, content length, and response bodies
- Performance Analytics — Aggregated stats, slow endpoint detection, and run-over-run comparison
- Threshold Alerts — Set per-URL response time thresholds and get flagged when they're breached
- Collections — Group related API tests for organized workflows
- Environments — Define variable sets (dev, staging, prod) with
{{variable}}interpolation in URLs, headers, and bodies - History — Full searchable log of every test run with filtering and bulk delete
- JWT Authentication — Register/login flow with access + refresh tokens and role-based admin controls
- Rate Limiting — Configurable per-endpoint rate limits (memory or Redis-backed)
- SSRF Protection — Blocks requests to private/internal IP ranges
- CORS Support — Configurable allowed origins
- Docker Ready — Multi-stage Dockerfile + docker-compose with PostgreSQL and Redis
- One-Click Deploy — Render.com and Heroku configs included
| Layer | Technology |
|---|---|
| Backend | Flask, SQLAlchemy, Flask-Migrate, Flask-JWT-Extended |
| Database | SQLite (dev) / PostgreSQL (prod) |
| Caching | Redis (prod rate limiting) |
| Frontend | Vanilla JS, CSS3 with glassmorphism + particle effects |
| Serialization | Marshmallow |
| Server | Gunicorn (prod), Flask dev server (dev) |
| Containerization | Docker, docker-compose |
- Python 3.10+ (3.12 recommended)
- pip
chmod +x start.sh
./start.shThis will:
- Create a Python virtual environment
- Install all dependencies
- Start the Flask development server on
http://localhost:5000
# Create and activate virtual environment
python3 -m venv venv
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# (Optional) Copy and edit environment variables
cp .env.example .env
# Run the development server
python run.pyThe app runs at http://localhost:5000 by default.
docker-compose up --buildThis starts three services:
- app — Flask application on port 5000
- db — PostgreSQL 16 on port 5432
- redis — Redis 7 on port 6379
docker build -t api-pulse .
docker run -p 5000:5000 \
-e SECRET_KEY=your-secret \
-e JWT_SECRET_KEY=your-jwt-secret \
-e DATABASE_URL=sqlite:///api_monitor.db \
api-pulseAll configuration is via environment variables. See .env.example for the full list:
| Variable | Default | Description |
|---|---|---|
FLASK_ENV |
development |
development or production |
SECRET_KEY |
dev fallback | Flask secret key |
JWT_SECRET_KEY |
dev fallback | JWT signing key |
DATABASE_URL |
sqlite:///api_monitor.db |
Database connection string |
RATELIMIT_STORAGE_URI |
memory:// |
Rate limiter backend (redis:// for prod) |
CORS_ORIGINS |
* |
Comma-separated allowed origins |
PORT |
5000 |
Server port |
All API routes require JWT authentication unless noted.
| Method | Endpoint | Description | Auth |
|---|---|---|---|
| POST | /api/auth/register |
Create a new account | No |
| POST | /api/auth/login |
Get access + refresh tokens | No |
| POST | /api/auth/refresh |
Refresh access token | Refresh token |
| GET | /api/auth/me |
Get current user profile | Yes |
The first registered user automatically receives the
adminrole.
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/test |
Execute an API test |
Request body:
{
"url": "https://api.example.com/users",
"method": "GET",
"headers": { "Authorization": "Bearer ..." },
"body": {},
"params": { "page": "1" },
"environment_id": 1
}| Method | Endpoint | Description |
|---|---|---|
| GET | /api/history |
List test history (paginated, filterable) |
| GET | /api/history/:id |
Get single test result |
| DELETE | /api/history/:id |
Delete a test result |
| DELETE | /api/history |
Bulk delete test results |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/analytics/performance |
Aggregated performance metrics |
| GET | /api/analytics/summary |
Dashboard summary stats |
| GET | /api/analytics/slow |
Slow endpoints report |
| GET | /api/analytics/compare |
Compare runs over time |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/thresholds |
List all thresholds |
| POST | /api/thresholds |
Create a response time threshold |
| DELETE | /api/thresholds/:id |
Delete a threshold |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/collections |
List grouped test collections |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/environments |
List environments |
| POST | /api/environments |
Create environment |
| PUT | /api/environments/:id |
Update environment |
| DELETE | /api/environments/:id |
Delete environment |
| POST | /api/environments/resolve |
Resolve {{variables}} in a string |
| Method | Endpoint | Description | Auth |
|---|---|---|---|
| GET | /health |
Health check (app + database) | No |
CisHackathon/
├── app/
│ ├── __init__.py # Flask app factory (create_app)
│ ├── config.py # Dev / Prod / Test configurations
│ ├── extensions.py # SQLAlchemy, JWT, CORS, Limiter instances
│ ├── models/
│ │ ├── user.py # User model (auth, roles)
│ │ ├── api_test.py # ApiTest model (test results)
│ │ ├── threshold.py # Threshold model (perf limits)
│ │ └── environment.py # Environment model (variable sets)
│ ├── routes/
│ │ ├── auth.py # Register, login, refresh, profile
│ │ ├── testing.py # Execute API tests
│ │ ├── history.py # Test history CRUD
│ │ ├── analytics.py # Performance analytics
│ │ ├── thresholds.py # Threshold management
│ │ ├── collections.py # Test collections
│ │ ├── environments.py # Environment variables
│ │ └── health.py # Health check endpoint
│ ├── services/
│ │ └── api_tester.py # HTTP request execution + SSRF protection
│ ├── middleware/
│ │ └── error_handlers.py # Global error handlers
│ └── utils/
│ └── validation.py # Marshmallow request schemas
├── templates/
│ └── index.html # Dashboard SPA template
├── static/
│ ├── css/style.css # Glassmorphism + neon theme
│ └── js/app.js # Dashboard logic + particle effects
├── tests/ # Pytest test suite
│ ├── conftest.py # Test fixtures (app, client, auth headers)
│ ├── test_auth.py
│ ├── test_testing.py
│ ├── test_history.py
│ ├── test_analytics.py
│ ├── test_thresholds.py
│ ├── test_environments.py
│ └── test_health.py
├── run.py # Entry point
├── start.sh # One-command dev setup + run
├── requirements.txt # Python dependencies
├── .env.example # Environment variable template
├── Dockerfile # Multi-stage production build
├── docker-compose.yml # Full stack (app + PostgreSQL + Redis)
├── Procfile # Heroku deployment
└── render.yaml # Render.com deployment
source venv/bin/activate
pip install pytest
pytest tests/ -vTests use an in-memory SQLite database and require no external services.
- Push to a GitHub repository
- Connect the repo on render.com
- Render will auto-detect
render.yamland configure the service - Set
DATABASE_URLto a managed PostgreSQL instance
heroku create api-pulse
heroku addons:create heroku-postgresql:mini
heroku config:set SECRET_KEY=$(openssl rand -hex 32)
heroku config:set JWT_SECRET_KEY=$(openssl rand -hex 32)
git push heroku maindocker-compose up -d --build- Open
http://localhost:5000in your browser - Click Register and create an account (first user gets admin role)
- Log in with your credentials
- Enter a URL (e.g.,
https://jsonplaceholder.typicode.com/posts) and click Send - View results in the History and Analytics tabs
MIT