Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

274 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Test Case Manager πŸ§ͺ

Tests Status Lint Status Type Check Status Deploy Status

TypeScript Backend Frontend Real-Time

β˜• Support Me on Ko-fi

ChatGPT Homepage Suite - Test Cases

πŸ“Έ See the Screenshots Guide for a complete walkthrough from dashboard to ticket creation.

A full-stack test case management system built with the MERN stack (MongoDB, Express, React, Node.js). Organize your QA workflow with projects, test suites, test cases, and test runsβ€”featuring real-time collaborative editing, AI-powered test generation, comprehensive reporting, and a modern dashboard UI.

✨ Key Highlights

  • πŸ“ Projects & Test Suites – Organize test cases into projects with customizable fields and nested test suites
  • πŸ“ Test Cases – Create, edit, clone, and bulk-manage test cases with priority, status, steps, and expected results
  • ⚑ Virtualized Tables – TanStack React Virtual keeps large test case lists fast and responsive
  • πŸš€ Test Runs – Execute test cases, track results (Pass/Fail/Blocked/Skipped), and record actual outcomes
  • 🎫 Tickets & Discussions – Track bugs with full lifecycle management and thread comments on cases and tickets
  • πŸ“Š Reports & Analytics – Visual dashboards with execution statistics, pass rates, and trend analysis
  • πŸ‘₯ Real-Time Collaboration – Google Docs-style live editing with presence indicators via Socket.io
  • πŸ€– Multi-Provider AI Generation – Generate test cases automatically using Gemini, OpenAI, OpenRouter, Anthropic, or DeepSeek
  • πŸ” Secure Authentication – JWT-based auth with email/password and Google OAuth 2.0

Installation

See the "Getting Started" section below for a consolidated, full installation and running guide.

πŸ“˜ Documentation & Resources

This project covers:

  • Full-stack MERN development with TypeScript
  • Test case management best practices
  • Real-time collaboration with Socket.io
  • JWT authentication & OAuth 2.0
  • AI integration (Gemini) for test generation
  • Modern React patterns with Zustand
  • Tailwind CSS styling
  • Comprehensive API design

TypeScript Migration: See migrate-to-typescript.md for migration details.

Recommended:

🌟 Features Implemented

Test Management Features

  • πŸ“ Projects – Create and manage testing projects with custom fields and member collaboration
  • πŸ‘₯ Project Members – Add/remove members who share access to a project
  • βš™οΈ Project Settings – Hide default fields/columns and define custom fields (text, long text, dropdown, rich text) per project
  • πŸ“‚ Test Suites – Organize test cases into logical groupings within projects
  • πŸ“ Test Cases – Full CRUD with priority, status, steps, expected results, custom fields, areas, tags, and assigned testers
  • πŸ”„ Bulk Operations – Clone, move, delete, and reorder multiple test cases at once
  • πŸ“₯ Import Test Cases – Bulk import test cases from CSV/Excel, with or without creating a suite
  • πŸ“€ Export Test Cases – Export test cases with selectable columns to CSV/Excel
  • πŸš€ Test Runs – Execute test cases and record Pass/Fail/Blocked/Skipped results
  • πŸƒ Run Execution Wizard – Step-by-step guided execution with pass/fail/skip/retry; failing an item prompts instant bug-ticket creation
  • πŸ“ Run Groups – Organize test runs into nested, color-coded groups (children reparent on group deletion)
  • 🏷️ Tags & Environments – Tag test runs and track execution environments (staging, production, etc.)
  • ⏱️ Run Item Details – Track time spent, attachments, assignees, and execution timestamps per test run item
  • 🎫 Tickets – Bug/defect tracking with status, priority, severity, assignee, tags, attachments, and links to related run items
  • πŸ’¬ Discussions – Threaded comments on test cases and tickets with fix-state tracking and attachments
  • βš™οΈ System Messages – Run item executions and ticket status changes automatically post status updates to discussions
  • πŸ“Š Reports & Analytics – Visual dashboards with execution statistics, trends, suite comparisons, and test case health (flaky tests, never executed); exportable to CSV/PDF
  • πŸ“ˆ Dashboard Statistics – Aggregated project overview stats via /api/statistics
  • πŸ–ΌοΈ Rich Text Editing – Tiptap-based WYSIWYG editor with image uploads to S3-compatible storage
  • πŸ€– AI Generation – Generate test cases automatically from multiple AI providers: Gemini, OpenAI, OpenRouter, Anthropic Claude, and DeepSeek
  • πŸ“œ History Tracking – Full audit trail of test case changes with snapshots, viewable and restorable to any previous version

