Skip to content

Pythagora-io/QAMangementSystem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

25 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

QA Management System (QAManageSys)

A comprehensive QA Management System that helps teams organize test suites, track test execution, and manage releases. The system includes automated Linear ticket creation for failed tests and provides detailed analytics on testing progress.

License

🌟 Features

  • Test Management: Create, organize, and manage test cases with steps, prerequisites, and test data
  • Test Suites: Group related tests into reusable test suites
  • Release Tracking: Track test execution across releases with comprehensive progress monitoring
  • Test Run Recording: Document test execution with pass/fail/defects statuses
  • User Management: Invite team members via email with secure invitation tokens
  • Linear Integration: Automatically create Linear tickets for failed tests
  • Dashboard Analytics:
    • Current release status overview
    • Stale test detection (tests not run in 7+ days)
    • Testing activity charts with label filtering
  • Priority & Label System: Organize tests with customizable labels and priority levels
  • User Assignments: Assign tests and test suites to team members

πŸ› οΈ Tech Stack

Frontend

  • React 18 with TypeScript
  • Vite for fast development
  • React Router for client-side routing
  • Tailwind CSS for styling
  • shadcn/ui component library
  • Recharts for data visualization
  • Axios for API requests
  • date-fns for date formatting

Backend

  • Node.js with Express
  • TypeScript for type safety
  • MongoDB with Mongoose ODM
  • JWT for authentication
  • bcrypt for password hashing
  • Postmark for email delivery
  • Linear API for issue tracking integration

πŸ“‹ Prerequisites

Before running this application, ensure you have:

  • Node.js (v18 or higher)
  • npm or yarn
  • MongoDB (local or Atlas cloud instance)
  • Postmark Account (for sending invitation emails)
  • Linear Account (optional, for ticket integration)

πŸš€ Installation

  1. Clone the repository

    git clone <repository-url>
    cd QAManageSys
  2. Install dependencies

    # Install root dependencies
    npm install
    
    # Install client dependencies
    cd client
    npm install
    
    # Install server dependencies
    cd ../server
    npm install
    
    # Install shared dependencies
    cd ../shared
    npm install
  3. Set up environment variables

    Create a .env file in the server/ directory:

    PORT=3000
    MONGODB_URI=mongodb://localhost:27017/qamanagesys
    JWT_SECRET=your-secret-key-here
    JWT_REFRESH_SECRET=your-refresh-secret-key-here
    POSTMARK_API_KEY=your-postmark-api-key
    POSTMARK_FROM_EMAIL=[email protected]
    CLIENT_URL=http://localhost:5173
    LINEAR_CLIENT_ID=your-linear-client-id
    LINEAR_CLIENT_SECRET=your-linear-client-secret
    LINEAR_REDIRECT_URI=http://localhost:3000/api/linear/callback

    Create a .env.local file in the client/ directory:

    VITE_LINEAR_CLIENT_ID=your-linear-client-id

πŸƒ Running the Application

Development Mode

Run both frontend and backend concurrently:

npm run start

This will start:

  • Frontend on http://localhost:5173
  • Backend on http://localhost:3000

Run frontend only:

cd client
npm run dev

Run backend only:

cd server
npm run dev

Production Build

# Build the entire project
npm run build

# Start production server
npm run start:prod

πŸ“œ Available Scripts

Root Level

  • npm run start - Run both client and server in development mode
  • npm run build - Build client and server for production
  • npm run lint - Lint the entire project
  • npm run lint:fix - Lint and fix issues across the project

Client Scripts

  • npm run dev - Start Vite dev server
  • npm run build - Build for production
  • npm run preview - Preview production build
  • npm run lint - Lint client code
  • npm run lint:fix - Lint and fix client code

Server Scripts

  • npm run dev - Start server with nodemon
  • npm run build - Compile TypeScript
  • npm run start - Run compiled server
  • npm run lint - Lint server code
  • npm run seed:admin - Create admin user
  • npm run seed:data - Seed initial test data
  • npm run seed:releases - Seed release data
  • npm run seed:stale - Seed stale tests
  • npm run clear:invitations - Clear pending invitations

πŸ—‚οΈ Project Structure

QAManageSys/
β”œβ”€β”€ client/                    # React frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ api/              # API request functions
β”‚   β”‚   β”œβ”€β”€ components/       # React components
β”‚   β”‚   β”‚   β”œβ”€β”€ modals/      # Modal components
β”‚   β”‚   β”‚   └── ui/          # shadcn/ui components
β”‚   β”‚   β”œβ”€β”€ contexts/        # React contexts
β”‚   β”‚   β”œβ”€β”€ hooks/           # Custom hooks
β”‚   β”‚   β”œβ”€β”€ pages/           # Page components
β”‚   β”‚   β”œβ”€β”€ types/           # TypeScript types
β”‚   β”‚   └── utils/           # Utility functions
β”‚   └── ...
β”œβ”€β”€ server/                   # Express backend
β”‚   β”œβ”€β”€ config/              # Configuration files
β”‚   β”œβ”€β”€ models/              # Mongoose models
β”‚   β”œβ”€β”€ routes/              # Express routes
β”‚   β”‚   └── middlewares/    # Route middlewares
β”‚   β”œβ”€β”€ scripts/            # Database scripts
β”‚   β”œβ”€β”€ services/           # Business logic
β”‚   └── utils/              # Utility functions
β”œβ”€β”€ shared/                  # Shared code between client/server
β”‚   β”œβ”€β”€ config/             # Shared configurations
β”‚   └── types/              # Shared TypeScript types
└── ...

