Thank you for your interest in contributing to JMAP Webmail! This document provides guidelines and information for contributors.
-
Fork and clone the repository:
git clone https://github.com/root-fr/jmap-webmail.git cd jmap-webmail -
Install dependencies:
npm install
-
Set up environment:
cp .env.example .env.local # Edit .env.local with your JMAP server URL -
Start development server:
npm run dev
Before submitting a pull request, ensure your code passes all checks:
# Type checking
npm run typecheck
# Linting
npm run lint
# Fix lint issues automatically
npm run lint:fixThese checks run automatically on commit via Husky pre-commit hooks.
- Use TypeScript for all new code
- Define proper types and interfaces
- Avoid
anytypes when possible - Use meaningful variable and function names
- Use functional components with hooks
- Keep components focused and single-purpose
- Extract reusable logic into custom hooks
- Place components in appropriate directories under
/components
- Use Tailwind CSS utility classes
- Follow the existing design system
- Support both dark and light themes
- Use CSS variables for theme colors
This project uses next-intl for internationalization. Please follow these guidelines:
-
Never hardcode user-facing text - Always use translations:
const t = useTranslations('namespace'); return <div>{t('key')}</div>;
-
Translation file locations:
- English:
/locales/en/common.json - French:
/locales/fr/common.json
- English:
-
Namespace organization:
login.*- Login page stringssidebar.*- Sidebar navigationemail_list.*- Email list componentemail_viewer.*- Email viewer componentemail_composer.*- Email composercommon.*- Shared stringsnotifications.*- Toast/alert messagessettings.*- Settings page
-
Adding new strings:
- Add to both English and French translation files
- Use descriptive, hierarchical keys
- Keep translations consistent in tone
-
Locale-aware navigation:
router.push(`/${params.locale}/settings`);
-
Create a feature branch:
git checkout -b feature/your-feature-name
-
Make your changes following the code style guidelines
-
Test your changes thoroughly
-
Update translations if you added user-facing text
-
Run all checks:
npm run typecheck && npm run lint
-
Push your branch to your fork
-
Open a Pull Request with:
- Clear title describing the change
- Description of what was changed and why
- Screenshots for UI changes
- Reference to any related issues
Follow the conventional commits format:
feat:- New featuresfix:- Bug fixesdocs:- Documentation changesstyle:- Code style changes (formatting, etc.)refactor:- Code refactoringtest:- Adding or updating testschore:- Maintenance tasks
Examples:
feat: add email threading support
fix: resolve attachment download issue
docs: update README with keyboard shortcuts
jmap-webmail/
├── app/ # Next.js App Router pages
│ └── [locale]/ # Locale-aware routing
├── components/ # React components
│ ├── email/ # Email-related components
│ ├── layout/ # Layout components
│ ├── settings/ # Settings components
│ └── ui/ # Reusable UI components
├── contexts/ # React contexts
├── hooks/ # Custom React hooks
├── lib/ # Utilities and libraries
│ └── jmap/ # JMAP client implementation
├── locales/ # Translation files
│ ├── en/ # English translations
│ └── fr/ # French translations
└── stores/ # Zustand state stores
- Never commit sensitive data (API keys, passwords, etc.)
- Sanitize user input and email content
- Block external content by default for privacy
- Report security vulnerabilities privately
If you have questions about contributing, feel free to:
- Open an issue for discussion
- Check existing issues and pull requests
Thank you for helping improve JMAP Webmail!