diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..a61978d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,46 @@ +name: Bug report +description: Report a problem with Hypr +labels: ["bug"] +body: + - type: markdown + attributes: + value: Thanks for taking the time to file a bug! Please fill out the sections below. + - type: textarea + id: what-happened + attributes: + label: What happened? + description: A clear description of the bug, including what you expected to happen. + validations: + required: true + - type: textarea + id: repro + attributes: + label: Steps to reproduce + placeholder: | + 1. Open Hypr + 2. ... + 3. See error + validations: + required: true + - type: input + id: version + attributes: + label: Hypr version + placeholder: e.g. v0.1.0 (or "built from source @ ") + validations: + required: true + - type: dropdown + id: os + attributes: + label: Operating system + options: + - macOS + - Windows + - Linux + validations: + required: true + - type: textarea + id: extra + attributes: + label: Logs / screenshots + description: Any relevant logs, error output, or screenshots. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..465995d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: Security vulnerability + url: https://github.com/dropdevrahul/hypr/security/advisories/new + about: Please report security issues privately, not as a public issue. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000..69a5167 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,23 @@ +name: Feature request +description: Suggest an idea or improvement for Hypr +labels: ["enhancement"] +body: + - type: textarea + id: problem + attributes: + label: Problem / motivation + description: What are you trying to do, and what's getting in the way? + validations: + required: true + - type: textarea + id: proposal + attributes: + label: Proposed solution + description: Describe the feature or change you'd like to see. + validations: + required: true + - type: textarea + id: alternatives + attributes: + label: Alternatives considered + description: Any workarounds or alternative approaches you've thought about. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..7e29816 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,25 @@ +## Summary + + + +## Related issues + + + +## Type of change + +- [ ] Bug fix +- [ ] New feature +- [ ] Documentation +- [ ] Refactor / chore + +## Checklist + +- [ ] `go vet ./...` and `go test ./...` pass +- [ ] `cd frontend && npm run build` passes (typecheck + build) +- [ ] I updated `CHANGELOG.md` under **Unreleased** (if user-facing) +- [ ] I updated docs where relevant + +## Screenshots + + diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..82bd766 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,46 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + +permissions: + contents: read + +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + +jobs: + backend: + name: Backend (Go) + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: '1.22' + cache: true + - name: Vet + run: go vet ./... + - name: Test + run: go test -race ./... + + frontend: + name: Frontend (build + typecheck) + runs-on: ubuntu-22.04 + defaults: + run: + working-directory: frontend + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '20' + cache: npm + cache-dependency-path: frontend/package-lock.json + - name: Install + run: npm ci + - name: Build (runs tsc) + run: npm run build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..e0667d9 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,80 @@ +name: Release + +on: + push: + tags: + - 'v*' + +permissions: + contents: write + +jobs: + build: + name: Build (${{ matrix.name }}) + strategy: + fail-fast: false + matrix: + include: + - name: hypr-macos-universal + platform: darwin/universal + os: macos-latest + - name: hypr-linux-amd64 + platform: linux/amd64 + os: ubuntu-22.04 + - name: hypr-windows-amd64 + platform: windows/amd64 + os: windows-latest + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + + - name: Build with Wails + uses: dAppServer/wails-build-action@v2.2 + with: + build-name: hypr + build-platform: ${{ matrix.platform }} + go-version: '1.22' + node-version: '20' + wails-version: 'v2.12.0' + package: false + + - name: Archive (macOS / Linux) + if: runner.os != 'Windows' + run: | + cd build/bin + if [ "$RUNNER_OS" = "macOS" ]; then + ditto -c -k --keepParent hypr.app "../../${{ matrix.name }}.zip" + else + tar -czf "../../${{ matrix.name }}.tar.gz" hypr + fi + + - name: Archive (Windows) + if: runner.os == 'Windows' + shell: pwsh + run: Compress-Archive -Path build/bin/hypr.exe -DestinationPath "${{ matrix.name }}.zip" + + - uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.name }} + path: | + ${{ matrix.name }}.zip + ${{ matrix.name }}.tar.gz + if-no-files-found: ignore + + release: + name: Publish release + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v4 + with: + path: dist + merge-multiple: true + + - name: Create GitHub Release + uses: softprops/action-gh-release@v2 + with: + files: dist/* + generate_release_notes: true + draft: false + prerelease: ${{ contains(github.ref_name, '-') }} diff --git a/.gitignore b/.gitignore index 129d522..f82c248 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,9 @@ build/bin node_modules frontend/dist + +# OS / editor cruft +.DS_Store +*.swp +.idea/ +.vscode/ diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..eb80106 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,46 @@ +# Changelog + +All notable changes to this project are documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +### Added +- Complete UI redesign on Tailwind CSS + shadcn/ui (Radix), with IBM Plex typography + and a reusable component kit under `frontend/src/components/ui/`. +- In-app JSON syntax highlighting for response bodies and headers. +- Send loading state and Enter-to-send in the URL field. +- Go unit tests for the cURL parser and HTTP header helpers (`go test ./...`). +- Continuous Integration workflow (Go vet/test + frontend build). +- Cross-platform release workflow that builds macOS/Windows/Linux binaries on `v*` tags. +- Contributor documentation: `CONTRIBUTING.md`, `CODE_OF_CONDUCT.md`, `SECURITY.md`, + issue/PR templates, and this changelog. + +### Changed +- cURL import now populates the header rows and request body of the active tab. +- The response view now follows the active request tab. +- The "add header" action moved next to the Request Headers title. + +### Fixed +- Request headers were serialized to an empty object and not sent; they are now sent correctly. +- Corrected the application window title (`Hpyr` → `Hypr`). + +## [0.0.3] - 2023-07-15 +### Added +- Dark theme. +- Support for multiple request bodies. + +## [0.0.2] - 2023-06-22 +### Added +- cURL import support. + +## [0.0.1] - 2023-06-21 +### Added +- Initial release. + +[Unreleased]: https://github.com/dropdevrahul/hypr/compare/v0.0.3...HEAD +[0.0.3]: https://github.com/dropdevrahul/hypr/compare/v0.0.2...v0.0.3 +[0.0.2]: https://github.com/dropdevrahul/hypr/compare/v0.0.1...v0.0.2 +[0.0.1]: https://github.com/dropdevrahul/hypr/releases/tag/v0.0.1 diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..6bc4247 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,55 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our community a +harassment-free experience for everyone, regardless of age, body size, visible or invisible +disability, ethnicity, sex characteristics, gender identity and expression, level of experience, +education, socio-economic status, nationality, personal appearance, race, religion, or sexual +identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, +and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment: + +- Demonstrating empathy and kindness toward other people +- Being respectful of differing opinions, viewpoints, and experiences +- Giving and gracefully accepting constructive feedback +- Accepting responsibility and apologizing to those affected by our mistakes +- Focusing on what is best for the overall community + +Examples of unacceptable behavior: + +- The use of sexualized language or imagery, and sexual attention or advances of any kind +- Trolling, insulting or derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information without explicit permission +- Other conduct which could reasonably be considered inappropriate in a professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards and will take +appropriate and fair corrective action in response to any behavior that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when an individual is +officially representing the community in public spaces. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the +maintainers at **rahul.1992.tyagi@gmail.com**. All complaints will be reviewed and investigated +promptly and fairly. All community leaders are obligated to respect the privacy and security of +the reporter of any incident. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at +https://www.contributor-covenant.org/version/2/1/code_of_conduct.html. + +[homepage]: https://www.contributor-covenant.org diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..b5d4625 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,82 @@ +# Contributing to Hypr + +Thanks for your interest in improving Hypr! This document covers how to set up the project, +the conventions we follow, and how releases are cut. + +By participating, you agree to abide by our [Code of Conduct](CODE_OF_CONDUCT.md). + +## Getting started + +1. **Fork** the repo and clone your fork. +2. Install the prerequisites (see [README → Build from source](README.md#build-from-source)): + Go 1.22+, Node.js 18+, and the Wails v2 CLI. Run `wails doctor` to verify. +3. Start the app in dev mode: + + ```bash + wails dev + ``` + +## Project layout + +| Path | What it is | +|------|-----------| +| `main.go`, `app.go` | Wails entry point and the Go methods bound to the UI | +| `parse_curl.go` | cURL → request parser | +| `export.go` | JSON export via native save dialog | +| `frontend/` | React + TypeScript + Tailwind/shadcn UI | +| `*_test.go` | Go unit tests | + +See [CLAUDE.md](CLAUDE.md) for a fuller architecture overview. + +## Development workflow + +1. Create a branch from `main`: `git checkout -b feat/short-description`. +2. Make your change. Keep commits focused and write clear messages + (we loosely follow [Conventional Commits](https://www.conventionalcommits.org): + `feat:`, `fix:`, `docs:`, `chore:`, `refactor:`, `test:`). +3. Make sure checks pass locally (see below). +4. Open a pull request against `main` and fill out the PR template. + +## Checks + +Before pushing, run the same checks CI runs: + +```bash +# Backend +go vet ./... +go test ./... + +# Frontend (typecheck + build) +cd frontend && npm ci && npm run build +``` + +CI ([`.github/workflows/ci.yml`](.github/workflows/ci.yml)) runs these on every push and pull request. + +## Releasing + +Hypr follows [Semantic Versioning](https://semver.org) (`MAJOR.MINOR.PATCH`): + +- **MAJOR** — breaking changes to behavior or exported APIs. +- **MINOR** — new, backwards-compatible features. +- **PATCH** — backwards-compatible bug fixes. + +Releases are cut from `main` by a maintainer: + +1. Move the entries under `## [Unreleased]` in [CHANGELOG.md](CHANGELOG.md) into a new + `## [X.Y.Z] - YYYY-MM-DD` section and open a "release prep" PR. +2. Once merged, tag the release and push the tag: + + ```bash + git checkout main && git pull + git tag -a vX.Y.Z -m "vX.Y.Z" + git push origin vX.Y.Z + ``` + +3. Pushing a `v*` tag triggers the [release workflow](.github/workflows/release.yml), which + builds macOS, Windows, and Linux binaries and publishes a GitHub Release with the artifacts attached. +4. Pre-releases use a hyphenated suffix (e.g. `v1.2.0-rc.1`) and are automatically marked as pre-release. + +## Reporting bugs & requesting features + +Use the [issue templates](https://github.com/dropdevrahul/hypr/issues/new/choose). For security +issues, please follow [SECURITY.md](SECURITY.md) instead of opening a public issue. diff --git a/README.md b/README.md index 4e4a30e..ad1039d 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,108 @@ +
+ # Hypr -## About -A desktop application build using wails and reactjs to perform REST APIs +**A fast, cross-platform desktop REST API client — a lightweight Postman / Insomnia alternative.** + +Build, send, and inspect HTTP requests from a native desktop app powered by a Go engine and a React UI. + +[![CI](https://github.com/dropdevrahul/hypr/actions/workflows/ci.yml/badge.svg)](https://github.com/dropdevrahul/hypr/actions/workflows/ci.yml) +[![Release](https://img.shields.io/github/v/release/dropdevrahul/hypr?sort=semver)](https://github.com/dropdevrahul/hypr/releases) +[![License: MIT](https://img.shields.io/github/license/dropdevrahul/hypr)](LICENSE) +[![Go](https://img.shields.io/github/go-mod/go-version/dropdevrahul/hypr)](go.mod) +![Platforms](https://img.shields.io/badge/platforms-macOS%20%7C%20Windows%20%7C%20Linux-blue) + +Hypr screenshot + +
+ +## Features + +- ⚡ **Native & fast** — a single self-contained binary; the HTTP engine runs in Go, not a bundled browser runtime. +- 🗂️ **Tabbed requests** — work on multiple requests side by side. +- 🧩 **Header editor** — manage request headers as simple key/value pairs. +- 📥 **Import from cURL** — paste a `curl` command and it's parsed, populated, and run instantly. +- 🎨 **Syntax-highlighted responses** — pretty-printed JSON bodies and response headers. +- 💾 **Export** — save a request and its response to JSON via a native file dialog. +- 🖥️ **Cross-platform** — macOS, Windows, and Linux. + +## Download + +Grab the latest build for your platform from the [**Releases**](https://github.com/dropdevrahul/hypr/releases/latest) page: + +| Platform | Asset | +|----------|-------| +| macOS (universal) | `hypr-macos-universal.zip` | +| Windows (x64) | `hypr-windows-amd64.zip` | +| Linux (x64) | `hypr-linux-amd64.tar.gz` | + +> [!NOTE] +> macOS builds are ad-hoc signed. On first launch you may need to right-click → **Open**, or run +> `xattr -dr com.apple.quarantine /Applications/hypr.app`. + +## Build from source + +### Prerequisites + +- [Go](https://go.dev/dl/) 1.22+ +- [Node.js](https://nodejs.org/) 18+ +- [Wails CLI](https://wails.io/docs/gettingstarted/installation/) v2 — `go install github.com/wailsapp/wails/v2/cmd/wails@latest` + +Run `wails doctor` to verify your toolchain and platform dependencies. + +### Develop + +```bash +wails dev +``` + +Live development with Vite HMR for the frontend. A browser dev server is also available at +`http://localhost:34115` where you can call the Go methods from devtools. (Go changes require a restart.) + +### Build a production binary + +```bash +wails build +``` + +Produces a native executable in `build/bin/`. + +## Usage + +1. Pick a **method**, enter a **URL**, and hit **Send** (or press Enter in the URL field). +2. Add **request headers** as key/value rows and write a **request body**. +3. Use the **+** tab button to keep multiple requests open at once. +4. Click **Import cURL** to paste a `curl` command — it fills the current tab and runs immediately. +5. Click **Export** to save the request/response as JSON. + +## Tech stack + +| Layer | Tech | +|-------|------| +| Shell | [Wails v2](https://wails.io) (native webview, no Electron) | +| Backend | Go — `net/http` client, cURL parser | +| Frontend | React + TypeScript, Vite | +| UI | Tailwind CSS + [shadcn/ui](https://ui.shadcn.com) (Radix), lucide-react, IBM Plex | + +See [CLAUDE.md](CLAUDE.md) for an architecture overview. + +## Contributing + +Contributions are welcome! Please read [CONTRIBUTING.md](CONTRIBUTING.md) and the +[Code of Conduct](CODE_OF_CONDUCT.md) before opening an issue or pull request. + +Run the test suite with: + +```bash +go test ./... # backend +cd frontend && npm run build # frontend typecheck + build +``` -## Screenshots -![example](examples/hypr2.png) +## Releases -## Live Development -Install Go requirements using `go mod tidy` -Please install the requirements for wails as mentioned here [wails](https://wails.io/docs/gettingstarted/installation/) or use the `wails doctor` command +Hypr follows [Semantic Versioning](https://semver.org). See [CHANGELOG.md](CHANGELOG.md) for release history +and the [release process](CONTRIBUTING.md#releasing) for how versions are cut. -To run in live development mode, run `wails dev` in the project directory. This will run a Vite development -server that will provide very fast hot reload of your frontend changes. If you want to develop in a browser -and have access to your Go methods, there is also a dev server that runs on http://localhost:34115. Connect -to this in your browser, and you can call your Go code from devtools. +## License -## Building -To build a redistributable, production mode package, use `wails build` and this will generate a executable application for your system. +[MIT](LICENSE) © Rahul Tyagi diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..8df75c4 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,19 @@ +# Security Policy + +## Supported Versions + +Security fixes are applied to the latest released version. Please make sure you are running the +most recent [release](https://github.com/dropdevrahul/hypr/releases/latest) before reporting. + +## Reporting a Vulnerability + +Please **do not** open a public issue for security vulnerabilities. + +Instead, report them privately via one of: + +- GitHub's [private vulnerability reporting](https://github.com/dropdevrahul/hypr/security/advisories/new) +- Email: **rahul.1992.tyagi@gmail.com** + +Please include a description of the issue, steps to reproduce, and the affected version. We aim to +acknowledge reports within a few days and will keep you updated on remediation progress. Once a fix +is released, we're happy to credit you (unless you'd prefer to remain anonymous). diff --git a/examples/hypr.png b/examples/hypr.png new file mode 100644 index 0000000..3fa1a29 Binary files /dev/null and b/examples/hypr.png differ diff --git a/examples/hypr2.png b/examples/hypr2.png deleted file mode 100644 index 92495c7..0000000 Binary files a/examples/hypr2.png and /dev/null differ