Thank you for your interest in contributing to LUMEN! This document provides guidelines and instructions for contributing to the project.
- Code of Conduct
- Getting Started
- Development Workflow
- Coding Standards
- Testing Guidelines
- Commit Guidelines
- Pull Request Process
- Bug Reports
- Feature Requests
We are committed to providing a welcoming and inspiring community for all. Please be respectful and constructive in your interactions.
- Use welcoming and inclusive language
- Be respectful of differing viewpoints
- Accept constructive criticism gracefully
- Focus on what is best for the community
- Show empathy towards other community members
# Click the "Fork" button on GitHub
# Then clone your fork
git clone https://github.com/YOUR_USERNAME/Lumen.git
cd LumenFollow the Setup Guide to install dependencies and configure your environment.
git checkout -b feature/your-feature-name
# or
git checkout -b fix/issue-number-descriptionBranch Naming Convention:
feature/- New featuresfix/- Bug fixesdocs/- Documentation updatesrefactor/- Code refactoringtest/- Test additions or modificationschore/- Maintenance tasks
cd frontend
npm run devKey Directories:
src/app/- Pages and routessrc/components/- React componentssrc/lib/- Utilities and helperssrc/hooks/- Custom React hooks
cd backend
source venv/bin/activate # or .\venv\Scripts\Activate.ps1 on Windows
python app.pyKey Directories:
routes/- API endpointsai/- AI agents and ML modelsmodels/- Database modelsutils/- Utility functions
# Frontend tests
cd frontend
npm test
# Backend tests
cd backend
pytest// Use TypeScript for type safety
interface InvoiceData {
id: number;
vendor: string;
amount: number;
}
// Use arrow functions for components
export const InvoiceCard: React.FC<InvoiceData> = ({ id, vendor, amount }) => {
return <div className="invoice-card">{/* Component content */}</div>;
};
// Use descriptive variable names
const totalSpendingAmount = calculateTotal(invoices);
// Add comments for complex logic
// Calculate spending trend using linear regression
const trend = calculateTrend(historicalData);Style Guidelines:
- Use 2 spaces for indentation
- Use single quotes for strings
- Add semicolons
- Max line length: 100 characters
- Use Prettier for formatting
"""Module docstring describing purpose"""
from typing import List, Dict, Any
class InvoiceProcessor:
"""Process invoice data and extract information.
Attributes:
api_key: API key for external services
max_retries: Maximum number of retry attempts
"""
def __init__(self, api_key: str, max_retries: int = 3):
self.api_key = api_key
self.max_retries = max_retries
def process_invoice(self, file_path: str, user_id: str) -> Dict[str, Any]:
"""Process a single invoice file.
Args:
file_path: Path to invoice file
user_id: User identifier
Returns:
Dictionary containing extracted invoice data
Raises:
ValueError: If file_path is invalid
ProcessingError: If extraction fails
"""
# Function implementation
passStyle Guidelines:
- Follow PEP 8
- Use 4 spaces for indentation
- Max line length: 100 characters
- Use type hints
- Add docstrings for all functions and classes
- Use Black for formatting
// Component test example
import { render, screen } from "@testing-library/react";
import { InvoiceCard } from "./InvoiceCard";
describe("InvoiceCard", () => {
it("renders invoice data correctly", () => {
const mockData = {
id: 1,
vendor: "TechCorp",
amount: 1000,
};
render(<InvoiceCard {...mockData} />);
expect(screen.getByText("TechCorp")).toBeInTheDocument();
expect(screen.getByText("$1,000.00")).toBeInTheDocument();
});
});import pytest
from app import app
@pytest.fixture
def client():
"""Create test client"""
app.config['TESTING'] = True
return app.test_client()
def test_extract_endpoint(client):
"""Test invoice extraction endpoint"""
response = client.post('/extract', data={
'file': (io.BytesIO(b'test'), 'invoice.pdf'),
'user_id': 'test_user'
})
assert response.status_code == 200
assert 'invoice_id' in response.jsonTesting Requirements:
- Write tests for new features
- Maintain test coverage above 80%
- Test edge cases and error conditions
- Use meaningful test names
- Mock external API calls
<type>(<scope>): <subject>
<body>
<footer>
Types:
feat- New featurefix- Bug fixdocs- Documentation changesstyle- Code style changes (formatting)refactor- Code refactoringtest- Test additions or modificationschore- Maintenance tasks
Examples:
feat(analytics): add spending forecast component
- Implement time-series forecasting with Prophet
- Add visualization with Recharts
- Include confidence intervals
Closes #123fix(ocr): handle multi-page PDF extraction
Fixed issue where only first page was processed.
Added proper page iteration logic.
Fixes #456- Use present tense ("add feature" not "added feature")
- Use imperative mood ("move cursor to..." not "moves cursor to...")
- First line should be 50 characters or less
- Reference issues and pull requests
- Separate subject from body with blank line
-
Update your branch
git fetch upstream git rebase upstream/main
-
Run tests
npm test # Frontend pytest # Backend
-
Check code style
npm run lint # Frontend black . # Backend
-
Update documentation if needed
-
Push to your fork
git push origin feature/your-feature-name
-
Create Pull Request on GitHub
-
Fill out PR template
- Description of changes
- Related issue numbers
- Screenshots (if UI changes)
- Testing performed
-
Wait for review
- Address reviewer feedback
- Update PR as needed
- Keep discussions constructive
## Description
Brief description of what this PR does
## Related Issues
Closes #123
Related to #456
## Changes
- Added X feature
- Fixed Y bug
- Refactored Z component
## Screenshots (if applicable)
[Add screenshots here]
## Testing
- [ ] Unit tests added/updated
- [ ] Integration tests pass
- [ ] Manual testing completed
## Checklist
- [ ] Code follows project style guidelines
- [ ] Self-review completed
- [ ] Comments added for complex code
- [ ] Documentation updated
- [ ] No new warnings generated- Check existing issues
- Update to latest version
- Try to reproduce consistently
**Describe the bug**
Clear description of what the bug is
**To Reproduce**
Steps to reproduce:
1. Go to '...'
2. Click on '...'
3. See error
**Expected behavior**
What you expected to happen
**Screenshots**
If applicable, add screenshots
**Environment:**
- OS: [e.g. Windows 11]
- Browser: [e.g. Chrome 120]
- Version: [e.g. 1.0.0]
**Additional context**
Any other relevant information**Is your feature request related to a problem?**
Clear description of the problem
**Describe the solution you'd like**
What you want to happen
**Describe alternatives you've considered**
Alternative solutions or features
**Additional context**
Mockups, examples, or other context
**Would you like to implement this?**
[ ] Yes
[ ] No
[ ] Need guidanceContributors will be recognized in:
- README.md contributors section
- Release notes
- Project documentation
- Discord: Join our server
- GitHub Discussions: Ask questions
- Email: team@dunder-pressure.dev
By contributing, you agree that your contributions will be licensed under the same license as the project.
Thank you for contributing to LUMEN! 🎉
Together, we're building something amazing.