Thank you for considering contributing to React Ecommerce Boilerplate! This guide will help you get started.
- Fork the repository
- Clone your fork
git clone https://github.com/your-username/react-ecommerce.git cd react-ecommerce - Install dependencies
pnpm install
- Setup environment
cd apps/server cp .env.example .env # Edit .env with your configuration
- Start development
pnpm dev
Please read the Project Structure documentation to understand the codebase organization.
Always create a new branch for your work:
git checkout -b feat/your-feature-name
# or
git checkout -b fix/bug-descriptionBranch naming convention:
feat/- New featuresfix/- Bug fixesdocs/- Documentation changesrefactor/- Code refactoringchore/- Maintenance tasks
Follow the project's coding standards:
- ✅ Use TypeScript
- ✅ Follow existing code patterns
- ✅ Add JSDoc comments for complex functions
- ✅ Use semantic naming
- ✅ Keep functions small and focused
# Run linter
pnpm lint
# Run tests (if available)
pnpm test
# Build to check for errors
pnpm buildWe use Conventional Commits for all commit messages.
<type>: <simple description>
[optional body]
[optional footer]
feat- New featurefix- Bug fixdocs- Documentation onlystyle- Code style (formatting, missing semi-colons, etc.)refactor- Code refactoringperf- Performance improvementstest- Adding testschore- Maintenance (dependencies, config, etc.)
- Keep it simple - Subject line should be concise
- Use imperative mood - "add" not "added"
- No period at end - Subject line should not end with period
- Max 72 characters for subject line
- Minimum 10 characters for subject line
✅ Good commits:
git commit -m "feat: add product search functionality"
git commit -m "fix: cart total calculation error"
git commit -m "docs: update SDK installation guide"
git commit -m "refactor: extract auth logic to service"
git commit -m "chore: update dependencies to latest"❌ Bad commits:
git commit -m "update"
git commit -m "fix bug"
git commit -m "Added new feature with lots of changes."
git commit -m "WIP"
git commit -m "changes"git commit -m "feat(products): add list endpoint"
git commit -m "fix(cart): resolve quantity update issue"
git commit -m "docs(sdk): add usage examples"Add ! after type or BREAKING CHANGE: in footer:
git commit -m "feat!: migrate to new SDK architecture"
# Or with body:
git commit -m "feat: change API response format
BREAKING CHANGE: Response structure changed from nested to flat"git push origin feat/your-feature-name- Go to the repository on GitHub
- Click "New Pull Request"
- Select your branch
- Fill in the PR template
- Submit for review
Follow the same convention as commits:
feat: add product filtering
fix: resolve checkout bug
docs: improve SDK documentation
Use the PR template and include:
- What - What changes were made
- Why - Why these changes were needed
- How - How the changes work
- Testing - How you tested the changes
- Screenshots - If applicable
Before submitting, ensure:
- Code follows project style guidelines
- All tests pass
- Linter passes with no errors
- Documentation is updated (if needed)
- Commit messages follow Conventional Commits
- PR title follows Conventional Commits
- Breaking changes are documented
// ✅ Good
interface User {
id: string;
email: string;
firstName: string;
}
export const getUserById = async (id: string): Promise<User> => {
const user = await prisma.user.findUnique({ where: { id } });
if (!user) {
throw new NotFoundException('User not found');
}
return user;
};
// ❌ Bad
export const get = async (x: any) => {
return await prisma.user.findUnique({ where: { id: x } });
};// ✅ Good
interface ButtonProps {
variant?: 'solid' | 'outline';
size?: 'sm' | 'md' | 'lg';
children: React.ReactNode;
onClick?: () => void;
}
export const Button: React.FC<ButtonProps> = ({
variant = 'solid',
size = 'md',
children,
onClick,
}) => {
return (
<button className={buttonStyles({ variant, size })} onClick={onClick}>
{children}
</button>
);
};
// ❌ Bad
export const Button = (props: any) => {
return <button {...props} />;
};- Components: PascalCase (
Button,ProductCard) - Hooks: camelCase with "use" prefix (
useAuth,useProducts) - Functions: camelCase (
getUserById,calculateTotal) - Constants: UPPER_SNAKE_CASE (
MAX_ITEMS,API_URL) - Types/Interfaces: PascalCase (
User,ProductInput) - Files: kebab-case (
user-profile.tsx,auth-service.ts)
# 1. Update Prisma schema
cd apps/server
# Edit prisma/schema.prisma
# 2. Create migration
pnpm prisma migrate dev --name add_feature
# 3. Generate Prisma Client
pnpm prisma generate
# 4. Create module
mkdir src/feature
# Create service, resolver, DTOs
# 5. Update GraphQL schema
# Edit src/graphql/schemas/schema.gql
# 6. Register module in app.module.ts# 1. Create service folder
mkdir packages/sdk/src/services/feature
# 2. Create queries and mutations
# Create queries.ts, mutations.ts, index.ts
# 3. Export from services/index.ts# 1. Create component folder
mkdir packages/design-system/src/components/Feature
# 2. Create component files
# Create Feature.tsx, index.ts
# 3. Export from components/index.ts# Add documentation to apps/docs/
# Update README.md if neededdescribe('ProductService', () => {
it('should create a product', async () => {
const product = await service.create({
name: 'Test Product',
price: 99.99,
});
expect(product.name).toBe('Test Product');
});
});import { render, screen } from '@testing-library/react';
import { Button } from './Button';
describe('Button', () => {
it('renders with children', () => {
render(<Button>Click me</Button>);
expect(screen.getByText('Click me')).toBeInTheDocument();
});
});When adding new features, update:
- Code comments - JSDoc for complex functions
- README files - Package-specific documentation
- Apps/docs - Developer documentation
- IMPLEMENTATION_STATUS.md - Track feature completion
- Type definitions - Keep TypeScript types updated
- Read the documentation
- Check existing issues
- Ask in discussions
- Review the .cursorrules file
- Be respectful and inclusive
- Welcome newcomers
- Focus on constructive feedback
- Help others learn
By contributing, you agree that your contributions will be licensed under the MIT License.
If you have questions, please:
- Check the documentation
- Search existing issues
- Open a new issue with the "question" label
Thank you for contributing! 🎉