Real-Time Collaboration

  • πŸ“‘ WebSocket Integration – Socket.io for instant updates across all clients
  • πŸ‘₯ Live Presence – See who's viewing and editing in real-time (projects, test cases, and tickets)
  • ✏️ Collaborative Editing – Google Docs-style field-level live editing for test cases and tickets
  • πŸ”„ Automatic Sync – UI updates instantly when team members make changes
  • πŸ’¬ Real-Time Discussions – New/updated/deleted discussion messages broadcast instantly

Authentication Features

  • πŸ”‘ Email/Password Auth - User registration with password hashing and JWT
  • πŸ“§ Email Verification - Mailtrap integration with OTP-style verification (24h token validity, 5-min resend cooldown)
  • πŸ”„ Password Reset Flow - Secure forgot/reset password via email (1-hour token expiry)
  • πŸ”’ Change Password - Update password for logged-in users
  • 🌐 Google OAuth 2.0 - One-click sign in with Google
  • πŸ›‘οΈ CSRF Protection - State parameter validation for OAuth
  • πŸ”— Account Linking - Link Google to existing email/password account
  • πŸͺ HTTP-Only Cookies - Secure token storage

Frontend Features

  • πŸ§ͺ Test Manager UI - Full-featured test case management interface
  • πŸ“ Projects Page - Create and manage testing projects
  • πŸ“‚ Test Suites Page - Organize test cases into suites
  • πŸ“ Test Cases Page - Table view with inline editing and bulk operations
  • ⚑ Virtualized Table - TanStack React Virtual keeps large lists responsive
  • πŸš€ Test Runs Page - Execute tests and record results
  • 🎫 Tickets Page - Track and manage bugs/defects linked to runs
  • πŸ“Š Reports Page - Analytics dashboards and execution statistics
  • 🏠 Dashboard - Overview with quick actions and recent activity
  • πŸ“ˆ Analytics Page - Interactive charts with Recharts
  • βš™οΈ Settings Page - Profile, security, AI provider preferences, and API key management
  • 🧠 AI Generation Modal - Stream test cases from Gemini, OpenAI, OpenRouter, Anthropic, or DeepSeek with per-provider model selection
  • πŸŽ›οΈ Filtering - Filter modal for narrowing down test cases and tickets
  • πŸ“„ Report Export - Download analytics as CSV or print-to-PDF
  • πŸ“„ Pagination - Paginated case/run/ticket lists and infinite scroll on projects
  • 🧷 Deep Links - Shareable URLs for specific test cases, runs, run groups, and tickets
  • πŸ–ΌοΈ Rich Text Editor - Tiptap editor with S3-backed image uploads (test descriptions, steps, discussions)
  • πŸ—‘οΈ Type-to-Confirm Deletion - Typing confirms destructive actions
  • 🎨 Modern UI - Tailwind CSS with Framer Motion animations
  • πŸŒ™ Dark Mode - Light/dark theme toggle
  • πŸ“± Responsive Design - Works on desktop and mobile
  • 🎯 State Management - Zustand for global state
  • πŸ”” Toast Notifications - User feedback with react-hot-toast
  • πŸ“¦ Code Splitting - Lazy-loaded routes and error boundaries

Developer Experience

  • πŸ“š Comprehensive Documentation - Detailed guides for adding new features
  • πŸ§ͺ Backend Testing - Jest + Supertest with unit, integration, and service tests (mongodb-memory-server)
  • πŸ§ͺ Frontend Testing - Vitest + Testing Library for components and flows
  • πŸ” Type Safety - Full TypeScript coverage on frontend and backend
  • πŸ“– Feature Guide - Step-by-step instructions in Documentation/ADDING_FEATURES.md
  • πŸ“‘ Real-Time Architecture - Socket.io patterns documented in Documentation/REALTIME_ARCHITECTURE.md

πŸš€ Getting Started

Prerequisites

  • Node.js (v14 or higher)
  • MongoDB (local or Atlas)
  • Google Cloud Console account (for OAuth)
  • Mailtrap account (for email testing)

