Thank you for your interest in contributing to SQL Detective! This guide will help you add new cases to the game.
- Create a new file in
src/cases/using kebab-case naming (e.g.,case-XXX.ts) - Copy the structure from
case-template.ts - Fill in all the required fields:
- Unique
id(format:case-XXX) - Descriptive
title - Appropriate
difficulty(1-5) - Clear
description - Fair
xpReward - Detailed
brief - Clear
objectives - Complete
solutionwith answer and explanations
- Unique
- Add the database schema to
src/cases/schemas/case-XXX.ts - Add your case to
src/cases/index.ts:- Import your case
- Add it to the appropriate category in the
casesobject - Export it in the named exports
-
XP Rewards
- Should scale with difficulty
- Beginner (50-100 XP)
- Intermediate (100-200 XP)
- Advanced (200-300 XP)
- Expert (300+ XP)
-
Schema Design
- Keep tables focused and relevant
- Include enough sample data to make the case interesting
- Use meaningful column names
- Include appropriate constraints (PRIMARY KEY, FOREIGN KEY)
-
Solution
- Answer should be clear and unambiguous
- Explanation should help users understand the solution
- Success message should be encouraging
- Run the application locally
- Verify that your case appears in the correct category
- Test the database schema loads correctly
- Verify the solution works as expected
- Check that the difficulty and XP reward are appropriate
- Create a new branch
- Add your case file
- Update the cases index
- Submit a pull request with:
- Clear description of the new case
- Any special considerations
- Testing notes
Thank you for contributing to SQL Detective!