Contributing
Thank you for your interest in contributing to Loggator! This guide will help you get started.
Ways to Contribute
Section titled “Ways to Contribute”🐛 Report Bugs
Section titled “🐛 Report Bugs”Found a bug? Please open an issue:
- Search existing issues first
- Create a new issue with:
- Clear title
- Steps to reproduce
- Expected vs actual behavior
- Environment details (OS, Docker version, etc.)
- Screenshots if applicable
💡 Suggest Features
Section titled “💡 Suggest Features”Have an idea for improvement?
- Check existing feature requests
- Open a new issue with:
- Clear use case
- Proposed solution
- Alternative approaches considered
- Any implementation ideas
📝 Improve Documentation
Section titled “📝 Improve Documentation”Documentation improvements are always welcome:
- Fix typos or unclear explanations
- Add missing examples
- Improve API documentation
- Add tutorials or guides
🔧 Submit Code
Section titled “🔧 Submit Code”Ready to write code? Great!
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
Development Setup
Section titled “Development Setup”See Local Development Setup for detailed instructions.
Quick start:
# Clone your forkgit clone https://github.com/YOUR_USERNAME/loggator.gitcd loggator
# Install dependenciesbun install
# Start dev environmentbun run dev:services # Terminal 1bun run dev # Terminal 2Code Guidelines
Section titled “Code Guidelines”TypeScript
Section titled “TypeScript”Always use TypeScript with proper types:
// ✅ Good - Typed parameters and returnasync function searchLogs(params: SearchParams): Promise<SearchResult> { // ...}
// ❌ Bad - Any typesasync function searchLogs(params: any): Promise<any> { // ...}Code Style
Section titled “Code Style”We use Prettier for formatting:
# Format all filesbun run format
# Check formattingbun run lintKey style points:
- Use tabs for indentation
- Single quotes for strings
- Trailing commas
- Semicolons
Component Structure
Section titled “Component Structure”Svelte components should follow this structure:
<script lang="ts"> // 1. Imports import { Component } from '$lib/components';
// 2. Types/Interfaces interface Props { data: string; }
// 3. Props let { data }: Props = $props();
// 4. State let count = $state(0);
// 5. Derived state let doubled = $derived(count * 2);
// 6. Functions function handleClick() { count++; }
// 7. Effects $effect(() => { console.log('count changed'); });</script>
<!-- 8. Template --><div> {data}</div>
<!-- 9. Styles (if needed) --><style> div { padding: 1rem; }</style>File Naming
Section titled “File Naming”- Components: PascalCase (e.g.,
LogViewer.svelte) - Utilities: kebab-case (e.g.,
log-aggregator.ts) - Routes: SvelteKit conventions (e.g.,
+page.svelte)
Git Workflow
Section titled “Git Workflow”Branch Names
Section titled “Branch Names”Use descriptive branch names:
- Features:
feature/add-log-export - Bugs:
fix/chat-timeout-error - Docs:
docs/improve-api-reference - Refactor:
refactor/simplify-indexer
Commit Messages
Section titled “Commit Messages”Write clear commit messages:
# ✅ Goodgit commit -m "Add log export feature"git commit -m "Fix chat API timeout handling"git commit -m "Update API documentation with examples"
# ❌ Badgit commit -m "update"git commit -m "fix bug"git commit -m "changes"Format:
<type>: <description>
[optional body]
[optional footer]Types:
feat:New featurefix:Bug fixdocs:Documentation onlystyle:Formatting changesrefactor:Code refactoringtest:Adding testschore:Maintenance tasks
Example Commit
Section titled “Example Commit”feat: Add log export to CSV
Implements CSV export functionality for search results.Users can now download filtered logs as CSV files.
Closes #123Pull Request Process
Section titled “Pull Request Process”Before Submitting
Section titled “Before Submitting”-
Update from main:
Terminal window git checkout maingit pull upstream maingit checkout your-branchgit rebase main -
Test your changes:
Terminal window bun run check # Type checkingbun run lint # Lintingbun run format # Formatting -
Test manually:
- Start dev environment
- Test affected features
- Check for console errors
Submitting
Section titled “Submitting”-
Push to your fork:
Terminal window git push origin your-branch -
Open PR on GitHub
-
Fill out PR template:
- Description of changes
- Related issues
- Testing performed
- Screenshots (if UI changes)
PR Template
Section titled “PR Template”## Description
Brief description of what this PR does.
## Type of Change
- [ ] Bug fix- [ ] New feature- [ ] Breaking change- [ ] Documentation update
## Related Issues
Closes #123
## Testing
- [ ] Manual testing performed- [ ] Type checking passed- [ ] Linting passed
## Screenshots (if applicable)
Add screenshots hereCode Review
Section titled “Code Review”What We Look For
Section titled “What We Look For”- Correctness: Does it work as intended?
- Code Quality: Is it readable and maintainable?
- Type Safety: Are types used properly?
- Performance: Any performance concerns?
- Security: Any security implications?
- Documentation: Is it well documented?
Addressing Feedback
Section titled “Addressing Feedback”- Make requested changes
- Commit and push
- Respond to comments
- Request re-review
Getting Approved
Section titled “Getting Approved”PRs need:
- ✅ All checks passing
- ✅ At least one approval
- ✅ No merge conflicts
- ✅ Documentation updated (if needed)
Testing Guidelines
Section titled “Testing Guidelines”Manual Testing
Section titled “Manual Testing”For all PRs:
- Start dev environment
- Test your feature/fix
- Test related features
- Check different browsers (if UI)
- Check mobile (if UI)
Common scenarios:
- Test with empty state (no logs/containers)
- Test with error conditions
- Test with large datasets
- Test edge cases
API Testing
Section titled “API Testing”Use curl or Postman:
# Test endpointcurl "http://localhost:5173/api/your-endpoint"
# With parameterscurl "http://localhost:5173/api/logs/search?query=test&limit=10"
# POST requestcurl -X POST http://localhost:5173/api/chat \ -H "Content-Type: application/json" \ -d '{"messages":[{"role":"user","content":"test"}]}'Documentation
Section titled “Documentation”When to Update Docs
Section titled “When to Update Docs”Update documentation for:
- New features
- Changed behavior
- New API endpoints
- New configuration options
- Breaking changes
Documentation Location
Section titled “Documentation Location”- User Docs:
loggator-web/src/content/docs/ - Code Comments: Inline in source files
- README:
loggator/README.md
Writing Style
Section titled “Writing Style”- Clear and concise
- Examples for everything
- Use code blocks with syntax highlighting
- Add screenshots for UI features
- Link related pages
Community Guidelines
Section titled “Community Guidelines”Code of Conduct
Section titled “Code of Conduct”Be respectful and constructive:
- 🤝 Be welcoming and inclusive
- 💬 Use clear communication
- 🎯 Stay on topic
- 🙏 Be patient with others
- ❤️ Show empathy
Getting Help
Section titled “Getting Help”Need help?
- 📖 Read the documentation
- 🐛 Check existing issues
- 💬 Ask in discussions
- 📧 Contact maintainers
Recognition
Section titled “Recognition”Contributors are recognized in:
- GitHub contributors page
- Release notes (for significant contributions)
- Special thanks in documentation
License
Section titled “License”By contributing, you agree that your contributions will be licensed under the project’s license (see LICENSE file).
Questions?
Section titled “Questions?”Have questions about contributing?
- Open a discussion
- Comment on an existing issue
- Reach out to maintainers
Next Steps
Section titled “Next Steps”Ready to contribute?
Thank you for contributing to Loggator! 🎉