Setup Environment Variables

Create a .env file in the root directory.

Example (development):

# Server Configuration
PORT=5000
NODE_ENV=development

# MongoDB Connection
MONGO_URI=your_mongo_uri

# JWT
JWT_SECRET=your_secret_key

# Mailtrap (Email Service)
MAILTRAP_TOKEN=your_mailtrap_token
MAILTRAP_ENDPOINT=https://send.api.mailtrap.io/
# Optional: override the "from" address and display name used for sent emails
# If not set, the app falls back to mailtrap@demomailtrap.com /"MERN Auth"
MAILTRAP_SENDER_EMAIL=mailtrap@demomailtrap.com
MAILTRAP_SENDER_NAME=MERN Auth

# Google OAuth 2.0 (development)
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
GOOGLE_REDIRECT_URI=http://localhost:5000/api/auth/google/callback

# Comma-separated list of allowed redirect URIs (required)
# Used by the backend to validate the configured callback
GOOGLE_ALLOWED_REDIRECT_URIS=http://localhost:5000/api/auth/google/callback

# Google Drive (video evidence)
# Reuses GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRET. Add the Drive callback to the
# OAuth client's Authorized redirect URIs in Google Cloud Console.
GOOGLE_DRIVE_REDIRECT_URI=http://localhost:5000/api/drive/auth/callback
# Encryption key for Drive refresh tokens (must be 32 characters; falls back to ENCRYPTION_KEY)
GOOGLE_TOKEN_ENCRYPTION_KEY=your_32_char_drive_token_encryption_key
# Name of the root folder created in each user's Drive (default: Test Case Manager)
GOOGLE_DRIVE_ROOT_FOLDER_NAME=Test Case Manager
# Maximum video size for evidence uploads in MB (default: 1024)
VIDEO_EVIDENCE_MAX_SIZE_MB=1024

# CORS Configuration
# Comma-separated list of allowed origins (required)
# Include all frontend URLs that should be allowed to make requests to the backend
ALLOWED_ORIGINS=http://localhost:5173

# Frontend URL (deprecated - use ALLOWED_ORIGINS instead)
# Kept for backward compatibility
CLIENT_URL=http://localhost:5173

# Encryption key for AI provider API key storage (must be 32 characters)
ENCRYPTION_KEY=your_32_char_encryption_key_here

# Optional: OpenRouter request identification headers (sent to OpenRouter)
#OPENROUTER_HTTP_REFERER=https://your-app.com
#OPENROUTER_TITLE=Test Case Manager

# Optional: Mailtrap template UUID for welcome emails (falls back to local HTML)
#MAILTRAP_WELCOME_TEMPLATE_UUID=your_mailtrap_template_uuid

# S3-Compatible Storage (Cloudflare R2, AWS S3, MinIO, etc.)
# Required for image uploads in the rich text editor
S3_ACCESS_KEY_ID=your_s3_access_key_id
S3_SECRET_ACCESS_KEY=your_s3_secret_access_key
# For Cloudflare R2: https://ACCOUNT_ID.r2.cloudflarestorage.com
S3_ENDPOINT=https://your-account-id.r2.cloudflarestorage.com
S3_BUCKET_NAME=your-bucket-name
# For Cloudflare R2 use 'auto', for AWS S3 use your region (e.g., 'us-east-1')
S3_REGION=auto
# Optional: Public URL for uploaded files (falls back to S3_ENDPOINT/S3_BUCKET_NAME/key)
S3_PUBLIC_URL=https://your-custom-domain.com

# Optional: Custom DNS servers for development (defaults to 1.1.1.1,8.8.8.8)
#DNS_OVERRIDE_SERVERS=1.1.1.1,8.8.8.8

# Optional: cookie domain for auth cookies (e.g., .example.com)
#COOKIE_DOMAIN=

Production / Render example (use your actual domain):

# Server Configuration
PORT=5000
NODE_ENV=production

# Google OAuth 2.0 (production)
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
GOOGLE_REDIRECT_URI=https://your-app.onrender.com/api/auth/google/callback

# Allowed redirect URIs (required)
GOOGLE_ALLOWED_REDIRECT_URIS=https://your-app.onrender.com/api/auth/google/callback

# CORS Configuration (required)
# Add all your frontend URLs, including preview deployments if needed
# Example: ALLOWED_ORIGINS=https://your-app.onrender.com,https://preview-123.onrender.com
ALLOWED_ORIGINS=https://your-app.onrender.com

# Frontend URL (deprecated - use ALLOWED_ORIGINS instead)
# Kept for backward compatibility
CLIENT_URL=https://your-app.onrender.com

Important Notes:

CORS Configuration:

  • ALLOWED_ORIGINS is now required and must be a comma-separated list of all frontend URLs allowed to make requests to the backend
  • Examples:
    • Development: ALLOWED_ORIGINS=http://localhost:5173
    • Production: ALLOWED_ORIGINS=https://your-app.onrender.com
    • Multiple origins: ALLOWED_ORIGINS=https://your-app.vercel.app,https://preview-123.vercel.app,https://preview-456.vercel.app
  • CLIENT_URL is deprecated but kept for backward compatibility. Use ALLOWED_ORIGINS instead.

Google OAuth:

  • GOOGLE_REDIRECT_URI must exactly match one of the Authorized redirect URIs configured in your Google Cloud Console for the OAuth client.
  • GOOGLE_ALLOWED_REDIRECT_URIS is required and must be a comma-separated list of valid redirect URIs the backend will accept.
  • On Render, set both GOOGLE_REDIRECT_URI and GOOGLE_ALLOWED_REDIRECT_URIS in the service's environment settings (do not commit secrets to source control).

Notes on Google redirect URIs

  • GOOGLE_REDIRECT_URI should contain the exact callback URL that Google will redirect to after auth, for example http://localhost:5000/api/auth/google/callback in development or https://your-app.onrender.com/api/auth/google/callback in production.
  • GOOGLE_ALLOWED_REDIRECT_URIS is required and must be a comma-separated list of valid redirect URIs. In production you should include your deployed callback URL here. The same deployed callback URL must also be added in your Google Cloud Console (APIs & Services β†’ Credentials β†’ OAuth 2.0 Client β†’ Authorized redirect URIs).

Google OAuth Setup (Step-by-Step)

  1. Go to Google Cloud Console

  2. Create a New Project

    • Click on the project dropdown at the top
    • Click "New Project"
    • Enter project name (e.g., "MERN Auth App")
    • Click "Create"
  3. Enable Google+ API

    • In the search bar, type "Google+ API"
    • Click on "Google+ API"
    • Click "Enable"
  4. Configure OAuth Consent Screen

    • Go to "APIs & Services" > "OAuth consent screen"
    • Select "External" user type
    • Click "Create"
    • Fill in the required fields:
      • App name: Your app name
      • User support email: Your email
      • Developer contact: Your email
    • Click "Save and Continue"
    • Skip the Scopes section (click "Save and Continue")
    • Add test users if needed
    • Click "Save and Continue"
  5. Create OAuth 2.0 Credentials

    • Go to "APIs & Services" > "Credentials"
    • Click "Create Credentials" > "OAuth client ID"
    • Select "Web application"
    • Name: "MERN Auth Web Client"
    • Authorized JavaScript origins:
      • http://localhost:5173 (frontend URL)
      • http://localhost:5000 (backend URL)
    • Authorized redirect URIs:
      • http://localhost:5000/api/auth/google/callback
    • Click "Create"
  6. Copy Credentials

    • Copy the Client ID and Client Secret
    • Paste them into your .env file:
      GOOGLE_CLIENT_ID=your_client_id_here
      GOOGLE_CLIENT_SECRET=your_client_secret_here
      
  7. Update for Production

    • When deploying, add your production URLs to:
      • Authorized JavaScript origins
      • Authorized redirect URIs
    • Update .env with production URLs

Installation

  1. Clone the repository

    git clone <your-repo-url>
    cd mern-advanced-auth
  2. Install dependencies

    npm run build

    This will install both backend and frontend dependencies.

Running the Application

Development Mode:

npm run dev

This starts the backend server with nodemon for hot-reloading.

Production Mode:

npm run start

Frontend (separate terminal):

cd frontend
npm run dev

Lint:

# Backend
npm run lint:backend

# Frontend
cd frontend && npm run lint

Type-check:

# Backend
npm run type-check

# Frontend
cd frontend && npm run type-check

