Thank you for your interest in contributing to the RBAC System! This document provides guidelines and instructions for contributing to this project.
- Code of Conduct
- Getting Started
- Development Workflow
- Pull Request Process
- Coding Standards
- Testing Guidelines
- Documentation
- Issue Reporting
This project adheres to a Code of Conduct that sets expectations for participation in the community. By participating, you are expected to uphold this code. Please report unacceptable behavior to the project maintainers.
We expect all contributors to:
- Be respectful and inclusive in communications
- Be collaborative and open to different viewpoints
- Gracefully accept constructive criticism
- Focus on what is best for the community
- Show empathy towards other community members
To contribute to the RBAC System, you'll need:
- Go 1.23 or later
- Node.js 18 or later
- MongoDB (local instance or connection to Atlas)
- Git
-
Fork the repository on GitHub
-
Clone your fork locally:
git clone https://github.com/YOUR-USERNAME/rbac-system.git cd rbac-system -
Add the original repository as an upstream remote:
git remote add upstream https://github.com/ORIGINAL-OWNER/rbac-system.git
-
Install backend dependencies:
go mod download
-
Install frontend dependencies:
cd frontend npm install cd ..
-
Copy the
.env.examplefile to.envand configure the environment variables:cp .env.example .env # Edit .env with your preferred editor
main- The production branch containing stable codedevelop- The development branch for integrating featuresfeature/XXX- Feature branches for new functionalitybugfix/XXX- Bugfix branches for fixing issuesdocs/XXX- Documentation branches for documentation updates
-
Sync your fork with the upstream repository:
git checkout main git pull upstream main git push origin main
-
Create a new branch for your feature or fix:
git checkout -b feature/your-feature-name # or git checkout -b bugfix/your-bugfix-name -
Make your changes, following the coding standards
-
Commit your changes with descriptive messages:
git commit -m "feat: Add new permission validation" # or git commit -m "fix: Resolve token validation issue"
-
Push your branch to your fork:
git push origin feature/your-feature-name
-
Create a pull request from your branch to the
developbranch of the original repository
go run main.gocd frontend
npm startThis will start the frontend development server on port 3000.
- Ensure your code follows the project's coding standards
- Update documentation as needed
- Include tests for new functionality
- Ensure all tests pass
- Update the CHANGELOG.md with details of changes if applicable
- The PR should target the
developbranch, notmain - PR titles should follow the Conventional Commits format:
feat: Add new feature Xfix: Resolve issue with Ydocs: Update API documentationtest: Add tests for feature Zrefactor: Improve code organization in module W
- Follow the Go Code Review Comments
- Use
gofmtto format your code - Follow the package structure of the project
- Add comments to exported functions, types, and constants
- Keep functions focused on a single responsibility
- Write meaningful error messages
- Use context for cancellation and timeouts
- Follow the Airbnb JavaScript Style Guide
- Use TypeScript interfaces for prop types and state
- Use functional components with hooks instead of class components
- Keep components focused on a single responsibility
- Use consistent naming conventions
- Follow the file structure of the project
- Format code with Prettier
Follow the Conventional Commits specification:
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
Types include:
feat: A new featurefix: A bug fixdocs: Documentation changesstyle: Changes that do not affect the meaning of the coderefactor: Code changes that neither fix a bug nor add a featuretest: Adding or correcting testschore: Changes to the build process or auxiliary tools
- Write unit tests for services and utilities
- Write integration tests for handlers
- Aim for good test coverage, especially for critical components
- Use table-driven tests where appropriate
- Run tests with
go test ./...
- Write unit tests for components and utilities using Jest and React Testing Library
- Write integration tests for complex user flows
- Test both successful and error paths
- Run tests with
npm test
Documentation is just as important as code. Please update the documentation when you make changes:
- API Documentation: Update
docs/API.mdwhen changing or adding API endpoints - Architecture Documentation: Update
docs/ARCHITECTURE.mdwhen changing the system design - README.md: Update for significant changes to setup or usage
- Code Comments: Add clear comments for complex logic or non-obvious behavior
When reporting issues, please use the issue templates provided in the repository. Include:
- A clear, descriptive title
- Steps to reproduce the issue
- Expected behavior
- Actual behavior
- Screenshots or logs if applicable
- Environment information:
- Operating system
- Go version
- Node.js version
- Browser version (for frontend issues)
- Any other relevant details
Thank you for contributing to the RBAC System!