Skip to content

About

A powerful tool for testing, saving, and sharing API requests. Features include Google authentication via Supabase, saving private and public requests, and generating code examples.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

API Network Hub

A powerful tool for testing, saving, and sharing API requests. Features include Google authentication via Supabase, saving private and public requests, and generating code examples.

Features

  • 🔐 User Authentication with Google (via Supabase)
  • 💾 Save API Requests privately or publicly
  • 🚀 Test API Endpoints with different methods (GET, POST, PUT, DELETE, PATCH)
  • 🔄 Generate Code Examples in multiple languages (JavaScript, Python, cURL)
  • 📦 Export Documentation for your API requests
  • 🔗 Share Requests via URL (with optional password protection)
  • 🏷️ Tag System for organizing requests

Setup Instructions

1. Clone the repository

git clone https://your-repository-url.git
cd api-network-hub

2. Install dependencies

npm install
# or
yarn install
# or
pnpm install

3. Set up Supabase

  1. Create a Supabase account at https://supabase.com

  2. Create a new Supabase project

  3. Set up Authentication:

    • Go to Authentication > Providers
    • Enable Google provider
    • Create OAuth credentials in the Google Cloud Console:
      • Create OAuth 2.0 Client ID
      • Set authorized redirect URI to: https://[YOUR_SUPABASE_PROJECT].supabase.co/auth/v1/callback
    • Add Client ID and Client Secret to Supabase
  4. Run the database migrations:

    • Go to the SQL Editor in your Supabase dashboard
    • Create a new query and paste the contents of the migration file
    • Run the query to create the necessary tables and policies

4. Configure environment variables

Create a .env.local file in the root of your project with the following variables:

NEXT_PUBLIC_SUPABASE_URL=your-supabase-project-url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key
NEXT_PUBLIC_APP_URL=http://localhost:3000

Replace the values with your Supabase project details.

5. Run the development server

npm run dev
# or
yarn dev
# or
pnpm dev

Open http://localhost:3000 with your browser to see the application.

Project Structure

  • /app - Next.js app router pages and layouts
  • /components - UI components including authentication and request handling
  • /lib - Utilities, types, and Supabase client configuration

Database Schema

The application uses a saved_requests table with the following structure:

  • id - UUID primary key
  • user_id - Reference to auth.users(id)
  • name - Request name
  • method - HTTP method (GET, POST, etc.)
  • endpoint - API endpoint URL
  • headers - JSON headers (optional)
  • body - Request body (optional)
  • tags - Array of tag strings (optional)
  • is_public - Boolean flag for public/private visibility
  • created_at - Timestamp
  • updated_at - Timestamp

Authentication Flow

  1. User clicks "Sign in with Google" button
  2. Supabase redirects to Google OAuth
  3. After successful sign-in, Google redirects back to the app
  4. The auth callback page (/auth/callback) handles the authentication code
  5. User is redirected to the home page, now authenticated

Security Features

  • Row Level Security (RLS) ensures users can only access their own private requests
  • Password-protected sharing for private requests
  • Only authenticated users can create public examples

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License.

About

A powerful tool for testing, saving, and sharing API requests. Features include Google authentication via Supabase, saving private and public requests, and generating code examples.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages