Skip to content

Commit c776487

Browse files
refactor: overhaul request engine with Undici and modularize main process
Summary: - Upgraded HTTP request engine from standard fetch to Undici for high-performance networking. - Optimized Undici with a global Agent, connection pooling, and automatic redirection handling via interceptors. - Decoupled core logic from src/main/index.ts into dedicated handlers (requestHandler.ts, pdfHandler.ts). - Cleaned up main process by removing template bloat and isolating external dependencies. - Fixed PDF export layout bug where long URLs and JSON values were being cut off (added word-wrapping for code blocks). Key Files: - src/main/requestHandler.ts (New) - src/main/pdfHandler.ts (New) - src/main/index.ts (Refactored)
1 parent 4b80099 commit c776487

6 files changed

Lines changed: 550 additions & 436 deletions

File tree

README.md

Lines changed: 109 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -1,107 +1,109 @@
1-
<div align="center">
2-
<img src="resources/icon.jpg" alt="API Documenter Logo" width="128" />
3-
4-
# API Documenter
5-
6-
**The ultimate self-hosted, offline-first API testing and documentation platform.**
7-
8-
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
9-
[![Version](https://img.shields.io/badge/version-1.0.15-emerald.svg)](package.json)
10-
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md)
11-
[![Platform](https://img.shields.io/badge/platform-Windows%20%7C%20macOS-lightgrey.svg)](#)
12-
</div>
13-
14-
---
15-
16-
## 🌟 Overview
17-
18-
**API Documenter** is a robust alternative to Postman and Insomnia, designed specifically for developers who value privacy, speed, and ownership. It starts as a high-performance local desktop app but scales instantly into a team-oriented platform with secure database synchronization and granular role-based access control.
19-
20-
## 🚀 Key Features
21-
22-
### 1. Offline-First Excellence
23-
- **Local Storage**: Your sensitive API data stays on your machine by default using high-speed IndexedDB (Dexie).
24-
- **Zero Latency**: No "cloud sync" lag while you're prototyping or testing locally.
25-
- **Privacy by Design**: No mandatory accounts or telemetry.
26-
27-
### 2. Secure Team Synchronization
28-
- **Multi-DB Support**: Connect your workspace to a remote **PostgreSQL** or **MySQL** server.
29-
- **Vercel Proxy Deployment**: Deploy a production-ready server to Vercel in one click. This ensures your DB credentials are never exposed to the client side and all team traffic is securely authorized.
30-
- **Real-time Sync**: Collaborative editing with bi-directional synchronization between local and remote states.
31-
32-
### 3. Folder-Level RBAC
33-
- **Admin**: Full control over project infrastructure, sync settings, and team management.
34-
- **Editor**: Full read/write access to folders, requests, and documentation.
35-
- **Viewer**: Read-only access for team members who need to consume documentation without modification.
36-
37-
### 4. Advanced Request Engine
38-
- **Full HTTP Support**: GET, POST, PUT, DELETE, PATCH, OPTIONS, and more.
39-
- **Rich Payloads**: Seamlessly handle Headers, Query Params, and JSON/Text bodies.
40-
- **Smart Response Viewer**: Real-time status codes, response headers, body size, and execution benchmarks.
41-
42-
### 5. Enterprise-Grade Scaling
43-
- **Premium UI**: Sleek, glassmorphic dark-themed design.
44-
- **Custom Font Scaling**: Perfectly tailored readability for any screen size, from laptop screens to 4K monitors.
45-
- **GitHub Auto-Updates**: Silent background updates that keep you on the latest version without disruption.
46-
47-
## 🛠️ Tech Stack
48-
49-
- **Frontend**: React 18, TypeScript, Vite
50-
- **Desktop Layer**: Electron (Standard IPC Integration)
51-
- **State Management**: Zustand & React Query
52-
- **Local Database**: Dexie (IndexedDB)
53-
- **Remote Bridge**: mysql2, pg (via Secure Proxy)
54-
- **CI/CD**: GitHub Actions & Electron-Builder
55-
56-
## � Getting Started
57-
58-
### Prerequisites
59-
- [Node.js](https://nodejs.org/) (v18.x or v20.x recommended)
60-
- [npm](https://www.npmjs.com/)
61-
62-
### Installation & Setup
63-
64-
1. **Clone the repository:**
65-
```bash
66-
git clone https://github.com/PraneethKulukuri26/API-Documenter.git
67-
cd API-Documenter
68-
```
69-
70-
2. **Install dependencies:**
71-
```bash
72-
npm install
73-
```
74-
75-
3. **Start Development Server:**
76-
```bash
77-
npm run dev
78-
```
79-
80-
4. **Build Production Application:**
81-
```bash
82-
# Build for Windows
83-
npm run build:win
84-
85-
# Build for macOS
86-
npm run build:mac
87-
```
88-
89-
## 🛡️ Security
90-
91-
API Documenter uses a unique **Security Proxy Architecture**. When you connect a database, the app deploys a serverless function to Vercel. This function acts as the sole gatekeeper for your database, ensuring that raw SQL credentials are never stored in the desktop application but remain securely in your Vercel environment variables.
92-
93-
For more details, see [SECURITY.md](SECURITY.md).
94-
95-
## 🤝 Contributing
96-
97-
We love contributions! Please read our [CONTRIBUTING.md](CONTRIBUTING.md) to get started.
98-
99-
## 📄 License
100-
101-
Distributed under the MIT License. See [LICENSE](LICENSE) for more information.
102-
103-
---
104-
105-
<!-- <div align="center">
106-
Built with ❤️ by <a href="https://github.com/PraneethKulukuri26">Praneeth Kulukuri</a>
107-
</div> -->
1+
<div align="center">
2+
<img src="resources/icon.jpg" alt="API Documenter Logo" width="128" />
3+
4+
# API Documenter
5+
### The Professional Self-Hosted API Ecosystem
6+
7+
**Postman Power + Enterprise Control + 100% Data Ownership.**
8+
9+
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
10+
[![Version](https://img.shields.io/badge/version-1.0.20-emerald.svg)](package.json)
11+
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md)
12+
[![Platform](https://img.shields.io/badge/platform-Windows%20%7C%20macOS-lightgrey.svg)](#)
13+
</div>
14+
15+
---
16+
17+
## 🌟 The Vision
18+
19+
**API Documenter** is more than just an API client; it is a complete **Documentation and Testing Ecosystem**. It was built for engineering teams that cannot compromise on data privacy or reliability. While existing tools force your sensitive API keys and internal endpoints onto their cloud, API Documenter keeps your data exactly where it belongs: **on your machine and in your private database.**
20+
21+
---
22+
23+
## 🚀 Master Feature Suite
24+
25+
### 1. 📂 Folder-Level RBAC (Enterprise Security)
26+
The first self-hosted tool to offer granular, folder-level **Role Based Access Control**.
27+
- **Admins**: Manage project connections, deployment settings, and global team permissions.
28+
- **Editors**: Create and modify endpoints within specific folders they have access to.
29+
- **Viewers**: Access real-time documentation and test endpoints without risk of modifying team data.
30+
- **Team Isolation**: Different members can have different roles on different folders within the same project.
31+
32+
### 2. 📝 Advanced Documentation Engine
33+
A dedicated workspace for crafting beautiful, production-ready API documentation.
34+
- **Markdown-Native**: Write documentation using standard Markdown with real-time side-by-side preview.
35+
- **Smart Components**: Insert **Smart Table of Contents**, **Page Breaks**, and dynamic code blocks.
36+
- **Built-in PDF Compilation**: Export high-fidelity A4 documentation PDFs using a built-in Chromium engine (no external Chrome dependency required).
37+
- **Distraction-Free Mode**: Collapse all sidebars and toolbars to focus purely on the content.
38+
39+
### 3. 🔄 Advanced Database Synchronization
40+
Bypass the proprietary cloud and sync directly with your own infrastructure.
41+
- **Native Support**: Direct integration with **MySQL** and **PostgreSQL**.
42+
- **Vercel Proxy Bridge**: One-click deployment of a secure RBAC proxy. Your database credentials stay encrypted in Vercel environment variables—never stored on user machines.
43+
- **Real-Time Connectivity**: Instantly syncs changes across team members while maintaining an offline-first cache for zero-latency editing.
44+
- **Smart Error Recovery**: Robust handling for VPN/Firewall interruptions with detailed connection error reporting and one-click retry.
45+
46+
### 4. ⚡ High-Performance Request Engine
47+
A testing suite built for speed and precision.
48+
- **Complete Method Support**: GET, POST, PUT, DELETE, PATCH, and OPTIONS.
49+
- **Variable Injection**: Multi-environment support with dynamic variable substitution in URLs, Headers, and Bodies.
50+
- **Response Analytics**: Real-time benchmarks for execution time, payload size, and status codes.
51+
- **Rich Body Support**: JSON (with syntax highlighting), Key-Value pairs, and raw text.
52+
53+
### 5. 🎨 Aesthetic & Ergonomic UI
54+
Designed for developers who spend 8+ hours a day in their tools.
55+
- **Premium Monochrome Design**: A sleek, glassmorphic dark-mode interface that reduces eye strain.
56+
- **Dynamic Font Scaling**: Global font scaling (10px to 20px) ensures accessibility and comfort on any display density.
57+
- **Zero-Flicker Performance**: Optimized React components and IndexedDB caching for a snappy, native feel.
58+
59+
---
60+
61+
## 🛠️ Technical Architecture
62+
63+
API Documenter is engineered with a **Security-First** mindset:
64+
65+
- **Frontend**: React 18 & TypeScript for type-safe UI logic.
66+
- **Desktop Layer**: Electron with a hardened IPC bridge.
67+
- **Local Persistence**: **Dexie.js (IndexedDB)** for ultra-fast, offline-first data storage.
68+
- **Remote Bridge**: A serverless **Node.js Proxy** (deployed to Vercel) that handles DB pooling and RBAC authorization without exposing internal ports.
69+
- **State Engine**: **Zustand** for lightweight UI state and **React Query** for robust server-state synchronization.
70+
71+
---
72+
73+
## 📦 Installation & Setup
74+
75+
### For Developers
76+
77+
1. **Clone the repository:**
78+
```bash
79+
git clone https://github.com/PraneethKulukuri26/API-Documenter.git
80+
cd API-Documenter
81+
```
82+
83+
2. **Install dependencies:**
84+
```bash
85+
npm install
86+
```
87+
88+
3. **Start Development:**
89+
```bash
90+
npm run dev
91+
```
92+
93+
4. **Package for Distribution:**
94+
```bash
95+
npm run build:win # Windows
96+
npm run build:mac # macOS
97+
```
98+
99+
---
100+
101+
## 🛡️ Privacy Commitment
102+
103+
**Your data is yours.** API Documenter does not track your requests, store your passwords, or upload your documentation to external servers. All team collaboration happens through **your** database and **your** Vercel account.
104+
105+
---
106+
107+
<div align="center">
108+
Built for the community by <a href="https://github.com/PraneethKulukuri26">Praneeth Kulukuri</a>
109+
</div>

package-lock.json

Lines changed: 12 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "api-documenter",
3-
"version": "1.0.20",
3+
"version": "1.0.21",
44
"description": "Self-hosted Postman alternative with folder-level RBAC and offline-first documentation",
55
"main": "./out/main/index.js",
66
"author": "Praneeth Kulukuri",
@@ -43,6 +43,7 @@
4343
"react-markdown": "^10.1.0",
4444
"remark-gfm": "^4.0.1",
4545
"tiptap-markdown": "^0.9.0",
46+
"undici": "^7.25.0",
4647
"uuid": "^11.0.3",
4748
"zustand": "^5.0.2"
4849
},
@@ -96,4 +97,4 @@
9697
}
9798
]
9899
}
99-
}
100+
}

0 commit comments

Comments
 (0)