Skip to content

Latest commit

 

History

History
194 lines (136 loc) · 7.78 KB

CONTRIBUTING.md

File metadata and controls

194 lines (136 loc) · 7.78 KB

CONTRIBUTING

So you're looking to contribute to Refly - that's awesome, we can't wait to see what you do. As an AI-native creation engine, we aim to provide the most intuitive free-form canvas interface that combines multi-threaded conversations, knowledge base RAG integration, contextual memory, and intelligent search capabilities. Any help from the community counts, truly.

We need to be nimble and ship fast given where we are, but we also want to make sure that contributors like you get as smooth an experience at contributing as possible. We've assembled this contribution guide for that purpose, aiming at getting you familiarized with the codebase & how we work with contributors, so you could quickly jump to the fun part.

This guide, like Refly itself, is a constant work in progress. We highly appreciate your understanding if at times it lags behind the actual project, and welcome any feedback for us to improve.

In terms of licensing, please take a minute to read our short License and Contributor Agreement. The community also adheres to the code of conduct.

Before you jump in

Find an existing issue, or open a new one. We categorize issues into 2 types:

Feature requests

  • If you're opening a new feature request, we'd like you to explain what the proposed feature achieves, and include as much context as possible about how it enhances the AI-native creation experience.

  • If you want to pick one up from the existing issues, simply drop a comment below it saying so.

    A team member working in the related direction will be looped in. If all looks good, they will give the go-ahead for you to start coding. We ask that you hold off working on the feature until then, so none of your work goes to waste should we propose changes.

    Depending on whichever area the proposed feature falls under, you might talk to different team members. Here's rundown of the areas each our team members are working on at the moment:

    Member Scope
    Canvas & AI Features Multi-threaded dialogues, AI-powered canvas features
    Knowledge Base RAG integration, contextual memory
    Frontend Experience UI/UX, canvas interactions
    Developer Experience API, SDK, developer tools
    Core Architecture Overall system design and scalability

    How we prioritize:

    Feature Type Priority
    Core AI features and canvas functionality High Priority
    Knowledge base and collaboration features Medium Priority
    UI/UX improvements and minor enhancements Low Priority
    Experimental features and future ideas Future-Feature

Anything else (e.g. bug report, performance optimization, typo correction)

  • Start coding right away.

    How we prioritize:

    Issue Type Priority
    Bugs in core AI features or canvas functionality Critical
    Performance issues affecting user experience Medium Priority
    Minor UI fixes and documentation updates Low Priority

Installing

Here are the steps to set up Refly for development:

1. Fork this repository

2. Clone the repo

Clone the forked repository from your terminal:

git clone [email protected]:<github_username>/refly.git

3. Verify dependencies

Refly requires the following dependencies to build:

4. Installation

Refly consists of multiple packages managed in a monorepo structure. The main components are:

  1. Web Application (apps/web/): The main web interface
  2. API Server (apps/api/): The backend server
  3. AI Workspace Common (packages/ai-workspace-common/): Shared AI workspace UI components
  4. i18n (packages/i18n/): Internationalization support

Follow these steps to install:

  1. Spin up all the middlewares:
cd deploy/docker
docker-compose -f docker-compose.middleware.yml up -d
  1. Install dependencies:
corepack enable
pnpm install
  1. Set up environment variables for both API and web:
cp apps/web/.env.example apps/web/.env
cp apps/api/.env.example apps/api/.env
  1. Start developing:
pnpm dev

You can visit http://localhost:5173 to start developing Refly.

Developing

To help you quickly navigate where your contribution fits, here's a brief outline of Refly's structure:

Backend Structure

[apps/server/]             // Main server application
├── src/
│   ├── controllers/      // API route handlers
│   ├── services/        // Business logic implementation
│   ├── models/          // Data models and types
│   ├── ai/              // AI feature implementations
│   │   ├── llm/        // LLM integration and management
│   │   ├── rag/        // RAG pipeline implementation
│   │   └── memory/     // Context memory management
│   ├── canvas/         // Canvas-related backend services
│   └── utils/          // Shared utilities

[packages/]
├── ai-core/            // Core AI functionality
│   ├── src/
│   │   ├── llm/       // LLM abstraction and implementations
│   │   ├── memory/    // Memory systems
│   │   └── rag/       // RAG implementations
│
└── shared/            // Shared types and utilities
    └── src/
        └── types/     // Common TypeScript types

The backend is built with Nest.js and TypeScript, focusing on:

  • AI feature implementation including LLM integration, RAG pipelines, and context memory
  • Canvas state management and real-time collaboration
  • RESTful APIs and WebSocket connections for real-time features
  • Efficient data storage and retrieval for knowledge bases

Frontend Structure

[apps/web/]                 // Main web application
├── src/
│   ├── components/         // React components
│   ├── styles/            // Global styles and themes
│   └── main.tsx           // Application entry point

[packages/]
├── ai-workspace-common/   // Shared AI workspace components
│   ├── src/
│   │   ├── components/    // Canvas, editor, and AI feature components
│   │   └── utils/        // Shared utilities
│
└── i18n/                 // Internationalization
    ├── src/
    │   ├── en-US/        // English translations
    │   └── zh-Hans/      // Chinese translations

Submitting your PR

When you're ready to submit your contribution:

  1. Make sure your code follows our style guidelines
  2. Add tests if applicable
  3. Update documentation if needed
  4. Create a pull request to the main branch

For major features, we first merge them into the develop branch for testing before they go into the main branch.

And that's it! Once your PR is merged, you will be featured as a contributor in our README.

Getting Help

If you ever get stuck or have questions while contributing, you can: