Contributing to Probly
Thank you for your interest in contributing to Probly! This document provides guidelines and instructions for contributing to the project.
Getting Started
Prerequisites
- Node.js (v14 or later)
- npm or yarn
- Git
Setup
- Fork the repository on GitHub
-
Clone your fork locally:
-
Install dependencies:
-
Create a
.envfile with your OpenAI API key: -
Start the development server:
Development Workflow
-
Create a new branch for your feature or bugfix:
-
Make your changes
- Test your changes thoroughly
-
Commit your changes with a descriptive message:
-
Push to your fork:
-
Create a Pull Request from your fork to the main repository
Project Structure
/src: Source code/components: React components/context: React context providers/constants: Application constants/lib: Utility libraries/pages: Next.js pages/types: TypeScript type definitions/utils: Utility functions/docs: Documentation/public: Static assets
Key Components
Spreadsheet
The spreadsheet component (Spreadsheet.tsx) is the main interface for data display and manipulation. It uses Handsontable for the grid and integrates with the SpreadsheetContext.
AI Chat
The chat interface (ChatBox.tsx) handles user interactions with the AI assistant. It sends requests to the LLM API and displays responses.
Python Sandbox
The PyodideSandbox (pyodideSandbox.ts) provides Python execution capabilities in the browser using WebAssembly.
Adding New Features
New Tools
To add a new tool for the AI assistant:
- Add the tool definition to
src/constants/tools.ts - Implement the tool handling in
src/pages/api/llm.ts - Update the UI components to handle the tool's output
UI Components
When adding new UI components:
- Create the component in
src/components/ - Use TypeScript for type safety
- Follow the existing styling patterns
- Add appropriate tests
Documentation
When adding or modifying features, please update the relevant documentation:
- Update or create markdown files in the
/docsdirectory - Add JSDoc comments to functions and components
- Update type definitions as needed
Testing
Before submitting a PR, please ensure:
- Your code compiles without errors
- All existing functionality still works
- Your new features work as expected
- You've added appropriate tests for new functionality
Code Style
- Follow the existing code style
- Use TypeScript for type safety
- Use functional components with hooks for React
- Use async/await for asynchronous code
- Add appropriate error handling
Submitting Pull Requests
When submitting a PR:
- Provide a clear description of the changes
- Reference any related issues
- Ensure all tests pass
- Include screenshots for UI changes if applicable
- Update documentation as needed
Questions?
If you have any questions or need help, please:
- Check the existing documentation
- Look for similar issues on GitHub
- Open a new issue with your question
Thank you for contributing to Probly!