Skip to content

Latest commit

 

History

History
93 lines (67 loc) · 3.21 KB

File metadata and controls

93 lines (67 loc) · 3.21 KB

Contributing to Answerflow

First off, thank you for considering contributing to Answerflow! It's people like you that make this community engine better for everyone.

The Gatekeeper: Mandatory Local Setup

To ensure code quality and consistency, we use Git hooks.

git clone https://github.com/codearcade-io/answerflow
cd answerflow
pnpm install

Code Quality Standards

We do not use Prettier or ESLint. Instead, we use Biome for lightning-fast formatting and linting.

Before committing your code, our pre-commit hooks will automatically run:

  • Biome Check: pnpm biome check --write to format and lint your changes.
  • Typecheck: pnpm typecheck must pass without any TypeScript errors.
  • Build: pnpm build must succeed before you push.

Pull Requests and Commit Messages

We use Conventional Commits (e.g., feat: add new button, fix: resolve crash on login). Our commitlint configuration will verify your commit messages before they are created.

Creating a PR

  1. Fork the repository and create your branch from main.
  2. Make your changes, ensuring you follow our architectural patterns.
  3. Commit using Conventional Commits.
  4. Push your branch and open a PR against main.
  5. Fill out the PR template completely, including any necessary screenshots or videos.

Handling Images

To ensure consistent optimization and proper handling of our S3/MinIO infrastructure, we use a custom Image wrapper.

Caution

Do not use next/image directly. Always import the Image component from our internal library to ensure local S3 paths are resolved correctly.

Correct Usage

// ❌ Avoid this
import Image from "next/image"

// ✅ Do this
import { Image } from "@/components/shared/image"

export const MyComponent = () => {
  return (
    <Image 
      src="/path/to/avatar.png" 
      alt="User Avatar" 
      width={40} 
      height={40} 
    />
  )
}

Folder Structure Overview

This is a Turborepo monorepo.

  • apps/: Contains our runnable applications.
    • web/: The main Next.js application handling the AnswerFlow frontend and API routes.
    • docs/: The Next.js documentation site (what you're reading now).
    • worker/: A dedicated Node.js background worker process for heavy asynchronous tasks.
  • packages/: Reusable packages and modules.
    • constants/: Constants used across the application.
    • db/: The single source of truth for our Prisma schema and generated client.
    • email/: Email Provider integrations.
    • emails/: Email templates and layouts.
    • push-notification/: Contains Push notification functionality created with firebase admin sdk.
    • queue/: Queue adapter with BullMQ & Qstash integrations.
    • rate-limit/: Rate Limiter with redis.
    • redis/: Single source of truth for redis.
    • storage/: Single source of truth for S3 storage.
    • types/: TypeScript types and DTOs.
    • typescript-config/: TypeScript base config for the project.
    • ui/: UI Components.
    • utils/: Utilities and helper functions.
    • validators/: Zod schemas for validation.

For detailed structure refer to our Architecture.

We look forward to your contributions!