diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..dbc1dce --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,39 @@ +--- +name: Bug Report +about: Report a bug to help us improve data-peek +title: '[Bug] ' +labels: bug +assignees: '' +--- + +## Description + +A clear and concise description of the bug. + +## Steps to Reproduce + +1. Go to '...' +2. Click on '...' +3. See error + +## Expected Behavior + +What you expected to happen. + +## Actual Behavior + +What actually happened. + +## Screenshots + +If applicable, add screenshots to help explain the problem. + +## Environment + +- **OS**: [e.g., macOS 14.0, Windows 11, Ubuntu 22.04] +- **data-peek version**: [e.g., 1.0.0] +- **Database**: [e.g., PostgreSQL 15] + +## Additional Context + +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..e03cb8e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,23 @@ +--- +name: Feature Request +about: Suggest a feature for data-peek +title: '[Feature] ' +labels: enhancement +assignees: '' +--- + +## Problem + +A clear description of the problem you're trying to solve. + +## Proposed Solution + +Describe the solution you'd like. + +## Alternatives Considered + +Any alternative solutions or features you've considered. + +## Additional Context + +Add any other context, mockups, or examples here. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..e2d05cd --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,30 @@ +## Summary + +Brief description of the changes. + +## Changes + +- Change 1 +- Change 2 + +## Related Issues + +Fixes #(issue number) + +## Type of Change + +- [ ] Bug fix +- [ ] New feature +- [ ] Breaking change +- [ ] Documentation update + +## Checklist + +- [ ] My code follows the project's style guidelines +- [ ] I have performed a self-review +- [ ] I have tested my changes +- [ ] I have updated documentation if needed + +## Screenshots (if applicable) + +Add screenshots for UI changes. diff --git a/.gitignore b/.gitignore index 7b11b3a..2e955eb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,34 @@ node_modules/ dist/ +out/ # Business documentation (contains sensitive info) -docs/ \ No newline at end of file +docs/ + +# OS files +.DS_Store +Thumbs.db + +# IDE +.idea/ +.vscode/ +*.swp +*.swo + +# Environment files +.env +.env.local +.env.*.local + +# Build outputs +*.tsbuildinfo +.next/ +.turbo/ + +# Logs +*.log +npm-debug.log* +pnpm-debug.log* + +# Test coverage +coverage/ \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..0a58c5b --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,85 @@ +# Contributing to data-peek + +Thank you for your interest in contributing to data-peek! This document provides guidelines and instructions for contributing. + +## Getting Started + +1. Fork the repository +2. Clone your fork: + ```bash + git clone https://github.com/YOUR_USERNAME/data-peek.git + cd data-peek + ``` +3. Install dependencies: + ```bash + pnpm install + ``` +4. Create a branch for your changes: + ```bash + git checkout -b feature/your-feature-name + ``` + +## Development + +```bash +# Start the desktop app in development mode +pnpm dev + +# Start the web app +pnpm dev:web + +# Run linting +pnpm lint + +# Type checking (from apps/desktop) +cd apps/desktop +pnpm typecheck +``` + +## Project Structure + +``` +apps/ + desktop/ # Electron desktop app + src/main/ # Main process (Node.js) + src/preload/ # IPC bridge + src/renderer/ # React frontend + web/ # Marketing website +packages/ + shared/ # Shared TypeScript types +``` + +## Code Style + +- We use Prettier for formatting (single quotes, no semicolons) +- TypeScript strict mode is enabled +- Run `pnpm lint` before committing + +## Pull Request Process + +1. Ensure your code passes linting and type checking +2. Update documentation if you're adding new features +3. Write clear commit messages +4. Open a PR against the `main` branch +5. Describe what your PR does and why + +## Reporting Issues + +When reporting issues, please include: + +- Your operating system and version +- Steps to reproduce the issue +- Expected vs actual behavior +- Screenshots if applicable + +## Feature Requests + +Feature requests are welcome! Please open an issue describing: + +- The problem you're trying to solve +- Your proposed solution +- Any alternatives you've considered + +## License + +By contributing, you agree that your contributions will be licensed under the MIT License. diff --git a/README.md b/README.md new file mode 100644 index 0000000..c6cb14f --- /dev/null +++ b/README.md @@ -0,0 +1,99 @@ +# data-peek + +A minimal, fast, lightweight PostgreSQL client desktop application. Built for developers who want to quickly peek at their data without the bloat. + +## Features + +- **Fast** - Opens in under 2 seconds, low memory footprint +- **Query Editor** - Monaco editor with SQL syntax highlighting and autocomplete +- **Multi-tab Support** - Work with multiple queries simultaneously +- **Inline Editing** - Edit table data directly with INSERT/UPDATE/DELETE +- **ERD Visualization** - See table relationships visually +- **Query Plans** - Analyze query performance with EXPLAIN ANALYZE viewer +- **Dark/Light Mode** - Easy on the eyes +- **Keyboard-First** - Power users shouldn't need a mouse +- **Secure** - Connection credentials encrypted locally, no telemetry + +## Installation + +### Download + +Download the latest release for your platform from [Releases](https://github.com/Rohithgilla12/data-peek/releases). + +- **macOS**: `.dmg` (Intel & Apple Silicon) +- **Windows**: `.exe` installer +- **Linux**: `.AppImage` or `.deb` + +### Build from Source + +```bash +# Clone the repository +git clone https://github.com/Rohithgilla12/data-peek.git +cd data-peek + +# Install dependencies +pnpm install + +# Run in development mode +pnpm dev + +# Build for your platform +pnpm build:mac # macOS +pnpm build:win # Windows +pnpm build:linux # Linux +``` + +## Tech Stack + +| Layer | Technology | +|-------|------------| +| Desktop | Electron | +| Frontend | React 19 + TypeScript | +| UI | shadcn/ui + Tailwind CSS | +| State | Zustand | +| Query Editor | Monaco | +| Database | pg (PostgreSQL driver) | + +## Project Structure + +``` +apps/ + desktop/ # Electron desktop application + web/ # Marketing website + licensing +packages/ + shared/ # Shared types for IPC +``` + +## Development + +```bash +# Install dependencies +pnpm install + +# Start desktop app with hot reload +pnpm dev + +# Start web app +pnpm dev:web + +# Lint all workspaces +pnpm lint + +# Build desktop app +pnpm build +``` + +## License + +MIT License - see [LICENSE](LICENSE) for details. + +Pre-built binaries require a license for commercial use. See the license file for details on free vs. commercial use. + +## Contributing + +Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines. + +## Support + +- [GitHub Issues](https://github.com/Rohithgilla12/data-peek/issues) - Bug reports and feature requests +- Twitter/X: [@gillarohith](https://x.com/gillarohith) diff --git a/apps/desktop/package.json b/apps/desktop/package.json index 4c4ab2c..fe46a85 100644 --- a/apps/desktop/package.json +++ b/apps/desktop/package.json @@ -1,6 +1,6 @@ { "name": "@data-peek/desktop", - "version": "1.0.0", + "version": "0.1.0", "description": "A minimal, fast, lightweight PostgreSQL client", "main": "./out/main/index.js", "author": "Rohith Gilla", diff --git a/apps/desktop/src/renderer/src/components/connection-switcher.tsx b/apps/desktop/src/renderer/src/components/connection-switcher.tsx index 4addd46..a276378 100644 --- a/apps/desktop/src/renderer/src/components/connection-switcher.tsx +++ b/apps/desktop/src/renderer/src/components/connection-switcher.tsx @@ -282,8 +282,8 @@ export function ConnectionSwitcher() { Delete connection? - Are you sure you want to delete "{deletingConnection?.name}"? This action cannot be - undone. + Are you sure you want to delete "{deletingConnection?.name}"? This action + cannot be undone. diff --git a/apps/desktop/src/renderer/src/components/license-activation-modal.tsx b/apps/desktop/src/renderer/src/components/license-activation-modal.tsx index 39441d2..aa7299e 100644 --- a/apps/desktop/src/renderer/src/components/license-activation-modal.tsx +++ b/apps/desktop/src/renderer/src/components/license-activation-modal.tsx @@ -127,7 +127,7 @@ export function LicenseActivationModal({ open, onOpenChange }: LicenseActivation

- Don't have a license?{' '} + Don't have a license?{' '} - {isPreviewLoading ? : } + {isPreviewLoading ? ( + + ) : ( + + )} Preview SQL

@@ -422,11 +426,10 @@ export function TableDesigner({ tabId }: TableDesignerProps) {
{/* Column rows */} - {definition.columns.map((col, index) => ( + {definition.columns.map((col) => ( e.field.startsWith(`column.${col.id}`) @@ -552,9 +555,7 @@ export function TableDesigner({ tabId }: TableDesignerProps) { SQL Preview - - This SQL will be executed to create the table. - + This SQL will be executed to create the table.
{previewSql}
@@ -577,7 +578,6 @@ export function TableDesigner({ tabId }: TableDesignerProps) { // Column row component interface ColumnRowProps { column: ColumnDefinition - index: number isSelected: boolean validationErrors: ValidationError[] onSelect: () => void @@ -588,7 +588,6 @@ interface ColumnRowProps { function ColumnRow({ column, - index: _index, isSelected, validationErrors, onSelect, @@ -653,7 +652,9 @@ function ColumnRow({ onChange('length', e.target.value ? parseInt(e.target.value) : undefined)} + onChange={(e) => + onChange('length', e.target.value ? parseInt(e.target.value) : undefined) + } placeholder="n" className="h-8 w-14 text-center" /> @@ -663,14 +664,18 @@ function ColumnRow({ onChange('precision', e.target.value ? parseInt(e.target.value) : undefined)} + onChange={(e) => + onChange('precision', e.target.value ? parseInt(e.target.value) : undefined) + } placeholder="p" className="h-8 w-12 text-center" /> onChange('scale', e.target.value ? parseInt(e.target.value) : undefined)} + onChange={(e) => + onChange('scale', e.target.value ? parseInt(e.target.value) : undefined) + } placeholder="s" className="h-8 w-12 text-center" /> diff --git a/apps/web/README.md b/apps/web/README.md index e215bc4..d6dfa6b 100644 --- a/apps/web/README.md +++ b/apps/web/README.md @@ -1,36 +1,44 @@ -This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app). +# data-peek Web -## Getting Started +Marketing website and licensing portal for data-peek. -First, run the development server: +## Tech Stack + +- Next.js 16 (App Router) +- Tailwind CSS 4 +- Clerk (Authentication) +- Drizzle ORM + PostgreSQL +- DodoPayments (Payments) +- Resend (Emails) + +## Development ```bash -npm run dev -# or -yarn dev -# or +# From the root directory +pnpm dev:web + +# Or from this directory pnpm dev -# or -bun dev ``` -Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. +Open [http://localhost:3000](http://localhost:3000) to view the site. -You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. +## Environment Variables -This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. +Copy `.env.example` to `.env.local` and fill in the values: -## Learn More +```bash +cp .env.example .env.local +``` -To learn more about Next.js, take a look at the following resources: +Required variables: +- `DATABASE_URL` - PostgreSQL connection string +- `CLERK_SECRET_KEY` - Clerk authentication +- `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` - Clerk public key +- `DODO_API_KEY` - DodoPayments API key +- `DODO_WEBHOOK_SECRET` - DodoPayments webhook secret +- `RESEND_API_KEY` - Resend email API key -- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. -- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. +## Deployment -You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome! - -## Deploy on Vercel - -The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. - -Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details. +The web app is designed to be deployed on Vercel. diff --git a/package.json b/package.json index 81ed45d..bd7b891 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "data-peek", - "version": "1.0.0", + "version": "0.1.0", "description": "", "main": "index.js", "scripts": { diff --git a/packages/shared/package.json b/packages/shared/package.json index b824644..b34fa2a 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@data-peek/shared", - "version": "0.0.1", + "version": "0.1.0", "private": true, "main": "./src/index.ts", "types": "./src/index.ts",