Skip to content

Conversation

Copy link

Copilot AI commented Sep 11, 2025

Overview

This PR implements a comprehensive project management system for Tiny RequestBin, addressing the user request "可以创建一个新的项目吗?" (Can you create a new project?). The feature allows users to create and organize HTTP requests into separate project workspaces, providing better organization for debugging multiple applications or environments.

What's Changed

Backend Implementation

  • New data structures: Added Project struct with ID, name, description, and creation timestamp
  • Project-scoped storage: Enhanced request storage to associate each request with a specific project
  • API endpoints:
    • GET /api/projects - List all available projects
    • POST /api/projects/create - Create new projects with name and description
    • Enhanced GET /api/requests to filter requests by project
  • Request isolation: Each project maintains its own separate request history with configurable limits
  • Automatic initialization: Creates a default project on startup for backward compatibility

Frontend Implementation

  • Project selection: Added dropdown in header to switch between projects
  • Project creation: Modal dialog for creating new projects with form validation
  • URL management: Updated URLs to include project context (?project=project-id)
  • Request isolation: Requests are filtered and displayed per project
  • Bi-lingual support: All new UI elements support both English and Chinese

Key Features

Seamless project switching - Change projects without losing current view state
Request isolation - Each project shows only its own captured requests
Persistent URLs - Project and request context preserved in URLs for bookmarking
Backward compatibility - Existing functionality preserved with automatic default project
Real-time updates - Auto-refresh and pagination work correctly within project scope

Demo

Before

Initial State

After - Project Management Interface

Project Management Complete

After - Project Creation Modal

Project Feature Added

Usage

  1. Create a new project: Click "New Project" button, enter name and optional description
  2. Switch projects: Use the dropdown in the header to select different projects
  3. Send requests: Include ?project=project-id in the URL or let it default to the current project
  4. View requests: Each project shows only its own captured requests with independent pagination

Example:

# Send request to specific project
curl -X POST http://localhost:8282/api/test?project=my-project-123 \
  -H "Content-Type: application/json" \
  -d '{"message": "Hello from my project"}'

This enhancement significantly improves the developer experience by allowing organized debugging sessions across multiple projects, applications, or environments while maintaining the simplicity and lightweight nature of Tiny RequestBin.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@knktc knktc closed this Sep 11, 2025
@knktc knktc deleted the copilot/fix-070736e5-b7b4-4d76-a530-3e10ad2052ea branch September 11, 2025 06:48
Copilot AI restored the copilot/fix-070736e5-b7b4-4d76-a530-3e10ad2052ea branch September 11, 2025 06:51
Copilot AI changed the title [WIP] 可以创建一个新的项目吗? Add project management feature to organize HTTP requests into separate workspaces Sep 11, 2025
Copilot AI requested a review from knktc September 11, 2025 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants