Contributing
How to contribute to the Nox ecosystem
Contributing to Nox
Thank you for your interest in contributing to Nox! This guide will help you get started with contributing to the project.
Code of Conduct
By participating in this project, you agree to abide by our Code of Conduct. Please treat all community members with respect and kindness.
Getting Started
1. Fork and Clone
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/your-username/nox.git
cd nox2. Set Up Development Environment
Follow the Getting Started guide to set up your local development environment.
3. Create a Branch
Create a new branch for your feature or bug fix:
git checkout -b feature/your-feature-name
# or
git checkout -b fix/your-bug-fixDevelopment Workflow
Making Changes
-
Write clear, descriptive commit messages:
git commit -m "Add user authentication to API endpoints" -
Follow coding standards:
- Use TypeScript for new code
- Follow existing code style
- Add JSDoc comments for public APIs
- Write tests for new functionality
-
Test your changes:
npm test npm run lint npm run type-check
Submitting Changes
-
Push your branch:
git push origin feature/your-feature-name -
Open a Pull Request:
- Use a clear, descriptive title
- Describe what changes you made and why
- Reference any related issues
- Include screenshots for UI changes
Types of Contributions
Bug Reports
When reporting bugs, please include:
- Clear description of the issue
- Steps to reproduce the problem
- Expected vs actual behavior
- System information (OS, Node.js version, etc.)
- Error logs if available
Feature Requests
For new features:
- Describe the problem the feature would solve
- Explain your proposed solution
- Consider alternative solutions
- Discuss potential drawbacks
Code Contributions
We welcome contributions in these areas:
- Bug fixes
- New features
- Performance improvements
- Documentation updates
- Test coverage improvements
Documentation
Help improve our documentation by:
- Fixing typos and grammar
- Adding examples
- Improving clarity
- Updating outdated information
Project Structure
Understanding the project structure will help you contribute effectively:
nox/
├── master/ # Main API server (Node.js/TypeScript)
│ ├── src/ # Source code
│ ├── tests/ # Unit tests
│ └── prisma/ # Database schema
├── front/ # Frontend application (Next.js)
│ ├── src/ # React components and pages
│ └── public/ # Static assets
├── doc/ # Documentation (Fumadocs)
│ ├── content/ # MDX documentation files
│ └── src/ # Documentation app source
├── relay/ # Relay server (C#)
│ └── NoxRelay/ # C# project files
└── runtime/ # Runtime components (C#)
└── Assets/ # Game assets and modsCoding Standards
TypeScript/JavaScript
- Use TypeScript for all new code
- Follow ESLint and Prettier configurations
- Use meaningful variable and function names
- Add type annotations for public APIs
- Write JSDoc comments for exported functions
/**
* Authenticates a user with email and password
* @param email - User's email address
* @param password - User's password
* @returns Promise resolving to authentication token
*/
export async function authenticateUser(
email: string,
password: string
): Promise<string> {
// Implementation
}C#
- Follow Microsoft C# coding conventions
- Use meaningful names for classes and methods
- Add XML documentation comments
- Handle exceptions appropriately
/// <summary>
/// Handles incoming TCP connections for the relay server
/// </summary>
/// <param name="client">The TCP client connection</param>
/// <returns>Task representing the async operation</returns>
public async Task HandleClientAsync(TcpClient client)
{
// Implementation
}Testing
Writing Tests
- Write unit tests for new functionality
- Use descriptive test names
- Test both success and error cases
- Mock external dependencies
describe('UserService', () => {
it('should authenticate user with valid credentials', async () => {
// Test implementation
});
it('should throw error for invalid credentials', async () => {
// Test implementation
});
});Running Tests
# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Run tests with coverage
npm run test:coverageDocumentation
Writing Documentation
- Use clear, simple language
- Include code examples
- Add screenshots for UI features
- Keep examples up to date
Building Documentation
cd doc
npm run build
npm run dev # For developmentRelease Process
Releases are handled by maintainers, but contributors should:
- Update version numbers in package.json files
- Update CHANGELOG.md with new features and fixes
- Tag releases following semantic versioning
Getting Help
If you need help contributing:
- Check existing issues for similar problems
- Ask questions in GitHub discussions
- Join our Discord for real-time help
- Review existing code for examples
Recognition
Contributors are recognized in:
- README.md contributor list
- Release notes for significant contributions
- Special mentions in community updates
Thank you for contributing to Nox! 🚀