Thank you for your interest in contributing to Linux Chooser! This document provides guidelines and information to help you get started.
- Getting Started
- Development Workflow
- Code Style Guidelines
- Commit Message Conventions
- Branch Naming Conventions
- Pull Request Process
- Reporting Issues
- Project Structure
Before you begin, ensure you have the following installed:
- Node.js (version 20 or higher)
- npm (comes with Node.js)
- Git
-
Fork the repository on GitHub
-
Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/LinuxChooser.git cd LinuxChooser -
Add the upstream remote:
git remote add upstream https://github.com/TheMorpheus407/LinuxChooser.git
-
Install dependencies:
npm install
-
Start the development server:
npm run dev
The application will be available at http://localhost:5173/ (or the next available port).
| Command | Description |
|---|---|
npm run dev |
Start development server with hot reload |
npm run build |
Build for production (TypeScript check + Vite build) |
npm run preview |
Preview production build locally |
npm run lint |
Run ESLint to check for code issues |
- Development: Use
npm run devduring development. The server supports Hot Module Replacement (HMR) for instant feedback. - Production Build: Run
npm run buildto create an optimized production build in thedist/directory. - Linting: Always run
npm run lintbefore committing to ensure code quality.
This project uses ESLint with TypeScript and React plugins for code quality enforcement.
- Use TypeScript for all new files (
.ts/.tsx) - Use functional components with hooks (no class components)
- Use default exports for components (
export default function ComponentName) - Prefer arrow functions for event handlers and callbacks
- Use destructuring for props and state
- Keep components focused and modular
Example component structure:
import { useState } from 'react';
import { motion } from 'framer-motion';
export default function ExampleComponent() {
const [value, setValue] = useState('');
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
setValue(e.target.value);
};
return (
<motion.div
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
>
<input value={value} onChange={handleChange} />
</motion.div>
);
}- Use CSS custom properties (CSS variables) for theming
- Follow the existing color palette:
- Primary purple:
#6c35de - Accent orange:
#ff6b35 - Dark background:
#0d0d11 - Light text:
#f0f2f5
- Primary purple:
- Use Oswald font for headings and buttons
- Use Roboto font for body text
- Use semantic class names that describe the component/element purpose
- Place React components in
src/components/ - Place React context providers in
src/context/ - Place custom hooks in
src/hooks/ - Place utility functions in
src/utils/ - Place data files (distros, questions, etc.) in
src/data/
We follow a structured commit message format to maintain a clear and readable git history.
<Type> <short description>
Or with an optional scope for clarity:
<Type> <scope>: <short description>
For multi-line commits, add a body after a blank line:
<Type> <short description>
<optional body with more details>
Guidelines:
- Use imperative mood in the subject line ("Add feature" not "Added feature")
- Keep the subject line under 72 characters
- Capitalize the first letter of the subject
- Do not end the subject line with a period
- Separate subject from body with a blank line
- Use the body to explain what and why (not how)
| Type | Description |
|---|---|
Add |
New feature, file, or functionality |
Update |
Enhancement or modification to existing feature |
Fix |
Bug fix |
Remove |
Removal of files, features, or code |
Refactor |
Code restructuring without changing behavior |
Docs |
Documentation changes |
Style |
Formatting, styling (no code logic changes) |
Test |
Adding or updating tests |
Chore |
Build process, dependencies, tooling |
Simple commit:
Add question skip functionality
Commit with scope:
Update branding: Oswald/Roboto fonts and new color palette
Commit with body:
Remove redundant files and development documentation
Delete planning/review documents, research notes, unused template
assets (react.svg, vite.svg), and duplicate logo files from root.
Bug fix:
Fix navigation state not resetting on quiz restart
Use descriptive branch names with the following prefixes:
| Prefix | Purpose |
|---|---|
feature/ |
New features (feature/add-distro-comparison) |
fix/ |
Bug fixes (fix/navigation-state-reset) |
docs/ |
Documentation (docs/add-contributing-guide) |
refactor/ |
Code refactoring (refactor/quiz-context) |
chore/ |
Maintenance tasks (chore/update-dependencies) |
Examples:
feature/add-new-distrofix/mobile-responsive-issuesdocs/update-readme
-
Sync your fork with the upstream repository:
git fetch upstream git checkout master git merge upstream/master
-
Create a feature branch:
git checkout -b feature/your-feature-name
-
Make your changes following the code style guidelines
-
Run linting to check for issues:
npm run lint
-
Build the project to ensure no TypeScript errors:
npm run build
-
Commit your changes following the commit conventions
-
Push to your fork:
git push origin feature/your-feature-name
-
Open a Pull Request on GitHub:
- Provide a clear title following commit conventions
- Describe what changes you made and why
- Reference any related issues (e.g., "Closes #4")
- Include screenshots for UI changes
- Code follows the project's style guidelines
-
npm run lintpasses without errors -
npm run buildcompletes successfully - Commit messages follow the conventions
- PR description clearly explains the changes
- UI changes include screenshots (if applicable)
When reporting issues, please include:
- Clear title describing the problem
- Environment details:
- Browser and version
- Operating system
- Node.js version (if relevant)
- Steps to reproduce the issue
- Expected behavior vs actual behavior
- Screenshots (for visual issues)
- Console errors (if any)
Bug Report:
## Description
A clear description of the bug.
## Steps to Reproduce
1. Go to '...'
2. Click on '...'
3. See error
## Expected Behavior
What should happen.
## Actual Behavior
What actually happens.
## Environment
- Browser: Chrome 120
- OS: Windows 11Feature Request:
## Description
A clear description of the feature.
## Use Case
Why this feature would be useful.
## Proposed Solution
How you think it could be implemented (optional).LinuxChooser/
├── .github/
│ └── workflows/
│ └── deploy.yml # GitHub Pages deployment
├── public/ # Static assets
├── src/
│ ├── components/ # React components
│ │ ├── ErrorBoundary.tsx
│ │ ├── LandingPage.tsx
│ │ ├── Layout.tsx
│ │ ├── LiveSidebar.tsx
│ │ ├── Question.tsx
│ │ └── ResultsPage.tsx
│ ├── context/ # React context providers
│ │ └── QuizContext.tsx
│ ├── data/ # Quiz data and distro information
│ │ ├── desktopEnvironments.ts
│ │ ├── distros.ts
│ │ ├── games.ts
│ │ ├── index.ts
│ │ └── questions.ts
│ ├── hooks/ # Custom React hooks
│ │ └── useQuiz.ts
│ ├── utils/ # Utility functions
│ │ ├── dealBreakers.ts
│ │ ├── index.ts
│ │ └── scoringAlgorithm.ts
│ ├── App.css
│ ├── App.tsx
│ ├── index.css
│ └── main.tsx
├── eslint.config.js # ESLint configuration
├── index.html # HTML entry point
├── package.json
├── tsconfig.json # TypeScript configuration
├── tsconfig.app.json
├── tsconfig.node.json
└── vite.config.ts # Vite configuration
If you have questions about contributing, feel free to:
- Open an issue for discussion
- Check existing issues and pull requests for context
Thank you for contributing to Linux Chooser!