πŸ” Authentication

The application uses JWT-based authentication with access and refresh tokens:

  • Access Token: Short-lived token (1 hour) for API requests
  • Refresh Token: Long-lived token (7 days) for obtaining new access tokens

Protected routes require the Authorization: Bearer <token> header.

πŸ“Š Database Models

  • User: User accounts with authentication
  • UserInvitation: Email invitation tokens
  • Test: Test case definitions with steps and metadata
  • TestSuite: Collections of tests
  • Release: Release tracking with status
  • TestRun: Test execution records
  • Label: Categorization tags for tests
  • LinearIntegration: Linear workspace connection data
  • PasswordReset: Password reset tokens

πŸ”Œ API Endpoints

Authentication

  • POST /api/auth/register - Register new user
  • POST /api/auth/login - Login user
  • POST /api/auth/logout - Logout user
  • POST /api/auth/refresh - Refresh access token
  • GET /api/auth/me - Get current user

Tests

  • GET /api/tests - Get all tests
  • POST /api/tests - Create test
  • GET /api/tests/:id - Get test by ID
  • PUT /api/tests/:id - Update test
  • DELETE /api/tests/:id - Delete test

Test Suites

  • GET /api/test-suites - Get all test suites
  • POST /api/test-suites - Create test suite
  • GET /api/test-suites/:id - Get test suite by ID
  • PUT /api/test-suites/:id - Update test suite
  • DELETE /api/test-suites/:id - Delete test suite

Releases

  • GET /api/releases - Get all releases
  • POST /api/releases - Create release
  • GET /api/releases/:id - Get release by ID
  • PUT /api/releases/:id - Update release
  • DELETE /api/releases/:id - Delete release
  • GET /api/releases/:id/stats - Get release statistics
  • GET /api/releases/:id/untested - Get untested tests

Test Runs

  • GET /api/test-runs - Get all test runs
  • POST /api/test-runs - Create test run
  • DELETE /api/test-runs/:id - Delete test run

Users

  • GET /api/users - Get all users
  • POST /api/users/invite - Invite new user
  • GET /api/users/invitation/:token - Verify invitation
  • POST /api/users/complete-registration - Complete registration
  • DELETE /api/users/:id - Delete user

Labels

  • GET /api/labels - Get all labels

Dashboard

  • GET /api/dashboard/stats - Get dashboard statistics

Linear Integration

  • GET /api/linear/settings - Get Linear settings
  • POST /api/linear/connect - Connect Linear account
  • POST /api/linear/disconnect - Disconnect Linear account
  • GET /api/linear/callback - OAuth callback

πŸ§ͺ Seeding Data

To populate the database with sample data for testing:

# Create admin user (email: [email protected], password: Admin123!)
npm run seed:admin

# Seed users, labels, tests, and test suites
npm run seed:data

# Seed releases and test runs
npm run seed:releases

# Seed stale tests (for testing dashboard alerts)
npm run seed:stale

# Clear pending invitations
npm run clear:invitations

πŸ”§ Configuration

Email Service (Postmark)

  1. Sign up for a Postmark account
  2. Get your API key from the dashboard
  3. Add the API key to server/.env as POSTMARK_API_KEY
  4. Configure the sender email as POSTMARK_FROM_EMAIL

Linear Integration

  1. Create a Linear OAuth application
  2. Set the redirect URI to http://localhost:3000/api/linear/callback (development)
  3. Add credentials to environment variables:
    • LINEAR_CLIENT_ID
    • LINEAR_CLIENT_SECRET
    • LINEAR_REDIRECT_URI

MongoDB

  • Local: mongodb://localhost:27017/qamanagesys
  • Atlas: Get connection string from MongoDB Atlas dashboard

πŸ› Debugging

All server logs are output to the console. Key operations are logged:

  • Database connection status
  • Authentication attempts
  • API requests and responses
  • Email sending status
  • Linear API interactions
  • Error traces with full context

🀝 Contributing

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

Code Style

  • Follow existing code conventions
  • Run npm run lint:fix before committing
  • Write meaningful commit messages
  • Add tests for new features

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • shadcn/ui for the beautiful component library
  • Tailwind CSS for the utility-first CSS framework
  • Linear for the issue tracking integration
  • Postmark for reliable email delivery

πŸ“§ Support

For issues, questions, or contributions, please open an issue on the GitHub repository.


Built with ❀️ by the QA Management Team

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages