Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
310 changes: 64 additions & 246 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,286 +1,104 @@
<div align="center">

<img src="docs/public/logo.png" alt="LitePost" width="96" />

# LitePost

A lightweight, cross-platform API testing application built with Tauri, React, and TypeScript.
**A fast, lightweight API client — no accounts, no cloud, no junk.**

![image](https://github.com/user-attachments/assets/f0dc8163-c10c-4d71-9b19-99d92a448a1b)
Built with Tauri, Rust, and React. Your requests, collections, and history live in
plain JSON files on your machine and nowhere else.

[**Download**](https://github.com/LykosAI/LitePost/releases/latest) ·
[**Documentation**](https://lykos.ai/LitePost/) ·
[**Report an issue**](https://github.com/LykosAI/LitePost/issues)

<div align="center">
</div>

### 📥 Download LitePost
![LitePost in the default Night Desk theme](docs/public/screenshot-night-desk.png)

<table>
<tr>
<td align="center" colspan="3">
<h1>🪟</h1>
<b>Windows</b><br/>
<sub>64-bit Installer</sub><br/>
<a href="https://github.com/LykosAI/LitePost/releases/latest/download/litepost_x64-setup.exe">
⬇️ Download
</a>
</td>
<td width="62%"><img src="docs/public/screenshot-schematic.png" alt="The Schematic light theme" /></td>
<td><img src="docs/public/screenshot-palette.png" alt="The Ctrl+K command palette" /></td>
</tr>
<tr>
<td align="center">
<h1>🍎</h1>
<b>macOS</b> <sup><code>beta</code></sup><br/>
<sub>Apple Silicon</sub><br/>
<a href="https://github.com/LykosAI/LitePost/releases/latest/download/litepost_aarch64.app.tar.gz">
⬇️ Download
</a>
</td>
<td align="center">
<h1>🍎</h1>
<b>macOS</b> <sup><code>beta</code></sup><br/>
<sub>Intel Processor</sub><br/>
<a href="https://github.com/LykosAI/LitePost/releases/latest/download/litepost_x64.app.tar.gz">
⬇️ Download
</a>
</td>
<td align="center">
<h1>🐧</h1>
<b>Linux</b> <sup><code>beta</code></sup><br/>
<sub>AppImage (64-bit)</sub><br/>
<a href="https://github.com/LykosAI/LitePost/releases/latest/download/litepost_amd64.AppImage">
⬇️ Download
</a>
</td>
<td align="center"><sub>Schematic — the light theme</sub></td>
<td align="center"><sub>Ctrl+K — search everything, do anything</sub></td>
</tr>
</table>

> 🔄 All downloads are automatically updated to the latest version. [View all releases](https://github.com/LykosAI/LitePost/releases)
## Download

</div>
Grab the installer for your platform from the
[**latest release**](https://github.com/LykosAI/LitePost/releases/latest):

- **Windows** — `*_x64-setup.exe`
- **macOS** *(beta)* — `*_aarch64.app.tar.gz` (Apple Silicon) or `*_x64.app.tar.gz` (Intel)
- **Linux** *(beta)* — `*_amd64.AppImage`

## Prerequisites
No sign-up, no telemetry. LitePost updates itself in-app when new releases ship.

- [Node.js](https://nodejs.org/) (v18 or later)
- [pnpm](https://pnpm.io/) (v8 or later)
- [Rust](https://www.rust-lang.org/) (latest stable)
- Platform-specific dependencies for Tauri:
- **Windows**: Microsoft Visual Studio C++ Build Tools
- **macOS**: Xcode Command Line Tools
- **Linux**: `build-essential`, `libwebkit2gtk-4.0-dev`, `curl`, `wget`, `libssl-dev`, `libgtk-3-dev`, `libayatana-appindicator3-dev`, `librsvg2-dev`
> **macOS note:** builds are not yet notarized — right-click the app and choose **Open** the first time.

## Development Setup
## Features

1. Clone the repository:
```bash
git clone https://github.com/LykosAI/LitePost.git
cd LitePost
```
- **Command palette** — `Ctrl+K` fuzzy-searches history and collections, switches environments, and runs any action
- **Full HTTP toolkit** — all standard methods, headers/params/cookies editors, multipart file uploads, per-request network settings (timeout, SSL, proxy)
- **Auth that does the work** — Basic, Bearer, API Key, and OAuth 2.0 with PKCE, token refresh, and one-click endpoint auto-fill from OIDC discovery
- **Live responses** — collapsible JSON tree with a `$.path[*]`-style filter bar, HTML and image previews, timing waterfall, redirect chains
- **Streaming** — first-class SSE with per-chunk timestamps and cancellation, plus a WebSocket panel
- **Environments & variables** — `{{variable}}` substitution everywhere, with inline badges showing resolved values, and response extraction rules to capture values automatically
- **Collections** — save, organize, and batch-run requests; import from cURL, OpenAPI, or Postman format
- **Testing** — JavaScript test scripts, no-code assertions, and pre-request scripts
- **Code generation** — copy any request as cURL, Python, JavaScript, C#, Go, or Ruby
- **Six themes** — from the warm default **Night Desk** to the paper-and-cobalt **Schematic** light theme

2. Install dependencies:
```bash
pnpm install
```
Full guides for everything live in the [documentation](https://lykos.ai/LitePost/).

3. Start the development server:
```bash
pnpm tauri dev
```
## Development

## Building for Production
Prerequisites: [Node.js](https://nodejs.org/) 20+, [pnpm](https://pnpm.io/) 9,
[Rust](https://www.rust-lang.org/) stable, and the
[Tauri platform dependencies](https://v2.tauri.app/start/prerequisites/) for your OS.

To create a production build:
```bash
pnpm tauri build
git clone https://github.com/LykosAI/LitePost.git
cd LitePost
pnpm install
pnpm tauri dev
```

The built applications will be available in `src-tauri/target/release/bundle/`.
Production builds land in `src-tauri/target/release/bundle/`:

## Project Structure

```
litepost/
├── src/ # React frontend source
│ ├── components/ # React components
│ │ └── ui/ # Reusable UI components (shadcn/ui)
│ ├── hooks/ # Custom React hooks
│ ├── store/ # Zustand state management
│ ├── utils/ # Utility functions
│ ├── types/ # TypeScript type definitions
│ └── test/ # Test files
├── src-tauri/ # Rust backend source
│ ├── src/ # Rust source code
│ └── capabilities/ # Tauri capability configurations
├── public/ # Static assets
├── coverage/ # Test coverage reports
└── dist/ # Production build output
```bash
pnpm tauri build
```

Key directories:
- `src/components/`: React components organized by feature
- `src/hooks/`: Custom hooks for API requests, state management, etc.
- `src/store/`: Zustand stores for collections, environments, and settings
- `src/test/`: Unit tests using Vitest and React Testing Library
- `src-tauri/`: Rust backend with HTTP client and file system operations

## Features 🚀

- 🎨 Modern, native UI built with React, Tailwind CSS, and Shadcn UI
- 💻 Cross-platform support (Windows, macOS, Linux)

### Request & Authentication 🔐
- Multiple request tabs with history
- Authentication support:
- Basic Auth
- Bearer Token
- API Key (header and query parameter)
- Custom request headers and parameters
- 📝 Code generation for multiple languages (curl, Python, JavaScript, C#, Go, Ruby)

### Response Handling 📊
- Advanced response visualization:
- ✨ JSON prettification with syntax highlighting
- 📄 XML formatting
- 🌐 HTML preview
- 🖼️ Image preview
- Response metrics:
- 📏 Size measurements
- ⚡ Request/response timing
- 📈 Network timing breakdown (DNS, First byte, Download time)

### Environment Management 🌍
- Create, edit, and delete environments
- Variable substitution
- Environment switching
- Environment-specific variables

### Collections 📁
- Save and organize requests in collections
- Basic folder organization
- Import/export collections
- Postman format compatibility

### Testing ✅
- JavaScript-based test scripts
- Comprehensive test assertions:
- Status code validation
- JSON value verification
- Header checks
- Response time validation
- Test execution with results display

## Testing 🧪

The project uses Vitest for testing. Here are the available test commands:
### Tests

```bash
# Run all tests
pnpm test

# Run tests in watch mode (useful during development)
pnpm test:watch

# Run tests with coverage report
pnpm test:coverage

# Run tests for a specific file
pnpm test RequestUrlBar
pnpm test:run # frontend (Vitest + React Testing Library)
pnpm test:coverage # with coverage report
cargo test # Rust backend (run inside src-tauri/)
```

The test suite currently includes:
- Unit tests for React components using React Testing Library
- Component mocking (e.g., Radix UI components)
- Event handling tests
- State management tests
- Coverage reporting with v8

Coverage reports can be found in:
- Terminal output (text format)
- `coverage/` directory (HTML and JSON formats)

### Planned Test Improvements 🎯

We plan to add:
- Integration tests for API request/response flows
- End-to-end tests for critical user journeys
- Performance testing for large responses
- Cross-platform compatibility tests

### Writing Tests 📝
### Docs site

Tests are located in `src/test/` and follow the naming convention `*.test.tsx`. Each test file should:
- Import necessary testing utilities from `vitest` and `@testing-library/react`
- Mock external dependencies when needed
- Use React Testing Library's best practices for component testing
The documentation is a [VitePress](https://vitepress.dev/) site in `docs/`,
deployed automatically to [lykos.ai/LitePost](https://lykos.ai/LitePost/) on merge:

Example test structure:
```typescript
import { describe, it, expect, vi } from 'vitest'
import { render, screen } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import { YourComponent } from '@/components/YourComponent'

describe('YourComponent', () => {
interface SetupOptions {
initialValue?: string
isDisabled?: boolean
}

const setup = (options: SetupOptions = {}) => {
const user = userEvent.setup()
const props = {
value: options.initialValue || '',
isDisabled: options.isDisabled || false,
onChange: vi.fn(),
onSubmit: vi.fn(),
}

const utils = render(<YourComponent {...props} />)

return {
user,
...utils,
...props,
}
}

it('renders with default props', () => {
setup()
expect(screen.getByRole('textbox')).toBeInTheDocument()
expect(screen.getByRole('button')).toBeEnabled()
})

it('handles user input and submission', async () => {
const { user, onChange, onSubmit } = setup()

const input = screen.getByRole('textbox')
const button = screen.getByRole('button')

await user.type(input, 'Hello')
expect(onChange).toHaveBeenCalledWith('Hello')

await user.click(button)
expect(onSubmit).toHaveBeenCalled()
})

it('respects disabled state', () => {
setup({ isDisabled: true })
expect(screen.getByRole('textbox')).toBeDisabled()
expect(screen.getByRole('button')).toBeDisabled()
})
})
```bash
pnpm docs:dev
```
## Contributing 🤝

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

## License ⚖️
## Contributing

This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). This means:
Issues and pull requests are welcome. Branch from `main`, keep commits focused,
and make sure `pnpm test:run` and `cargo check` pass — CI enforces both. See the
[contributing guide](https://lykos.ai/LitePost/contributing) for details.

- You can use this software for any purpose
- You can modify this software
- You can distribute this software
- You must include the license and copyright notice with each copy
- You must disclose your source code when you distribute the software
- You must state changes made to the code
- If you use this software over a network, you must make your modified version available to users of that network
## License

See the [LICENSE](LICENSE) file for the full license text.
[AGPL-3.0](LICENSE) — free to use, modify, and distribute; derivatives must remain
open source, including when served over a network.
Binary file added docs/public/screenshot-night-desk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/public/screenshot-palette.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/public/screenshot-schematic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading