From f1360339f55d8958dc71404e688ee50bf8aeaf4d Mon Sep 17 00:00:00 2001 From: esh2n Date: Sat, 14 Sep 2024 13:41:43 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9A=20Writing=20docs:=20readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 113 ++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 92 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index e215bc4..3696cb0 100644 --- a/README.md +++ b/README.md @@ -1,36 +1,107 @@ -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). +# ๐ŸŒ Spanner GUI SQL Client -## Getting Started +๐Ÿš€ A simple and user-friendly GUI client for Google Cloud Spanner, built with Next.js and React. -First, run the development server: +## ๐ŸŒŸ Features + +- ๐Ÿ” Easy navigation of Spanner instances and databases +- โšก Execute SQL queries +- ๐Ÿ“Š View query results in a clean, tabular format +- ๐Ÿ“œ Query history for quick access to past operations +- ๐ŸŽจ Syntax highlighting and query formatting +- ๐Ÿ“ฑ Responsive design for desktop and mobile use + +## ๐Ÿ“ฆ Installation ```bash -npm run dev -# or -yarn dev -# or -pnpm dev -# or -bun dev +git clone https://github.com/esh2n/spanner-gui.git +cd spanner-gui +bun install +bun run dev.tauri +``` + +## ๐Ÿš€ Quick Start + +### 1. Set up Google Cloud credentials + +Ensure you have set up your Google Cloud credentials. You can do this by setting the `GOOGLE_APPLICATION_CREDENTIALS` environment variable to point to your service account key file. + +```shellscript +export GOOGLE_APPLICATION_CREDENTIALS="/path/to/your/service-account-key.json" +``` + +### 2. Run the development server + +```shellscript +bun run dev.tauri ``` -Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. +## ๐Ÿ–ฅ Usage + +1. Enter your Google Cloud Project ID and click "Initialize" +2. Select a Spanner instance from the dropdown +3. Choose a database from the selected instance +4. Write your SQL query in the editor +5. Click "Execute" to run the query +6. View results in the table below +7. Access query history in the "History" tab + + +## ๐Ÿ›  API Reference + +### POST /api/spanner + +Handles all Spanner-related operations. + +#### Request Body + +```typescript +{ + type: 'instances' | 'databases' | 'query', + projectId: string, + instanceId?: string, + databaseId?: string, + query?: string +} +``` + +#### Response + +- For `instances`: Array of instance names +- For `databases`: Array of database names +- For `query`: Array of result rows + + +## ๐Ÿค Contributing + +We welcome contributions! Here's how you can help: -You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. +1. ๐Ÿด Fork the repository +2. ๐ŸŒฟ Create your feature branch: `git checkout -b my-new-feature` +3. ๐Ÿ’พ Commit your changes: `git commit -am 'Add some feature'` +4. ๐Ÿš€ Push to the branch: `git push origin my-new-feature` +5. ๐ŸŽ‰ Submit a pull request -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. -## Learn More +## ๐Ÿ“ TODO -To learn more about Next.js, take a look at the following resources: +- ๐Ÿ”’ Implement user authentication +- ๐Ÿ“Š Add visual query plan explanation +- ๐Ÿ”„ Support for DML operations (INSERT, UPDATE, DELETE) +- ๐Ÿ“ˆ Query performance metrics +- ๐ŸŒ“ Dark mode support +- ๐Ÿงช Comprehensive unit and integration testing -- [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. -You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome! +## ๐Ÿ“œ License -## Deploy on Vercel +MIT -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. +## ๐Ÿ™ Acknowledgements -Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details. +- [Next.js](https://nextjs.org/) +- [React](https://reactjs.org/) +- [Tauri](https://tauri.app/) +- [Google Cloud Spanner](https://cloud.google.com/spanner) +- [Tailwind CSS](https://tailwindcss.com/) +- [shadcn/ui](https://ui.shadcn.com/) \ No newline at end of file