First, thank you for your interest in contributing! We welcome contributions from everyone in the community.
Please read and follow our Code of Conduct. By contributing, you agree to uphold these standards.
- Node.js 18 or higher (or Bun)
- Git
- PostgreSQL 14+
- Familiarity with Next.js, TypeScript, and React
-
Fork the repository
git clone https://github.com/YOUR_USERNAME/website.git cd website -
Add upstream remote
git remote add upstream https://github.com/NodeByteHosting/website.git
-
Install dependencies
npm install # or bun install -
Set up environment
cp .env.example .env.local # Edit .env.local with your local database URL and other config -
Set up database
npx prisma migrate dev
-
Start development server
npm run dev
Use clear, descriptive branch names following this format:
feature/short-description
bugfix/short-description
docs/short-description
refactor/short-description
test/short-description
Examples:
feature/webhook-supportbugfix/settings-save-errordocs/webhook-integration
- Keep commits focused - One logical change per commit
- Write descriptive commit messages - See below
- Test your changes - Run tests before pushing
- Update documentation - If you change functionality
- Update CHANGELOG - Add entry to
Unreleasedsection
Follow conventional commits:
type(scope): short description
Longer explanation if needed. Wrap at 72 characters.
- Bullet points for changes
- Keep it concise
Fixes #123
Types:
feat: A new featurefix: A bug fixdocs: Documentation changesstyle: Code style changes (no logic change)refactor: Code refactoringperf: Performance improvementstest: Test additions or changeschore: Build, CI, or dependency updates
Example:
feat(webhooks): add support for custom webhook types
- Add CUSTOM webhook type to enum
- Update dispatcher to handle custom embeds
- Add examples to integration guide
Closes #456
- Use strict TypeScript (
strict: true) - Export types explicitly
- Avoid
anytype - useunknownor generics - Write JSDoc comments for public APIs
/**
* Sends a webhook notification to Discord
* @param webhookUrl - Discord webhook URL
* @param embed - Discord embed object
* @returns Delivery result with success status
*/
export async function sendWebhook(
webhookUrl: string,
embed: DiscordEmbed
): Promise<{ success: boolean; error?: string }> {
// ...
}- Use functional components with hooks
- Keep components focused and reusable
- Use TypeScript for prop types
- Add comments for complex logic
interface ButtonProps {
children: React.ReactNode
onClick: () => void
disabled?: boolean
variant?: "primary" | "secondary"
}
export function Button({
children,
onClick,
disabled = false,
variant = "primary",
}: ButtonProps) {
return (
<button
onClick={onClick}
disabled={disabled}
className={`btn btn-${variant}`}
>
{children}
</button>
)
}packages/core/lib/
├── [feature]/ or [feature].ts - Grouped by feature
├── utils.ts - Shared utilities
└── types.ts - Type definitions
app/api/[domain]/
└── [route]/route.ts - API endpoints by domain
camelCasefor variables and functionsPascalCasefor components and classesUPPER_SNAKE_CASEfor constants- Prefix private functions with
_(rarely needed in TypeScript) - Use descriptive names (avoid
data,temp,x)
try {
// Operation
} catch (error) {
console.error("[Feature] Failed to do something:", error)
return { success: false, error: String(error) }
}npm run test- Write tests for new features
- Include edge cases
- Keep tests focused on one thing
- Use descriptive test names
describe("dispatchWebhook", () => {
it("should send webhook to Discord", async () => {
// Arrange
const webhook = { url: "...", name: "test" }
// Act
const result = await dispatchWebhook(webhook, embed)
// Assert
expect(result.success).toBe(true)
})
it("should handle connection errors gracefully", async () => {
// Test error handling
})
})// GOOD: Explains why, not what
// Webhooks are sent asynchronously to avoid blocking requests
dispatchWebhook(...).catch(console.error)
// BAD: Obvious from code
// Set success to true
const success = true- Keep main README.md up to date
- Document new features with examples
- Include configuration options
- Link to detailed guides
/**
* Get system settings
*
* @endpoint GET /api/admin/settings
* @requires admin authentication
*
* @returns {Object} Settings object with:
* - pterodactylUrl: string
* - registrationEnabled: boolean
* - discordWebhooks: array
*
* @example
* const response = await fetch('/api/admin/settings')
* const settings = await response.json()
*/-
Update your branch
git fetch upstream git rebase upstream/master
-
Test everything
npm run lint npm run type-check npm run test npm run build -
Clean up commits
- Squash related commits if needed
- Reorder for logical flow
- Remove WIP commits
Use this template:
## Description
Brief summary of what this PR does.
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
## Related Issues
Fixes #(issue number)
## Changes Made
- Change 1
- Change 2
## Testing
- [ ] Added/updated tests
- [ ] Manually tested locally
- [ ] Tested in production environment
## Screenshots (if applicable)
Add screenshots for UI changes
## Checklist
- [ ] Code follows style guidelines
- [ ] Self-review completed
- [ ] Comments added for complex logic
- [ ] Documentation updated
- [ ] No new warnings generated
- [ ] Tests pass locally- At least one maintainer review required
- All CI checks must pass
- No conflicts with base branch
- Approved before merging
Be responsive to feedback - We may ask for changes to maintain code quality and consistency.
We follow Semantic Versioning:
MAJOR.MINOR.PATCH(e.g., 3.2.0)- MAJOR: Breaking changes
- MINOR: New features (backward compatible)
- PATCH: Bug fixes
- Update version in
package.json - Update
CHANGELOG.mdwith all changes - Create release commit:
chore: release v3.2.0 - Tag commit:
git tag v3.2.0 - Push tag to trigger release workflow
By contributing, you agree that your code will be licensed under the GPL-3.0-only license. See LICENSE for details.
- 💬 Discord: https://discord.gg/nodebyte
- 📧 Email: hello@nodebyte.host
- 📚 Docs: Check
/docsfolder for detailed guides - 🐛 Issues: Search existing issues before creating new ones
Your contributions help make NodeByte Hosting better for everyone. We appreciate your time and effort!
Questions? Open an issue or ask in our Discord community!