diff --git a/README.md b/README.md index 8dab68c..2bc013d 100644 --- a/README.md +++ b/README.md @@ -1,286 +1,104 @@ +
+ +LitePost + # 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) -
+
-### ๐Ÿ“ฅ Download LitePost +![LitePost in the default Night Desk theme](docs/public/screenshot-night-desk.png) - + + - - - + +
-

๐ŸชŸ

-Windows
-64-bit Installer
- -โฌ‡๏ธ Download - -
The Schematic light themeThe Ctrl+K command palette
-

๐ŸŽ

-macOS beta
-Apple Silicon
- -โฌ‡๏ธ Download - -
-

๐ŸŽ

-macOS beta
-Intel Processor
- -โฌ‡๏ธ Download - -
-

๐Ÿง

-Linux beta
-AppImage (64-bit)
- -โฌ‡๏ธ Download - -
Schematic โ€” the light themeCtrl+K โ€” search everything, do anything
-> ๐Ÿ”„ All downloads are automatically updated to the latest version. [View all releases](https://github.com/LykosAI/LitePost/releases) +## Download -
+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() - - 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. diff --git a/docs/public/screenshot-night-desk.png b/docs/public/screenshot-night-desk.png new file mode 100644 index 0000000..381970f Binary files /dev/null and b/docs/public/screenshot-night-desk.png differ diff --git a/docs/public/screenshot-palette.png b/docs/public/screenshot-palette.png new file mode 100644 index 0000000..a4f5d62 Binary files /dev/null and b/docs/public/screenshot-palette.png differ diff --git a/docs/public/screenshot-schematic.png b/docs/public/screenshot-schematic.png new file mode 100644 index 0000000..2583100 Binary files /dev/null and b/docs/public/screenshot-schematic.png differ