Contributing to Ecosyz
Thank you for your interest in contributing to Ecosyz! This document provides guidelines and information for contributors.
๐ Getting Started
Prerequisites
- Node.js 18+
- pnpm package manager
- Git
- Supabase account (for full development)
Setup
-
Fork and Clone
-
Install Dependencies
-
Environment Setup
-
Database Setup
-
Start Development
๐ Development Workflow
Branch Strategy
main
- Production-ready codedevelop
- Integration branchfeature/*
- New featuresbugfix/*
- Bug fixeshotfix/*
- Critical fixes
Commit Convention
type(scope): description
# Examples:
feat(auth): add Google OAuth support
fix(api): resolve profile update error
docs(readme): update installation instructions
refactor(db): optimize query performance
Types:
- feat
- New features
- fix
- Bug fixes
- docs
- Documentation
- style
- Code style changes
- refactor
- Code refactoring
- test
- Testing
- chore
- Maintenance
Pull Request Process
-
Create Feature Branch
-
Make Changes
- Write clean, readable code
- Add tests for new features
- Update documentation
-
Follow existing code style
-
Test Your Changes
-
Commit Changes
-
Push and Create PR
๐ ๏ธ Code Quality Standards
TypeScript
- Strict Mode: All TypeScript rules enabled
- Type Safety: Avoid
any
types, use proper interfaces - Imports: Use absolute imports with
@/
prefix
React/Next.js
- App Router: Use new App Router patterns
- Server Components: Prefer server components when possible
- Client Components: Use
'use client'
directive when needed - Data Fetching: Use server actions or API routes
Styling
- Tailwind CSS: Use utility classes
- Design System: Follow established design patterns
- Responsive: Mobile-first approach
- Accessibility: ARIA labels, keyboard navigation
Code Style
// โ
Good
interface User {
id: string;
name: string;
email: string;
}
const getUser = async (id: string): Promise<User> => {
const user = await prisma.user.findUnique({ where: { id } });
if (!user) throw new Error('User not found');
return user;
};
// โ Avoid
const getuser = (id) => {
return prisma.user.findUnique({where:{id}})
}
๐งช Testing
Testing Strategy
- Unit Tests: Component and utility function testing
- Integration Tests: API route testing
- E2E Tests: Critical user journey testing
Running Tests
# Run all tests
pnpm test
# Run with coverage
pnpm test -- --coverage
# Run specific test
pnpm test -- component-name.test.ts
Writing Tests
// Component test example
import { render, screen } from '@testing-library/react';
import UserProfile from './UserProfile';
describe('UserProfile', () => {
it('displays user name', () => {
render(<UserProfile user={{ name: 'John Doe' }} />);
expect(screen.getByText('John Doe')).toBeInTheDocument();
});
});
๐ Documentation
Code Documentation
- Functions: JSDoc comments for complex functions
- Components: Prop types and usage examples
- APIs: OpenAPI/Swagger documentation
Project Documentation
- README: Keep updated with setup instructions
- API Docs: Document all endpoints
- Architecture: Update for major changes
๐ Security
Security Checklist
- [ ] No sensitive data in logs
- [ ] Input validation on all forms
- [ ] SQL injection prevention
- [ ] XSS protection
- [ ] CSRF protection
- [ ] Secure headers
- [ ] Dependency updates
Reporting Security Issues
- DO NOT create public issues for security vulnerabilities
- Email security concerns to: security@ecosyz.com
- Use GitHub Security Advisories for coordinated disclosure
๐ Deployment
Environment Variables
Required for all environments:
Production only:
Deployment Checklist
- [ ] All tests pass
- [ ] Linting passes
- [ ] Type checking passes
- [ ] Build succeeds
- [ ] Environment variables set
- [ ] Database migrations applied
- [ ] Feature flags configured
๐ค Code Review Guidelines
For Reviewers
- Be constructive: Focus on code quality and learning
- Explain reasoning: Why changes are needed
- Suggest alternatives: When rejecting approaches
- Approve readily: When standards are met
For Contributors
- Address feedback: Respond to all review comments
- Explain decisions: Document architectural choices
- Test thoroughly: Ensure changes don't break existing functionality
- Keep scope small: Large PRs are harder to review
๐ Issue Tracking
Issue Labels
bug
- Something isn't workingenhancement
- New feature or improvementdocumentation
- Documentation updatesgood first issue
- Ideal for newcomershelp wanted
- Extra attention needed
Issue Templates
- Bug Report: Includes reproduction steps
- Feature Request: Describes desired functionality
- Documentation: For docs improvements
๐ฏ Contributing Areas
High Priority
- Authentication: OAuth providers, security improvements
- Search Engine: New data sources, improved ranking
- AI Features: Better summarization, new capabilities
- Performance: Optimization and caching
Good for Beginners
- UI Components: New components following design system
- Documentation: Writing guides and examples
- Testing: Adding test coverage
- Bug Fixes: Resolving reported issues
Advanced
- Database: Schema optimization, new features
- API Design: New endpoints, GraphQL migration
- Infrastructure: Deployment, monitoring, scaling
๐ Getting Help
Communication Channels
- GitHub Issues: Bug reports and feature requests
- GitHub Discussions: General questions and ideas
- Discord: Real-time chat (if available)
Finding Help
- Check existing issues - Your issue might already be reported
- Search documentation - Many questions are answered in docs
- Create minimal reproduction - For bug reports
- Ask in discussions - For questions and ideas
๐ Recognition
Contributors are recognized through: - GitHub Contributors list - Changelog entries - Social media mentions - Community shoutouts
๐ License
By contributing to Ecosyz, you agree that your contributions will be licensed under the same license as the project.
Thank you for contributing to Ecosyz! Your efforts help make academic research more accessible and collaborative. ๐