Skip to content

Repository files navigation

PostBoy - API Testing & Collaboration Platform

PostBoy is a modern, full-stack web application for API testing, request management, and team collaboration. Built with Next.js, TypeScript, and PostgreSQL, it provides a seamless experience for developers to test, organize, and share API requests across teams.

πŸš€ Features

  • API Request Testing: Create, manage, and execute HTTP requests with full customization
  • Workspace Management: Organize projects into workspaces with team collaboration features
  • Collections: Group related API requests into organized collections
  • Request History & Saving: Save requests for reuse and track request execution history
  • Real-time Collaboration: Live updates and synchronization across team members
  • Authentication: Secure multi-provider authentication (GitHub, Google)
  • AI Integration: Built-in AI agents for request generation and API documentation assistance
  • Monaco Editor: Professional code editor for request bodies and responses
  • Responsive Design: Works seamlessly on desktop and mobile devices
  • Team Invitations: Invite team members to workspaces with email invitations
  • Dark Theme: UI with dark theme

πŸ“Έ Screenshots

πŸ”Ή Dashboard

Dashboard

πŸ”Ή WebSocket Connection Successful

WebSocket Connection

πŸ”Ή WebSocket Message Received

Message Received

πŸ”Ή Node WebSocket Server Output

Node Server

πŸ”Ή AI Request Name Suggestions

AI Name Suggestions

πŸ”Ή AI JSON Body Generator

AI Body Generator

πŸ”Ή Generated AI JSON Response

AI Body Result

πŸ”Ή Invite Link Generation

Invite Link

πŸ”Ή Joke API Example

Joke API

πŸ”Ή Joke API Output

Joke API

πŸ› οΈ Tech Stack

Frontend

  • Framework: Next.js 16.0.3
  • Language: TypeScript 5
  • UI Library: React 19.2.0 with Radix UI components
  • Styling: Tailwind CSS 4
  • State Management: Zustand
  • Form Handling: React Hook Form with Zod validation
  • Data Fetching: TanStack React Query
  • Editor: Monaco Editor for code editing
  • Charts: Recharts for data visualization
  • Icons: Lucide React
  • Toast Notifications: Sonner
  • Theme Management: next-themes

Backend

  • Runtime: Node.js with Next.js API Routes
  • Database: PostgreSQL
  • ORM: Prisma
  • Authentication: Better Auth v1.3.34
  • AI Integration: Google Generative AI (Gemini)
  • HTTP Client: Axios

Development Tools

  • Linting: ESLint 9
  • Package Manager: npm
  • Containerization: Docker & Docker Compose
  • Version Control: Git

πŸ“¦ Project Structure

postboy-project/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/                      # Next.js app directory
β”‚   β”‚   β”œβ”€β”€ (auth)/               # Authentication pages
β”‚   β”‚   β”œβ”€β”€ (workspace)/          # Workspace dashboard & editors
β”‚   β”‚   β”œβ”€β”€ api/                  # API routes (Next.js Server Actions)
β”‚   β”‚   β”‚   β”œβ”€β”€ ai/               # AI endpoints (request naming, JSON generation)
β”‚   β”‚   β”‚   └── auth/             # Authentication endpoints
β”‚   β”‚   └── invite/               # Invitation handling (/invite/[token])
β”‚   β”‚
β”‚   β”œβ”€β”€ components/               # Global components
β”‚   β”‚   └── ui/                   # Shadcn UI component library
β”‚   β”‚
β”‚   β”œβ”€β”€ modules/                  # Feature-based architecture
β”‚   β”‚   β”œβ”€β”€ ai/                   # AI integration (services, types, hooks)
β”‚   β”‚   β”œβ”€β”€ authentication/       # Auth logic & server helpers
β”‚   β”‚   β”œβ”€β”€ collections/          # Collection CRUD + UI
β”‚   β”‚   β”œβ”€β”€ invites/              # Workspace invite logic
β”‚   β”‚   β”œβ”€β”€ layout/               # Header, sidebar, themes
β”‚   β”‚   β”œβ”€β”€ realtime/             # WebSocket client & logs system
β”‚   β”‚   β”œβ”€β”€ request/              # Request editor, tabs, response viewer
β”‚   β”‚   └── workspace/            # Workspaces, members, switching logic
β”‚   β”‚
β”‚   β”œβ”€β”€ hooks/                    # Shared custom React hooks
β”‚   β”œβ”€β”€ lib/                      # Core utilities
β”‚   β”‚   β”œβ”€β”€ ai-agents.ts          # Gemini AI agents (ai-sdk)
β”‚   β”‚   β”œβ”€β”€ auth.ts               # Better Auth setup
β”‚   β”‚   β”œβ”€β”€ db.ts                 # Prisma client
β”‚   β”‚   β”œβ”€β”€ env.ts                # Environment validation
β”‚   β”‚   └── utils.ts              # Utility helpers
β”‚   β”‚
β”‚   └── components/               # Reusable global components
β”‚
β”œβ”€β”€ prisma/
β”‚   β”œβ”€β”€ schema.prisma             # Prisma schema
β”‚   └── migrations/               # Migration history
β”‚
β”œβ”€β”€ public/                       # Static assets
β”œβ”€β”€ .env                          # Environment variables
β”œβ”€β”€ docker-compose.yml            # Docker services (PostgreSQL)
β”œβ”€β”€ next.config.mjs               # Next.js configuration
β”œβ”€β”€ tsconfig.json                 # TypeScript configuration
β”œβ”€β”€ tailwind.config.ts            # Tailwind config
β”œβ”€β”€ components.json               # Shadcn UI config
β”œβ”€β”€ package.json                  # Dependencies & scripts
└── README.md                     # This file

