Contributing - PlugImt/transat-app GitHub Wiki

Contributing to Transat 2.0

🤝 Welcome Contributors

Thank you for your interest in contributing to Transat 2.0! This document provides guidelines and information for contributors to ensure a smooth collaboration process.

👥 Development Team

Core Team

Organization

Plug'IMT is a student-created association at IMT Atlantique, independent from the school itself.

🚀 Getting Started

Prerequisites

Before contributing, ensure you have:

  1. Development Environment: Node.js 18+, npm, Git
  2. Mobile Setup: Expo Go app installed on your device
  3. Code Editor: VS Code recommended with extensions:
    • React Native Tools
    • ES7+ React/Redux/React-Native snippets
    • Prettier
    • TypeScript

Setup Process

  1. Fork the Repository

    # Fork on GitHub, then clone your fork
    git clone https://github.com/YOUR_USERNAME/Transat.git
    cd Transat
  2. Install Dependencies

    npm install --legacy-peer-deps
  3. Environment Configuration

    cp .env.example .env
    # Configure your local environment variables
  4. Start Development Server

    npx expo start --tunnel --clear
  5. Verify Setup

    • Scan QR code with Expo Go
    • Ensure app loads without errors
    • Test basic navigation

📋 Development Guidelines

Code Standards

TypeScript Requirements

  • All new code must be written in TypeScript
  • Proper type definitions for all interfaces and functions
  • No any types without explicit justification
  • Use strict type checking
// ✅ Good
interface User {
  id: string;
  name: string;
  email: string;
}

const fetchUser = async (id: string): Promise<User> => {
  // Implementation
};

// ❌ Avoid
const fetchUser = async (id: any): Promise<any> => {
  // Implementation
};

React Component Standards

  • Use functional components with hooks
  • Implement proper error boundaries
  • Follow atomic design principles
  • Use React.memo for performance optimization when needed
// ✅ Good Component Structure
interface Props {
  title: string;
  onPress: () => void;
  variant?: 'primary' | 'secondary';
}

export const Button: React.FC<Props> = ({ title, onPress, variant = 'primary' }) => {
  return (
    <TouchableOpacity 
      className={`px-4 py-2 rounded ${variant === 'primary' ? 'bg-blue-500' : 'bg-gray-300'}`}
      onPress={onPress}
    >
      <Text className="text-white font-medium">{title}</Text>
    </TouchableOpacity>
  );
};

Styling Guidelines

  • Use NativeWind (Tailwind) classes for styling
  • Follow mobile-first responsive design
  • Maintain consistent spacing using Tailwind scale
  • Support both light and dark themes
// ✅ Good Styling
<View className="flex-1 bg-white dark:bg-gray-900 p-4">
  <Text className="text-lg font-semibold text-gray-800 dark:text-white mb-4">
    Title
  </Text>
</View>

State Management

TanStack Query

  • Use for all server state management
  • Implement proper query keys
  • Handle loading and error states
  • Use optimistic updates where appropriate
// ✅ Good Query Implementation
export const useRestaurantMenu = (date?: string) => {
  return useQuery({
    queryKey: QUERY_KEYS.restaurantMenu(date),
    queryFn: () => restaurantService.getDailyMenu(date),
    staleTime: 30 * 60 * 1000,
    retry: 3,
  });
};

Jotai for Client State

  • Use atoms for client-side state
  • Keep atoms focused and specific
  • Implement proper atom composition
// ✅ Good Atom Usage
export const themeAtom = atom<'light' | 'dark'>('light');
export const userPreferencesAtom = atom({
  notifications: true,
  language: 'en',
});

Performance Guidelines

React Native Performance

  • Implement FlatList for large datasets
  • Use React.memo and useMemo appropriately
  • Optimize image loading and caching
  • Minimize bundle size

Network Performance

  • Implement proper caching strategies
  • Use background sync for critical data
  • Handle offline scenarios gracefully
  • Minimize API calls

🔄 Development Workflow

Branch Strategy

Branch Naming Convention

  • feature/feature-name - New features
  • fix/bug-description - Bug fixes
  • refactor/component-name - Code refactoring
  • docs/section-name - Documentation updates

Example Branch Names

feature/washing-machine-notifications
fix/restaurant-menu-loading
refactor/auth-components
docs/api-documentation

Commit Guidelines

Commit Message Format

type(scope): description

body (optional)

footer (optional)

