Getting Started
Before you start working on a contribution, check the issues page. It’s possible someone else is already working on something similar, or perhaps there is a reason that feature isn’t implemented. The maintainers will point you in the right direction.If you have questions, join the Discord server to chat with the community and maintainers.
Development Setup
Fork the Repository
Fork the En Croissant repository on GitHub to your account.
Create a Feature Branch
Create a new branch off the Use a descriptive branch name like
master branch:fix-database-search or add-dark-theme.Development Commands
Here are the key commands you’ll use during development:pnpm i
Installs all dependencies. Run this after cloning or when pulling new changes.
pnpm dev
Starts the app in development mode to see changes in real time. This launches:
- Vite development server with hot module replacement
- Tauri window with the application
- Automatic recompilation on file changes
pnpm test
Runs all tests, generating a report. En Croissant uses Vitest for unit testing.
pnpm format
Formats the project according to the project guidelines using Biome:
pnpm lint:fix
Lints the project according to the project guidelines and auto-fixes issues:
pnpm build
Builds the entire app from source. The built app can be found at src-tauri/target/release/:
Code Style Guidelines
TypeScript
- Use TypeScript for all new code
- Enable strict mode - The project uses strict TypeScript settings
- Prefer type inference - Let TypeScript infer types when possible
- Use interfaces for object shapes
- Avoid
any- Useunknownif you must have a dynamic type
React
- Use functional components with hooks
- Prefer composition over complex prop drilling
- Use Jotai atoms for shared state
- Memoize expensive computations with
useMemoanduseCallback
Rust
- Follow Rust conventions - Use
cargo fmtandcargo clippy - Handle errors properly - Return
Resulttypes from Tauri commands - Use async/await for I/O operations
- Document public APIs with doc comments
Formatting
En Croissant uses Biome for JavaScript/TypeScript formatting and linting:Internationalization (i18n)
En Croissant supports multiple languages. When adding user-facing text:Use Translation Keys
Extract Translation Strings
After adding translation keys, extract them:src/translation/.
Check Translation Status
Testing
En Croissant uses Vitest for unit testing.Writing Tests
Create test files alongside your code with.test.ts or .test.tsx extension:
Running Tests
Project Structure
Understanding the project structure helps you find where to make changes:Frontend (src/)
src/routes/- Page components (file-based routing)src/components/- Reusable UI componentssrc/state/- Jotai atoms and state managementsrc/utils/- Utility functionssrc/translation/- i18n translation filessrc/bindings/- Auto-generated TypeScript types from Rust
Backend (src-tauri/src/)
main.rs- Application entry point and Tauri setupchess.rs- Chess engine integrationdb/- Database operations and queriesengine/- UCI engine communicationgame.rs- Game state managementpgn.rs- PGN file parsing
Submitting a Pull Request
Implement Your Changes
Make your changes following the code style guidelines and development workflow.
Test Your Changes
Before submitting, build the app and test every feature you’ve contributed to:Test the built application in
src-tauri/target/release/.Create Pull Request
Go to the comparison page and select the branch you just pushed in the
compare: dropdown.Write a clear description of your changes:- What does this PR do?
- Why is this change needed?
- How does it work?
- Screenshots (if applicable)
Pull Request Guidelines
Good PR Practices
- Keep PRs focused - One feature or fix per PR
- Write clear commit messages - Explain what and why
- Add tests - If adding new functionality
- Update documentation - If changing behavior
- Include screenshots - For UI changes
- Test thoroughly - Ensure nothing breaks
PR Title Format
Use descriptive titles:feat: Add opening repertoire trainerfix: Resolve database search crash on empty querydocs: Update installation instructionsrefactor: Simplify engine communication logicperf: Optimize game list rendering
Code Architecture
En Croissant uses:- Rust for interacting with the filesystem, chess engines, and databases
- React with Vite (using TypeScript) for displaying the GUI
Where to Find Code
- Rust code:
src-tauri/src/ - React code:
src/
Communication
Asking Questions
If you need help:- Check existing issues
- Ask in Discord
- Comment on the relevant issue or PR
Reporting Bugs
When reporting bugs:- Check if the bug is already reported
- Provide steps to reproduce
- Include your OS and En Croissant version
- Add screenshots or error messages if applicable
Suggesting Features
- Check if the feature is already requested
- Describe the problem it solves
- Explain how it should work
- Provide mockups if applicable
Community
Join the En Croissant community:- Discord: discord.gg/tdYzfDbSSW
- GitHub Discussions: Share ideas and feedback
- Issue Tracker: Report bugs and request features