Skip to content

Latest commit

 

History

History
245 lines (170 loc) · 6.25 KB

File metadata and controls

245 lines (170 loc) · 6.25 KB

Contributing to HackFlow Lite

Thank you for your interest in contributing to HackFlow Lite! This document provides guidelines and information for contributors.

Getting Started

Prerequisites

  • Node.js 18+ and npm
  • Git
  • Supabase account for testing
  • Basic knowledge of React, Next.js, and TypeScript

Development Setup

  1. Fork and Clone

    git clone https://github.com/your-username/hackflow-lite.git
    cd hackflow-lite
  2. Install Dependencies

    npm install
  3. Environment Setup

    cp .env.local.example .env.local
    # Update with your Supabase credentials
  4. Database Setup

    • Run the migration files in your Supabase project
    • See README.md for detailed instructions
  5. Start Development Server

    npm run dev

Development Guidelines

Code Style

  • TypeScript: Use strict TypeScript with proper type definitions
  • ESLint: Follow the configured ESLint rules
  • Prettier: Code formatting is handled automatically
  • Components: Use functional components with hooks
  • Styling: Use Tailwind CSS classes, avoid custom CSS when possible

Component Guidelines

  1. File Naming: Use kebab-case for files (registration-form.tsx)
  2. Component Naming: Use PascalCase for components (RegistrationForm)
  3. Props: Define proper TypeScript interfaces for all props
  4. Exports: Use default exports for components

Database Changes

  1. Migrations: Create new migration files for schema changes
  2. RLS Policies: Always include appropriate Row Level Security policies
  3. Testing: Test database changes thoroughly with different user roles

Testing

  1. Manual Testing: Test all user workflows thoroughly
  2. Role Testing: Test with both organizer and applicant roles
  3. Edge Cases: Test form validation, error states, and edge cases
  4. Responsive: Test on different screen sizes

Contribution Process

1. Issue First

  • Check existing issues before creating new ones
  • For new features, create an issue to discuss the approach
  • For bugs, provide detailed reproduction steps

2. Branch Naming

Use descriptive branch names:

  • feature/registration-form-validation
  • fix/dashboard-loading-state
  • docs/setup-instructions

3. Commit Messages

Follow conventional commit format:

type(scope): description

feat(auth): add password reset functionality
fix(forms): resolve validation error display
docs(readme): update setup instructions

4. Pull Request Process

  1. Create PR: Use the provided PR template
  2. Description: Clearly describe changes and motivation
  3. Testing: Include testing steps and screenshots
  4. Review: Address all review feedback
  5. Merge: Squash and merge when approved

Code Review Guidelines

For Contributors

  • Self Review: Review your own code before submitting
  • Documentation: Update documentation for new features
  • Tests: Include manual testing steps in PR description
  • Screenshots: Include UI changes screenshots

For Reviewers

  • Functionality: Verify the feature works as intended
  • Code Quality: Check for maintainability and best practices
  • Security: Review for potential security issues
  • Performance: Consider performance implications

Feature Development

Adding New Question Types

  1. Type Definition: Update RegistrationQuestion type
  2. Builder Component: Add to RegistrationQuestionBuilder
  3. Renderer: Update DynamicFormFields component
  4. Validation: Add appropriate validation rules
  5. Testing: Test creation, editing, and submission

Adding New Pages

  1. Routing: Follow Next.js app router conventions
  2. Authentication: Add appropriate middleware protection
  3. Layout: Use consistent layout patterns
  4. SEO: Include proper meta tags and titles

Database Schema Changes

  1. Migration File: Create numbered migration file
  2. RLS Policies: Include security policies
  3. Type Updates: Update TypeScript types
  4. Documentation: Update schema documentation

Security Guidelines

Authentication

  • Always use Supabase Auth for authentication
  • Implement proper role-based access control
  • Validate user permissions on server actions

Data Validation

  • Validate all user inputs on both client and server
  • Use Zod schemas for validation
  • Sanitize data before database operations

RLS Policies

  • Every table must have appropriate RLS policies
  • Test policies with different user roles
  • Follow principle of least privilege

Performance Guidelines

Frontend

  • Use Next.js built-in optimizations
  • Implement proper loading states
  • Optimize images and assets
  • Minimize bundle size

Database

  • Use appropriate indexes
  • Optimize queries for performance
  • Implement pagination for large datasets
  • Monitor query performance

Documentation

Code Documentation

  • Document complex functions and components
  • Use JSDoc for public APIs
  • Keep comments up to date with code changes

User Documentation

  • Update README for new features
  • Include setup instructions for new dependencies
  • Provide troubleshooting guides

Release Process

Version Numbering

Follow semantic versioning (semver):

  • Major: Breaking changes
  • Minor: New features (backward compatible)
  • Patch: Bug fixes

Release Checklist

  1. Update version in package.json
  2. Update CHANGELOG.md
  3. Test all features thoroughly
  4. Create release notes
  5. Tag release in Git

Getting Help

Resources

Community

  • Create issues for questions
  • Join discussions in pull requests
  • Follow the code of conduct

Code of Conduct

Our Standards

  • Be respectful and inclusive
  • Focus on constructive feedback
  • Help others learn and grow
  • Maintain professional communication

Enforcement

  • Report issues to project maintainers
  • Violations may result in temporary or permanent bans
  • Follow GitHub's community guidelines

Thank you for contributing to HackFlow Lite! Your contributions help make hackathon registration management better for everyone.