The application will be available at:

  • Frontend: http://localhost:5173
  • Backend: http://localhost:5000

πŸ“ Project Structure

mern-advanced-auth/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ config/
β”‚   β”‚   └── googleAuth.ts            # Google OAuth configuration
β”‚   β”œβ”€β”€ controllers/
β”‚   β”‚   β”œβ”€β”€ auth.controller.ts       # Auth endpoints
β”‚   β”‚   └── googleAuth.controller.ts # Google OAuth endpoints
β”‚   β”œβ”€β”€ db/
β”‚   β”‚   └── connectDB.ts             # MongoDB connection
β”‚   β”œβ”€β”€ mailtrap/
β”‚   β”‚   β”œβ”€β”€ emails.ts                # Email sending functions
β”‚   β”‚   β”œβ”€β”€ emailTemplates.ts        # HTML email templates
β”‚   β”‚   └── mailtrap.config.ts       # Mailtrap configuration
β”‚   β”œβ”€β”€ middleware/
β”‚   β”‚   └── verifyToken.ts           # JWT verification middleware
β”‚   β”œβ”€β”€ models/
β”‚   β”‚   └── user.model.ts            # User schema
β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   └── auth.route.ts            # Auth routes
β”‚   β”œβ”€β”€ types/
β”‚   β”‚   β”œβ”€β”€ api.types.ts
β”‚   β”‚   β”œβ”€β”€ auth.types.ts
β”‚   β”‚   β”œβ”€β”€ express.d.ts
β”‚   β”‚   β”œβ”€β”€ index.ts
β”‚   β”‚   └── user.types.ts
β”‚   └── utils/
β”‚       └── generateTokenAndSetCookie.ts
β”‚   └── index.ts                     # Backend entry point
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”‚   β”œβ”€β”€ AppLayout.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ FloatingShape.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ GoogleLoginButton.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Header.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Input.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ LoadingSpinner.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ PasswordStrengthMeter.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Sidebar.tsx
β”‚   β”‚   β”‚   └── SidebarMenuLayout.tsx
β”‚   β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”‚   β”œβ”€β”€ ChangePasswordPage.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ DashboardPage.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ EmailVerificationPage.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ ForgotPasswordPage.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ LoginPage.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ OAuthRedirect.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ ResetPasswordPage.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ SettingsPage.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ SignUpPage.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ analytics/
β”‚   β”‚   β”‚   β”‚   └── index.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ calendar/
β”‚   β”‚   β”‚   β”‚   └── index.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ messages/
β”‚   β”‚   β”‚   β”‚   └── index.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ posts/
β”‚   β”‚   β”‚   β”‚   └── index.tsx
β”‚   β”‚   β”‚   └── users/
β”‚   β”‚   β”‚       └── index.tsx
β”‚   β”‚   β”œβ”€β”€ store/
β”‚   β”‚   β”‚   └── authStore.ts         # Zustand state management
β”‚   β”‚   β”œβ”€β”€ types/
β”‚   β”‚   β”‚   β”œβ”€β”€ api.types.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ auth.types.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ component.types.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ index.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ store.types.ts
β”‚   β”‚   β”‚   └── user.types.ts
β”‚   β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   β”‚   └── date.ts
β”‚   β”‚   β”œβ”€β”€ App.tsx
β”‚   β”‚   β”œβ”€β”€ main.tsx
β”‚   β”‚   β”œβ”€β”€ index.css
β”‚   β”‚   └── vite-env.d.ts
β”‚   β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ package.json
β”‚   β”œβ”€β”€ postcss.config.js
β”‚   β”œβ”€β”€ tailwind.config.js
β”‚   β”œβ”€β”€ tsconfig.json
β”‚   β”œβ”€β”€ tsconfig.node.json
β”‚   └── vite.config.js
β”œβ”€β”€ migrate-to-typescript.md
β”œβ”€β”€ package.json
β”œβ”€β”€ README.md
└── ...

πŸ”‘ Key API Endpoints

All API endpoints are prefixed with /api. Authentication endpoints are under /api/auth.

πŸ“– For detailed API structure and how to add new features, see API URL Structure Guide