Types

  • feat: New feature
  • fix: Bug fix
  • docs: Documentation changes
  • style: Code style changes
  • refactor: Code refactoring
  • test: Test additions or changes
  • chore: Build process or auxiliary tool changes

Examples

feat(auth): add biometric authentication support

fix(restaurant): resolve menu loading timeout issue

docs(api): update authentication endpoint documentation

refactor(components): extract common button variants

Pull Request Process

Before Submitting

  1. Code Quality: Run linting and formatting

    npm run lint
    npm run format
  2. Type Check: Ensure TypeScript compilation

    npm run check-types
  3. Testing: Run all tests

    npm test
  4. Build: Verify app builds successfully

    npx expo start --clear

Pull Request Template

## Description
Brief description of changes

## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update

## Testing
- [ ] Unit tests pass
- [ ] Integration tests pass
- [ ] Manual testing completed

## Screenshots (if applicable)
Include before/after screenshots for UI changes

## Checklist
- [ ] Code follows style guidelines
- [ ] Self-review completed
- [ ] Code is commented where necessary
- [ ] Documentation updated

Review Process

  1. Automated Checks: CI/CD pipeline runs automatically
  2. Code Review: At least one team member review required
  3. Testing: Reviewer tests on device/simulator
  4. Approval: Changes approved by core team member
  5. Merge: Squash and merge to main branch

🌍 Translation Contributions

Crowdin Platform

We use Crowdin for collaborative translation management.

Project Link: https://crowdin.com/project/transat

Translation Guidelines

  1. Context Understanding: Review screenshots and descriptions
  2. Consistency: Use established terminology
  3. Cultural Adaptation: Adapt content for local culture
  4. Length Considerations: Keep UI text concise

Supported Languages

  • English (source)
  • French (primary target)
  • Spanish, German, Portuguese, Chinese

Adding New Languages

To request a new language:

  1. Open an issue with language request
  2. Provide justification for user base
  3. Commit to translation maintenance

🐛 Bug Reporting

Issue Template

## Bug Description
Clear description of the bug

## Steps to Reproduce
1. Step one
2. Step two
3. Step three

## Expected Behavior
What should happen

## Actual Behavior
What actually happens

## Environment
- Device: iPhone 14 Pro / Android Galaxy S23
- OS Version: iOS 17.0 / Android 13
- App Version: 2.0.0
- Expo Go Version: 50.0.0

## Screenshots/Videos
Include visual evidence if applicable

## Additional Context
Any other relevant information

Bug Priority Levels

  • Critical: App crashes, security issues
  • High: Major functionality broken
  • Medium: Minor functionality issues
  • Low: UI/UX improvements, typos

✨ Feature Requests

Feature Request Template

## Feature Description
Clear description of the proposed feature

## Problem Statement
What problem does this solve?

## Proposed Solution
How should this be implemented?

## Alternative Solutions
Other approaches considered

## User Stories
- As a [user type], I want [functionality] so that [benefit]

## Acceptance Criteria
- [ ] Criterion 1
- [ ] Criterion 2

## Priority
Low / Medium / High

## Additional Context
Mockups, research, related issues

📚 Documentation

Documentation Standards

  • Use clear, concise language
  • Include code examples
  • Provide visual aids when helpful
  • Keep documentation up-to-date

Documentation Types

  • API Documentation: Endpoint specifications
  • Component Documentation: Usage examples
  • User Guides: Feature explanations
  • Development Guides: Setup and workflow

🏆 Recognition

Contributor Recognition

  • Contributors listed in README
  • Special thanks in release notes
  • Optional social media shoutouts
  • Conference presentation opportunities

Contribution Types

  • Code contributions
  • Bug reports and testing
  • Documentation improvements
  • Translation work
  • UI/UX design feedback

📞 Communication

Discord Server

Join our Discord for real-time communication:

  • Development discussions
  • Question and answers
  • Feature planning
  • Community events

GitHub Discussions

Use GitHub Discussions for:

  • Feature proposals
  • Architecture discussions
  • General questions
  • Community feedback

Meeting Schedule

  • Weekly Standup: Mondays 18:00 CET
  • Sprint Planning: Every two weeks
  • Retrospectives: End of each sprint

📄 License

By contributing to Transat 2.0, you agree that your contributions will be licensed under the MIT License.

🙏 Thank You

Every contribution, no matter how small, helps make Transat better for the IMT Atlantique community. We appreciate your time and effort!


Questions? Feel free to reach out to the team or open a discussion on GitHub.

⚠️ **GitHub.com Fallback** ⚠️