Thank you for your interest in contributing to DoksAI! This document provides guidelines and instructions for contributing to the project.
- Code of Conduct
- Getting Started
- Development Workflow
- Branch Naming Convention
- Commit Message Guidelines
- Pull Request Process
- Coding Standards
- Testing Guidelines
- Project Roadmap
- Getting Help
By participating in this project, you agree to maintain a respectful and inclusive environment for everyone.
- Be respectful and inclusive
- Accept constructive criticism gracefully
- Focus on what's best for the community
- Show empathy towards other community members
- Bun >= 1.0.0 (Package manager)
- Node.js >= 18.0.0
- Git >= 2.0.0
- A code editor (VS Code recommended)
-
Fork the repository
# Click the "Fork" button on GitHub -
Clone your fork
git clone https://github.com/YOUR_USERNAME/doksAI.git cd doksAI -
Add upstream remote
git remote add upstream https://github.com/abdullah4tech/doksAI.git
-
Install dependencies
bun install
-
Set up environment variables
cp .env.example .env # Edit .env with your configuration -
Start development server
bun run dev
Before starting work, always sync with the upstream repository:
git checkout main
git pull upstream main
git push origin main# For version-specific features
git checkout -b feature/v0.2.0-conversation-sidebar
# For bug fixes
git checkout -b fix/sidebar-scroll-issue
# For tests
git checkout -b test/vitest-setup- Write clean, readable code
- Follow the coding standards (below)
- Add tests for new features
- Update documentation if needed
git add .
git commit -m "feat(v0.2.0): add conversation sidebar component"git push origin feature/v0.2.0-conversation-sidebar- Go to your fork on GitHub
- Click "New Pull Request"
- Select your branch
- Fill out the PR template
- Request review
We use a structured branch naming convention to keep the repository organized.
<type>/<version>-<short-description>
feature/- New featuresfix/- Bug fixestest/- Testing-related changesdocs/- Documentation updatesinfra/- Infrastructure/DevOps changesrefactor/- Code refactoringstyle/- UI/styling changesperf/- Performance improvementsexperimental/- Experimental features
feature/v0.2.0-conversation-sidebar
feature/v0.3.0-bookmark-system
fix/v0.2.0-sidebar-scroll-issue
test/vitest-setup
docs/update-readme
infra/ci-cd-pipeline
refactor/optimize-chat-storeWe follow Conventional Commits specification.
<type>(<scope>): <description>
[optional body]
[optional footer]
feat- New featurefix- Bug fixdocs- Documentation changesstyle- Code style changes (formatting, semicolons, etc.)refactor- Code refactoringperf- Performance improvementstest- Adding or updating testschore- Maintenance tasks (dependencies, config, etc.)ci- CI/CD changesbuild- Build system changes
Use the version number when applicable:
v0.2.0- Conversation Management featuresv0.3.0- Bookmarks & Labels featuresv0.4.0- Advanced Interaction featuresv0.5.0- Document Intelligence featuresv0.6.0- Smart Suggestions features
Or use component/feature names:
sidebar- Sidebar componentstore- State managementapi- API servicesui- User interface
# Feature
feat(v0.2.0): add conversation sidebar component
feat(sidebar): implement search functionality
# Bug Fix
fix(v0.3.0): resolve bookmark persistence issue
fix(api): handle timeout errors correctly
# Documentation
docs(readme): update installation instructions
docs(contributing): add testing guidelines
# Testing
test(sidebar): add unit tests for search
test(store): add tests for chat session management
# Refactoring
refactor(store): optimize message handling
refactor(ui): improve button component structure
# Performance
perf(v0.5.0): optimize chart rendering
# Chore
chore(deps): update vue to 3.5.13
chore(config): update vite configuration- Use imperative mood ("add" not "added" or "adds")
- Don't capitalize first letter
- No period at the end
- Limit first line to 72 characters
- Reference issues when applicable (#123)
- Code follows project coding standards
- All tests pass locally
- New code has appropriate tests
- Documentation is updated
- No console errors or warnings
- Branch is up to date with main/develop
[v0.2.0] Add Conversation Sidebar
[v0.3.0] Implement Bookmark System
[FIX] Resolve sidebar scroll issue
[TEST] Add Vitest configuration
[DOCS] Update README
Brief description of changes
Closes #123
- Bug fix (non-breaking change)
- New feature (non-breaking change)
- Breaking change (fix or feature that would cause existing functionality to not work as expected)
- Documentation update
Add screenshots or GIFs
- My code follows the project's style guidelines
- I have performed a self-review of my code
- I have commented my code, particularly in hard-to-understand areas
- I have updated the documentation accordingly
- My changes generate no new warnings
- I have added tests that prove my fix is effective or that my feature works
- New and existing unit tests pass locally with my changes
- Any dependent changes have been merged and published
- Automated Checks - CI/CD pipeline runs tests and linting
- Code Review - At least one maintainer reviews the code
- Changes Requested - Address feedback if needed
- Approval - Once approved, the PR can be merged
- Merge - Maintainer merges using squash or merge commit
// Use explicit types
const message: string = 'Hello'
const count: number = 42
// Use interfaces for objects
interface User {
id: string
name: string
email: string
}
// Use type for unions/intersections
type Status = 'pending' | 'completed' | 'failed'
// Prefer const over let
const API_URL = 'http://localhost:8000'
// Use arrow functions for consistency
const getUserName = (user: User): string => user.name<script setup lang="ts">
import { ref, computed, onMounted } from 'vue'
import type { Message } from '@/store/types'
// Use refs for reactive state
const message = ref<string>('')
const isLoading = ref<boolean>(false)
// Use computed for derived state
const messageCount = computed(() => messages.value.length)
// Type your functions
const sendMessage = (text: string): void => {
// Implementation
}
// Use lifecycle hooks appropriately
onMounted(() => {
// Initialize
})
</script>- Use Tailwind CSS utility classes
- Follow mobile-first responsive design
- Keep custom CSS minimal
- Use scoped styles when necessary
<template>
<!-- Mobile-first responsive -->
<div class="p-4 sm:p-6 lg:p-8">
<h1 class="text-2xl sm:text-3xl lg:text-4xl font-bold">Title</h1>
</div>
</template>
<style scoped>
/* Custom styles only when necessary */
.custom-gradient {
background: linear-gradient(to right, #667eea 0%, #764ba2 100%);
}
</style>src/
├── components/ # Reusable components
│ ├── MyComponent.vue
│ └── __tests__/ # Component tests
├── pages/ # Page components
├── store/ # Pinia stores
│ ├── index.ts
│ ├── types.ts
│ └── __tests__/ # Store tests
├── services/ # API services
├── utils/ # Utility functions
├── composables/ # Vue composables
└── styles/ # Global styles
- Components: PascalCase (
MyComponent.vue) - Files: camelCase (
userService.ts) - Constants: UPPER_SNAKE_CASE (
API_BASE_URL) - Functions: camelCase (
getUserData()) - Interfaces/Types: PascalCase (
interface User {}) - Store: camelCase with 'use' prefix (
useUserStore)
import { describe, it, expect, beforeEach } from 'vitest'
import { setActivePinia, createPinia } from 'pinia'
import { mount } from '@vue/test-utils'
describe('Component/Feature Name', () => {
beforeEach(() => {
// Setup
})
it('should describe what the test does', () => {
// Arrange
const input = 'test'
// Act
const result = functionUnderTest(input)
// Assert
expect(result).toBe('expected')
})
})- Aim for >80% code coverage
- Write tests for:
- All store actions and getters
- Utility functions
- Component props and events
- Edge cases and error handling
# Run all tests
bun run test
# Run tests in watch mode
bun run test:watch
# Run tests with coverage
bun run test:coverage
# Run tests with UI
bun run test:uiWe follow a versioned release strategy. Contributions should align with the current version in development.
| Version | Focus | Status |
|---|---|---|
| v0.2.0 | Conversation Management | Next |
| v0.3.0 | Bookmarks & Labels | Planned |
| v0.4.0 | Advanced Interaction | Planned |
| v0.5.0 | Document Intelligence | Planned |
| v0.6.0 | Smart Suggestions | Planned |
| v1.0.0 | Production Release | Goal |
See ROADMAP.md for detailed feature descriptions.
- Check GitHub Issues
- Look for issues labeled:
good first issue- Great for newcomershelp wanted- Need contributorsv0.2.0,v0.3.0, etc. - Version-specific features
- Comment on the issue to claim it
- Follow the issue template guidelines
- GitHub Discussions - Ask questions
- Documentation - Read the docs
- Issues - Report bugs
- Be clear and concise
- Provide context and examples
- Be patient and respectful
- Search existing issues/discussions first
When adding features, please update:
README.md- If user-facing features changeCHANGELOG.md- Document all changes- Code comments - For complex logic
- Type definitions - Keep types up to date
- Tests - Document test scenarios
Contributors will be:
- Listed in the project README
- Mentioned in release notes
- Celebrated in project discussions
By contributing, you agree that your contributions will be licensed under the same license as the project (check LICENSE file).
Thank you for contributing to DoksAI! Your efforts help make this project better for everyone.
Questions? Open a discussion or reach out to the maintainers.