Authentication

  • POST /api/auth/signup - Register new user
  • POST /api/auth/login - Login user
  • POST /api/auth/logout - Logout user
  • GET /api/auth/check-auth - Verify authentication
  • POST /api/auth/verify-email - Verify email with code
  • POST /api/auth/forgot-password - Request password reset
  • POST /api/auth/reset-password/:token - Reset password
  • POST /api/auth/change-password - Change password (protected)

Google OAuth

  • GET /api/auth/google/url - Get Google OAuth URL
  • GET /api/auth/google/callback - Handle Google OAuth callback

Test Case Management

Projects (/api/projects)

  • POST / - Create project Β· GET / - List projects Β· GET /:id - Get project
  • PUT /:id - Update project Β· DELETE /:id - Delete project
  • POST /:id/members - Add member Β· DELETE /:id/members/:memberId - Remove member
  • GET /:id/settings / PUT /:id/settings - Get/update project settings (custom fields, hidden fields/columns)
  • DELETE /:id/settings/custom-fields/:fieldId - Permanently delete custom field data

Test Suites (/api/projects/:projectId/suites, /api/suites)

  • POST / / GET / - Create/list suites within a project
  • GET /:id / PUT /:id / DELETE /:id - Suite CRUD

Test Cases (/api/projects/:projectId/cases, /api/suites/:suiteId/cases, /api/cases)

  • POST / / GET / - Create/list test cases in a suite
  • GET /areas - List distinct areas Β· POST /bulk-import - Bulk import (CSV/Excel, optionally creating a suite)
  • PATCH /reorder - Reorder test cases
  • GET /:id / PUT /:id / DELETE /:id - Test case CRUD Β· POST /:id/clone - Clone a test case
  • PATCH /bulk-status - Bulk status update Β· DELETE /bulk - Bulk delete

Test Runs (/api/projects/:projectId/runs, /api/runs)

  • POST / / GET / - Create/list runs Β· GET /tags - List distinct tags
  • GET /:id / PUT /:id / DELETE /:id - Run CRUD
  • PATCH /:id/items/:itemId - Update run item (status, actual result, time spent, attachments)
  • PATCH /:id/reorder - Reorder run items Β· POST /:id/clone - Clone a run Β· POST /:id/complete - Complete a run

Run Groups (/api/projects/:projectId/run-groups, /api/run-groups)

  • POST / / GET / - Create/list run groups Β· GET /:id / PUT /:id / DELETE /:id - Group CRUD

Tickets (/api/projects/:projectId/tickets, /api/tickets)

  • POST / / GET / - Create/list tickets Β· GET /by-run/:runId - Tickets linked to a run
  • GET /:id / PUT /:id / DELETE /:id - Ticket CRUD

Discussions (/api/cases/:testCaseId/discussions, /api/tickets/:ticketId/discussions)

  • GET / / POST / - List/create messages
  • DELETE /:messageId - Delete a message Β· PATCH /:messageId/fix-state - Update fix-state

AI Test Generation

Per-provider endpoints (all protected; keys are encrypted at rest and per-user):

  • POST /api/gemini/key Β· GET /api/gemini/settings Β· GET /api/gemini/models
  • POST /api/gemini/generate Β· POST /api/gemini/generate-stream
  • Same pattern for /api/openrouter, /api/openai, /api/anthropic, /api/deepseek

Reports, Statistics & Uploads

  • GET /api/statistics - Dashboard overview statistics
  • GET /api/reports/project/:projectId/summary - Project summary report
  • GET /api/reports/project/:projectId/trends - Time-series trend data (day/week/month)
  • GET /api/reports/project/:projectId/suite-comparison - Suite pass-rate comparison
  • GET /api/reports/project/:projectId/test-case-health - Flaky/never-executed/most-failing cases
  • GET /api/reports/run/:runId/detailed - Detailed run report
  • POST /api/upload/presigned-url - Generate presigned URL for image upload (S3-compatible storage)

πŸ› οΈ Technologies Used

Backend

  • Express.js - Web framework
  • MongoDB - Database
  • Mongoose - ODM
  • JWT - Authentication tokens
  • bcryptjs - Password hashing
  • Mailtrap - Email service
  • google-auth-library - Google OAuth
  • cookie-parser - Cookie handling
  • cors - Cross-origin resource sharing
  • Socket.io - Real-time collaboration
  • @aws-sdk/client-s3 - S3-compatible image uploads (Cloudflare R2, AWS S3, MinIO)
  • AI SDKs - Gemini, OpenAI, OpenRouter, Anthropic, DeepSeek (streaming + encrypted key storage)

Frontend

  • React - UI library
  • Vite - Build tool
  • Tailwind CSS - Styling
  • Framer Motion - Animations
  • React Router - Routing
  • Zustand - State management
  • TanStack React Virtual - Virtualized lists/tables
  • React Hot Toast - Notifications
  • Lucide React - Icons
  • Socket.io Client - Real-time updates
  • Recharts - Analytics charts
  • Tiptap - Rich text editor
  • PapaParse / SheetJS (xlsx) - CSV/Excel import & export
  • @dnd-kit - Drag-and-drop reordering

πŸ” Security Features

  • βœ… Password hashing with bcrypt
  • βœ… JWT tokens stored in HTTP-only cookies
  • βœ… CSRF protection for OAuth
  • βœ… Email verification required
  • βœ… Secure password reset flow
  • βœ… Token expiration handling
  • βœ… Protected API routes
  • βœ… Input validation
  • βœ… Google OAuth 2.0 with state parameter
  • βœ… API rate limiting on test run, ticket, and upload routes

πŸ“ Additional Notes

  • OAuth Account Linking: If a user signs up with email/password and later uses Google OAuth with the same email, the accounts are automatically linked.
  • Email Verification: Google OAuth users are automatically verified since Google verifies email addresses.
  • Password Strength: The app includes a real-time password strength meter for better security.
  • Responsive Design: The entire application is mobile-friendly and works on all screen sizes.

πŸš€ Deployment

Deployment Options

This application supports flexible deployment strategies:

🎯 Separate Vercel Deployment (Recommended)

Deploy frontend and backend as separate Vercel projects for maximum flexibility and performance:

Deploy Backend:

Deploy Backend to Vercel

Deploy Frontend:

Deploy Frontend to Vercel

πŸ“– Complete Guide: Separate Vercel Deployment β†’

πŸ”§ Troubleshooting Connection Issues? See the Vercel Connection Fix Guide for common issues and solutions.

🐳 CapRover Deployment

Deploy to your own CapRover instance with automated CI/CD via GitHub Actions.

Required GitHub Secrets:

Secret Description
CAPROVER_SERVER Your CapRover server URL (e.g., https://captain.your-domain.com)
APP_NAME Your CapRover app name
APP_TOKEN Deploy token from CapRover dashboard

CI/CD Pipeline:

On push to main, the workflow:

  1. Runs all tests (lint, type-check, unit/integration tests)
  2. Builds the Docker image
  3. Pushes to GitHub Container Registry (GHCR)
  4. Deploys to CapRover

Files:

  • captain-definition - CapRover deployment config
  • .github/workflows/deploy.yml - GitHub Actions workflow

πŸ”„ Traditional Hosting

Deploy to platforms like Heroku, Render, Railway, DigitalOcean, AWS, etc. as a single application:

npm run build
npm start

πŸ“– Complete Guide: Traditional Deployment β†’

Deployment Compatibility

This application works on ALL platforms with the same code! ✨

  • βœ… Local Development - npm run dev (works exactly as before)
  • βœ… Traditional Hosting - Heroku, Render, Railway, DigitalOcean, AWS, etc.
  • βœ… Vercel Separate - Deploy frontend and backend independently
  • βœ… Vercel Monolithic - Deploy as a single application (use vercel.json.monolithic)

The app automatically detects the environment and adapts. No code changes needed!

πŸ“– Additional Documentation:

These files live in Documentation/Deployment/.

πŸ“š Learning Resources

This project covers:

  • Full-stack MERN development
  • JWT authentication
  • OAuth 2.0 implementation
  • Email verification systems
  • Password reset flows
  • Modern React patterns
  • State management with Zustand
  • Tailwind CSS styling
  • API design and security

🀝 Contributing

Feel free to fork this project and submit pull requests for any improvements.

πŸ“„ License

This project is licensed under the MIT License.

Copyright (c) 2026 Brian Carlo (brian0309)


Happy Coding! πŸš€

About

Full-stack test case management system (MERN + TypeScript). Projects, test suites, test cases, test runs, tickets, real-time collaboration via Socket.io, AI-powered test generation, and analytics dashboards.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages