Skip to content

Latest commit

 

History

History
255 lines (181 loc) · 5.52 KB

File metadata and controls

255 lines (181 loc) · 5.52 KB

Contributing to Duckbase

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

Table of Contents

Code of Conduct

This project adheres to a code of conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to the project maintainers.

Getting Started

Prerequisites

  • Node.js 18 or higher
  • npm or yarn
  • Git
  • OpenAI API key (for AI features)

Setting Up the Development Environment

  1. Fork the repository on GitHub

  2. Clone your fork locally:

    git clone https://github.com/Saadain23/duckbase.git
    cd duckbase
  3. Install dependencies:

    npm install
  4. Set up environment variables: Create a .env.local file in the root directory:

    NEXT_PUBLIC_SITE_URL=http://localhost:3000
  5. Start the development server:

    npm run dev
  6. Open http://localhost:3000 to verify the setup

Development Workflow

Branch Strategy

This project uses a simple two-branch strategy:

  • main: Production-ready code
  • dev: Development branch for all new features and bug fixes

All contributions should be made to the dev branch.

Making Changes

  1. Create a feature branch from dev:

    git checkout dev
    git pull origin dev
    git checkout -b feature/your-feature-name
  2. Make your changes:

    • Write clean, readable code
    • Follow the existing code style
    • Add tests for new functionality
    • Update documentation as needed
  3. Test your changes:

    npm run lint
    npm run build
  4. Commit your changes:

    git add .
    git commit -m "feat: add new feature description"

    Use conventional commit messages:

    • feat: for new features
    • fix: for bug fixes
    • docs: for documentation changes
    • style: for formatting changes
    • refactor: for code refactoring
    • test: for adding tests
    • chore: for maintenance tasks

Pull Request Process

  1. Push your branch:

    git push origin feature/your-feature-name
  2. Create a Pull Request:

    • Go to the GitHub repository
    • Click "New Pull Request"
    • Target the dev branch (not main)
    • Fill out the PR template with:
      • Description of changes
      • Testing instructions
      • Screenshots (if applicable)
      • Related issues
  3. PR Requirements:

    • All tests must pass
    • Code must be linted and formatted
    • PR must be reviewed and approved
    • No merge conflicts
  4. After approval:

    • Maintainers will merge your PR into dev
    • Your feature will be included in the next release to main

Code Style

TypeScript/JavaScript

  • Use TypeScript for all new code
  • Follow the existing ESLint configuration
  • Use meaningful variable and function names
  • Add JSDoc comments for complex functions

React Components

  • Use functional components with hooks
  • Follow the existing component structure in src/components/
  • Use TypeScript interfaces for props
  • Keep components focused and reusable

File Organization

  • Place components in appropriate directories under src/components/
  • Use index files for clean imports
  • Follow the existing naming conventions

CSS/Styling

  • Use Tailwind CSS for styling
  • Follow the existing design patterns
  • Keep styles responsive and accessible

Testing

Manual Testing

Before submitting a PR, please test:

  1. Core functionality:

    • File upload (CSV/JSON)
    • AI assistant queries
    • SQL query execution
    • Data visualization
  2. Browser compatibility:

    • Chrome/Chromium
    • Firefox
    • Safari
    • Edge
  3. Responsive design:

    • Desktop

Documentation

Code Documentation

  • Add JSDoc comments for public functions
  • Document complex algorithms or business logic
  • Keep README.md updated for new features

API Documentation

  • Document new API endpoints
  • Include request/response examples
  • Update environment variable documentation

Reporting Issues

Bug Reports

When reporting bugs, please include:

  1. Environment information:

    • Operating system
    • Browser and version
    • Node.js version
  2. Steps to reproduce:

    • Clear, numbered steps
    • Expected vs actual behavior
    • Screenshots or error messages
  3. Additional context:

    • Console errors
    • Network tab information
    • Sample data (if applicable)

Feature Requests

For feature requests, please include:

  1. Problem description:

    • What problem does this solve?
    • Who would benefit from this feature?
  2. Proposed solution:

    • How should this work?
    • Any design considerations?
  3. Alternatives considered:

    • Other approaches you've thought about

Questions

If you have questions about contributing:

  1. Check existing issues and discussions
  2. Review the codebase and documentation
  3. Open a new issue with the "question" label
  4. Join community discussions (if available)

Recognition

Contributors will be recognized in:

  • CONTRIBUTORS.md file
  • Release notes
  • Project documentation

Thank you for contributing to Duckbase!