πŸ—„οΈ Database Schema

Core Models

  • User: User accounts with authentication profiles
  • Session: Active user sessions
  • Account: OAuth account credentials (GitHub, Google)
  • Verification: Email verification tokens

Workspace & Collaboration

  • Workspace: Team workspaces for organizing projects
  • WorkspaceMember: User membership in workspaces with roles
  • WorkspaceInvite: Pending invitations to join workspaces
  • Collection: Grouped API requests within workspaces
  • Request: Individual API test requests
  • RequestRun: Execution history of requests

πŸš€ Getting Started

Prerequisites

  • Node.js 18+ (recommended: 20+)
  • PostgreSQL 12+
  • Docker & Docker Compose (optional)
  • npm or yarn

Installation

  1. Clone the repository
    git clone <repository-url>
    cd postboy-project
  2. Install dependencies
    npm install
  3. Set up environment variables
    Create a .env file in the root directory with the following variables:
    # Database
    DATABASE_URL="postgresql://postgres:postgres@localhost:5431/postgres"
    
     # Authentication
     BETTER_AUTH_SECRET=your_secret_key_here
     BETTER_AUTH_URL=http://localhost:3000
    
     # OAuth Providers
     GITHUB_CLIENT_ID=your_github_client_id
     GITHUB_CLIENT_SECRET=your_github_client_secret
     GOOGLE_CLIENT_ID=your_google_client_id
     GOOGLE_CLIENT_SECRET=your_google_client_secret
    
     # Application
     NEXT_PUBLIC_APP_URL=http://localhost:3000
    
     # AI Integration
     GOOGLE_GENERATIVE_AI_API_KEY=your_google_ai_api_key
  4. Start PostgreSQL with Docker Compose
    docker-compose up -d
  5. Run Prisma migrations
    npx prisma migrate dev
    
  6. Start the development server
    npm run dev
    
  7. Open in browser
    Navigate to http://localhost:3000
    

πŸ“ Available Scripts

# Development
npm run dev          # Start dev server with Docker services

# Production
npm run build        # Build the project for production
npm start            # Start production server

# Code Quality
npm run lint         # Run ESLint

πŸ” Authentication

PostBoy supports multiple authentication methods:

  • GitHub OAuth: Sign in with GitHub account
  • Google OAuth: Sign in with Google account
  • Email/Password: Traditional email-based authentication (if configured)
  • Authentication is managed by Better Auth, a secure authentication library for Next.js applications.

πŸ€– AI Integration

The application includes AI-powered features using Google's Generative AI (Gemini):

  • AI Agent Assistants: AI-powered helpers for request generation and API exploration
  • Smart Documentation: Automatic API documentation suggestions
  • Request Generation: AI-assisted request creation based on descriptions
  • Configure your API key in the .env file:
GOOGLE_GENERATIVE_AI_API_KEY=your_api_key

🌍 Real-time Features

Real-time collaboration features enable:

  • Live workspace updates
  • Synchronized request modifications
  • Real-time member presence
  • Instant notification system

🎨 UI Components

The project uses a comprehensive component library built on Radix UI and Tailwind CSS:

  • Forms & Inputs
  • Dialogs & Modals
  • Navigation components
  • Data display components
  • Feedback components
  • Layout components

All components are located in src/components/ui/ and are fully customizable.

πŸ”’ Security

  • Authentication: Secure OAuth integration with Better Auth
  • Environment Variables: Sensitive data stored in .env
  • HTTPS Ready: Production-ready configuration
  • Input Validation: Zod-based schema validation
  • CORS: Configured for safe cross-origin requests

πŸ“± Responsive Design

The application is fully responsive and works on:

  • Desktop browsers
  • Tablets
  • Mobile devices

🐳 Docker Support

For containerized deployment:

# Start all services
docker-compose up

# Services included:
# - PostgreSQL database
# - Redis (if configured)

πŸ“š Key Libraries & Their Uses

## Key Libraries & Their Uses

| Library                   | Purpose                           |
|---------------------------|-----------------------------------|
| next                      | React framework & routing         |
| react-hook-form           | Form state management             |
| zod                       | Schema validation                 |
| @tanstack/react-query     | Server state management           |
| zustand                   | Client state management           |
| @radix-ui                 | Accessible UI components          |
| tailwindcss               | Utility-first CSS                 |
| prisma                    | Database ORM                      |
| better-auth               | Authentication framework          |
| @ai-sdk/google            | Google AI integration (Gemini)    |
| @monaco-editor/react      | Code editor                       |
| axios                     | HTTP client                       |
| recharts                  | Data visualization                |
| sonner                    | Toast notifications               |

🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Create a feature branch
    git checkout -b feature/amazing-feature
    
  2. Commit your changes
    git commit -m 'Add amazing feature'
    
  3. Push to the branch
    git push origin feature/amazing-feature
    
  4. Open a Pull Request

πŸ“„ License

This project is private and proprietary.

πŸ†˜ Support

For issues, questions, or suggestions, please open an issue in the repository or contact the development team.

πŸ”’ Security

  • Prisma - Database ORM
  • Next.js - React framework
  • Radix UI - Component library
  • Tailwind CSS - Styling
  • Better Auth - Authentication

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages