A lightweight, modern test case management system built for small QA teams. This MVP provides essential test management functionality with a clean, intuitive interface and robust API.
- Project Management: Organize test cases by projects
- Test Suites: Group related test cases together
- Test Cases: Detailed test case management with steps, expected results, priorities, and tags
- Test Runs: Execute test suites and track results
- Dashboard: Real-time insights with pass rates and recent activity
- File Attachments: Attach screenshots and documents to test results (PNG/JPG/PDF, max 10MB)
- Authentication: Secure login/logout with NextAuth
- RESTful API: Complete API with OpenAPI 3.0 specification
- Real-time Updates: Live dashboard updates
- Responsive Design: Works on desktop and mobile
- Docker Support: Production-ready containerization
- TypeScript: Full type safety throughout the application
- Frontend/Backend: Next.js 14 (App Router)
- Database: SQLite with Prisma ORM
- Authentication: NextAuth.js with credentials provider
- Styling: Tailwind CSS + Radix UI primitives
- Validation: Zod schemas for type-safe validation
- Testing: Vitest (unit) + Playwright (E2E)
- API Documentation: OpenAPI 3.0
- Node.js 18+
- npm or yarn
- SQLite (included with Node.js)
-
Clone and install dependencies
git clone <repository-url> cd test-case-manager-mvp npm install
-
Set up environment
cp .env.example .env.local # Edit .env.local with your configuration
-
Initialize database
npx prisma migrate dev --name init npx prisma generate
-
Seed database with demo data
npm run db:seed
-
Start development server
npm run dev
-
Access the application
- Open http://localhost:3000
- Login with demo credentials:
- Email:
demo@tcm.local
- Password:
Demo123!
- Email:
-
Using Docker Compose (Recommended)
# Copy environment file cp .env.example .env # Edit .env with production values # Set NEXTAUTH_SECRET to a secure random string # Start the application docker compose up -d # Initialize database (first time only) docker compose exec app npx prisma migrate deploy docker compose exec app npm run db:seed
-
Using Docker directly
# Build the image docker build -t tcm-mvp . # Run the container docker run -p 3000:3000 \ -e NEXTAUTH_SECRET="your-secret-here" \ -e DATABASE_URL="file:./data/prod.db" \ -v tcm_data:/app/data \ -v tcm_uploads:/app/uploads \ tcm-mvp
src/
βββ app/ # Next.js App Router pages
β βββ api/ # API routes
β βββ login/ # Authentication pages
β βββ projects/ # Project management pages
β βββ layout.tsx # Root layout
βββ components/ # Reusable UI components
β βββ ui/ # Basic UI components (buttons, cards, etc.)
β βββ layout/ # Layout components
βββ lib/ # Utility functions and configurations
β βββ auth.ts # NextAuth configuration
β βββ db.ts # Database client
β βββ utils.ts # Helper functions
β βββ validations.ts # Zod schemas
βββ types/ # TypeScript type definitions
prisma/
βββ schema.prisma # Database schema
βββ seed.ts # Database seeding script
βββ migrations/ # Database migrations
tests/
βββ unit/ # Unit tests (Vitest)
βββ e2e/ # End-to-end tests (Playwright)
public/
βββ openapi.yaml # API documentation
The seed script creates:
- Demo user:
demo@tcm.local
/Demo123!
- Sample project "WebShop" with authentication and checkout test suites
- 7 test cases covering common web app scenarios
- Sample test run with mixed results
- Log in and navigate to Projects page
- Click "New Project"
- Enter project name and description
- Create test suites to organize your test cases
- Add test cases with detailed steps and expected results
- Navigate to your project dashboard
- Click "New Test Run"
- Select scope (full project or specific suite)
- Execute test cases and record results
- View updated pass rates and activity feed
# Development
npm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
# Database
npm run prisma:generate # Generate Prisma client
npm run prisma:migrate # Run database migrations
npm run prisma:studio # Open Prisma Studio
npm run db:seed # Seed database with demo data
npm run db:reset # Reset database (destructive)
# Testing
npm run test:unit # Run unit tests
npm run test:e2e # Run E2E tests
npm run test:e2e:ui # Run E2E tests with UI
# Code Quality
npm run lint # Run ESLint
npm run format # Format code with Prettier
Key entities:
- User: Application users with authentication
- Project: Top-level organization unit
- TestSuite: Groups of related test cases
- TestCase: Individual test cases with steps, expected results
- TestRun: Execution instances of test suites
- TestResult: Results for each test case in a run
- AuditLog: Activity tracking for compliance and history
The complete API specification is available at /openapi.yaml
when running the application. Key endpoints:
POST /api/auth/register
- User registrationGET/POST /api/projects
- Project managementGET/POST /api/projects/{id}/suites
- Test suite managementPOST /api/runs
- Create test runsPATCH /api/runs/{runId}/results/{caseId}
- Update test resultsPOST /api/uploads
- File uploads
# Database
DATABASE_URL="file:./dev.db"
# NextAuth
NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_SECRET="your-secret-key-change-in-production"
# App Configuration
ENABLE_REGISTRATION=true # Allow new user registration
UPLOAD_MAX_SIZE_MB=10 # Maximum upload file size
UPLOAD_DIR="./uploads" # File upload directory
npm run test:unit
Covers utility functions, validation schemas, and business logic.
npm run test:e2e
Tests critical user journeys:
- User registration and login
- Project creation and management
- Test case creation and execution
- Dashboard functionality
- Authentication flows
- Project/suite/case CRUD operations
- Test execution and result recording
- File upload functionality
- Dashboard analytics
- Password Hashing: bcrypt with salt rounds
- Session Management: NextAuth.js secure sessions
- Input Validation: Zod schemas on all API endpoints
- File Upload Security: Type and size restrictions
- CSRF Protection: Built-in with NextAuth
- SQL Injection Protection: Prisma ORM parameterized queries
- Database Optimization: Proper indexing on frequently queried fields
- N+1 Query Prevention: Prisma includes for efficient data fetching
- Client-side Caching: React Query for API state management
- Bundle Optimization: Next.js automatic code splitting
- Image Optimization: Next.js Image component
- Health Check:
/api/health
endpoint for container orchestration - Audit Logging: All user actions tracked in database
- Error Handling: Comprehensive error responses and logging
- Performance Monitoring: Built-in Next.js analytics ready
- Set production environment variables in
.env
- Ensure
NEXTAUTH_SECRET
is a secure random string - Run
docker compose up -d
- Initialize database with
docker compose exec app npx prisma migrate deploy
- Build the application:
npm run build
- Set up production database
- Run migrations:
npx prisma migrate deploy
- Start the application:
npm start
- Use a secure
NEXTAUTH_SECRET
in production - Consider using PostgreSQL for higher loads
- Set up proper backup procedures for SQLite
- Configure reverse proxy for HTTPS
- Monitor disk space for uploads and database growth
The application uses Tailwind CSS with CSS custom properties for theming. Modify src/app/globals.css
to customize colors and appearance.
- New API endpoints: Add to
src/app/api/
- New pages: Add to
src/app/
- New components: Add to
src/components/
- Database changes: Modify
prisma/schema.prisma
and create migrations
- Single-tenant (no multi-tenancy)
- Basic role system (authenticated users only)
- File uploads stored locally (not cloud storage)
- SQLite database (suitable for small-medium teams)
- No real-time collaboration features
- Small team usage (2-20 people)
- English-only interface
- Basic reporting needs (pass/fail rates)
- Standard web browsers (modern Chrome/Firefox/Safari)
- Self-hosted deployment preferred
- Advanced analytics and reporting
- Integration with CI/CD systems
- Real-time collaboration features
- Advanced user roles and permissions
- Cloud storage for attachments
- Export to external systems (Jira, etc.)
"Database locked" error
- Ensure only one instance is running
- Check file permissions on database file
File upload failures
- Verify
UPLOAD_DIR
exists and is writable - Check file size and type restrictions
Authentication issues
- Verify
NEXTAUTH_SECRET
is set - Check
NEXTAUTH_URL
matches deployment URL
Database migration errors
- Backup database before migrations
- Run
npx prisma db push
for development schema sync
- Check the Issues page
- Review the OpenAPI specification at
/openapi.yaml
- Enable debug logging by setting
NODE_ENV=development
This is an MVP focused on core functionality. Contributions should align with the simple, focused nature of the project.
MIT License - see LICENSE file for details.
Test Case Manager MVP - Built with β€οΈ for QA teams who need simple, effective test management.