Contributing Guide

Help us make ABAC better for everyone

Welcome Contributors! 🎉

We welcome contributions from everyone! Whether you're fixing bugs, adding features, improving documentation, or reporting issues, your help is appreciated. This guide will help you get started.

Ways to Contribute

Code Contributions

Fix bugs, add features, optimize performance, or improve code quality

Documentation

Improve guides, fix typos, add examples, or clarify explanations

Bug Reports

Report issues with clear reproduction steps and expected behavior

Feature Requests

Suggest new features or improvements to existing functionality

Development Setup

1. Fork and Clone

Fork the repository on GitHub and clone your fork:

# For abac-engine
git clone https://github.com/YOUR_USERNAME/abac-engine.git
cd abac-engine

# For abac-admin
git clone https://github.com/YOUR_USERNAME/abac-admin.git
cd abac-admin

2. Install Dependencies

# For abac-engine
npm install

# For abac-admin (monorepo)
npm install
npm run build

3. Create a Branch

Create a new branch for your changes:

git checkout -b feature/your-feature-name
# or
git checkout -b fix/bug-description

Code Standards

TypeScript: Use strict TypeScript. Avoid any types. Define proper interfaces and types.

Code Style: Follow existing code patterns. Use Prettier for formatting and ESLint for linting.

Naming: Use camelCase for variables/functions, PascalCase for components/classes, kebab-case for files.

Comments: Write clear, concise comments for complex logic. Use JSDoc for public APIs.

Imports: Organize imports: built-ins, external packages, internal modules, relative imports.

Performance: Write efficient code. Avoid unnecessary re-renders in React. Consider memory usage.

Testing Guidelines

All contributions should include appropriate tests:

Running Tests

npm test
npm run test:watch
npm run test:coverage

Test Coverage

  • Unit tests for utility functions and core logic
  • Integration tests for policy evaluation
  • Component tests for React hooks and UI
  • Aim for at least 80% code coverage

Pull Request Process

1. Prepare Your Changes

# Run tests
npm test

# Run linting
npm run lint

# Build to check for errors
npm run build

# Commit your changes
git add .
git commit -m "feat: add your feature description"

2. Commit Message Format

Use conventional commits format:

feat: add new featurefix: resolve bug in evaluationdocs: update contributing guiderefactor: improve code structuretest: add test coverage

3. Push and Create PR

git push origin feature/your-feature-name

Then create a Pull Request on GitHub with:

  • Clear description of changes
  • Link to related issues
  • Screenshots for UI changes
  • Testing instructions

Project Structure

abac-engine

src/
├── core/ # Core engine
├── types/ # TypeScript types
├── utils/ # Utilities
└── index.ts # Main export

tests/ # Test files
examples/ # Example usage

abac-admin (Monorepo)

packages/
├── core/ # Core logic
├── react/ # React hooks
├── nextjs/ # Next.js utils
└── react-ui/ # UI components

examples/
└── nextjs/ # Demo app

Best Practices

Keep pull requests focused on a single feature or fix

Update documentation when adding or changing features

Write tests for new features and bug fixes

Be responsive to feedback during code review

Keep commits clean and meaningful

Getting Help

If you need help or have questions:

  • Open a discussion on GitHub for general questions
  • Create an issue for bug reports or feature requests
  • Comment on existing PRs for code review questions

Thank You! ❤️

Your contributions help make ABAC better for everyone. We appreciate your time and effort in improving this project!