English | 中文
Thank you for your interest in the Rote project! We welcome contributions of all kinds.
If you discover a bug, please:
- Check Issues to see if the issue already exists
- If not, create a new Issue with:
- A clear description of the bug
- Steps to reproduce
- Expected behavior vs actual behavior
- Environment information (OS, browser, version, etc.)
Important: If you discover a security vulnerability (especially high-risk vulnerabilities involving data breaches), please do not report it in a public Issue. Please follow the guidelines in SECURITY.md and report it via email or GitHub Security Advisory. Thank you very much.
We welcome feature suggestions! Please:
- Check if there are similar feature requests
- Create a Feature Request Issue describing:
- Use cases for the feature
- Why this feature would be valuable to users
- Consider whether the feature aligns with Rote's core characteristics
- Possible implementation approach (optional)
-
Fork the project (if contributing from external repository)
-
Create a feature branch from
developgit checkout develop git pull origin develop git checkout -b feature/amazing-feature
-
Write code following the project's code standards
-
Commit your changes following commit message conventions
git commit -m "feat: Add some amazing feature" -
Keep your branch up to date (sync with develop regularly)
git fetch origin git rebase origin/develop # or use merge: git merge origin/develop -
Push to your branch
git push origin feature/amazing-feature
-
Create a Pull Request targeting the
developbranch- Provide a clear description of your changes
- Reference related issues if applicable
- Ensure all checks pass (linting, tests, etc.)
Documentation improvements are equally important! You can:
- Fix spelling errors
- Improve document clarity
- Add missing documentation
- Translate documentation to other languages
- For backend API changes, synchronize updates to API documentation in the
docdirectory
Rote supports multiple languages, and we welcome translation contributions:
- Translation files are located in the
web/src/locales/directory - Currently supports Chinese (zh.json) and English (en.json)
- Please ensure you understand the language context you're contributing to, avoiding simple machine translations
- Runtime: Use Bun as the JavaScript runtime
- Package Management: Use
bun installto install dependencies andbun runto execute scripts - Code Quality: Follow ESLint configuration rules, run
bun run lintbefore committing - Comment Language: Use Chinese for code comments to facilitate team understanding
- Naming Conventions: Use English camelCase for variable and function names
- Code Organization: Avoid overly long files, keep each file under 200 lines
- Logic Simplification: Prioritize simplified logic when implementing features, avoid over-complication
- Code Reuse: Reuse functions and components to reduce duplicate code
- Framework: Use Hono as the web framework
- Database: Use Drizzle ORM to operate PostgreSQL
- Route Organization: API routes v2, all placed in the
route/directory - Middleware: All middleware files are placed in the
middleware/directory - Utility Functions: Common utility functions are placed in the
utils/directory - Type Definitions: TypeScript type definitions are placed in the
types/directory
- Build Tool: Use Vite as the frontend build tool
- UI Components: Use Shadcn UI + Tailwind CSS to build interfaces
- Component Organization: Page-level components are placed in the
pages/directory, reusable components are placed in thecomponents/directory - State Management: Use
jotaifor state management - Network Requests: Use methods encapsulated in
web/src/utils/api.ts - Internationalization: Must consider internationalization support when implementing frontend features
- Tailwind CSS: Always use Tailwind v4, do not use v3
- Design Principles: Strictly follow RESTful API design principles
- Error Handling: Implement unified error handling mechanisms and standardized response formats
- Authentication: Use API Key-based security authentication mechanism
Rote uses a simplified Git Flow workflow suitable for collaborative development:
main (production-ready)
↑
develop (integration branch)
↑
feature/xxx (feature branches)
Branch Types:
main: Production-ready code. Only merged fromdevelopafter thorough testing.develop: Integration branch for ongoing development. All feature branches merge here.feature/xxx: Feature development branches. Created fromdevelopand merged back todevelop.
Branch Naming Conventions:
feature/xxx- New features (e.g.,feature/add-s3-region-config)bugfix/xxx- Bug fixes (e.g.,bugfix/fix-login-error)hotfix/xxx- Urgent production fixes (e.g.,hotfix/security-patch)refactor/xxx- Code refactoring (e.g.,refactor/optimize-api)
Workflow:
-
Create feature branch from
develop:git checkout develop git pull origin develop git checkout -b feature/your-feature-name
-
Develop and commit your changes
-
Keep your branch synchronized with
develop:git fetch origin git rebase origin/develop # or git merge origin/develop -
Push your branch and create a Pull Request targeting
develop -
After code review and approval, merge to
develop -
When ready for release, merge
developtomain
Important Notes:
- Never commit directly to
mainordevelopbranches - Always create a feature branch for new work
- Keep feature branches focused on a single feature or fix
- Regularly sync your branch with
developto avoid conflicts - Use descriptive branch names that clearly indicate the purpose
-
Clone the project
git clone https://github.com/Rabithua/Rote.git cd Rote -
Install dependencies
# Backend cd server bun install # Frontend cd web bun install
-
Configure environment variables
-
Backend: Create a
.envfile in theserver/directory and configure the database connection:# Local development database connection string POSTGRESQL_URL=postgresql://rote:rote_password_123@localhost:5433/rotePOSTGRESQL_URLis a PostgreSQL database connection string with the format:postgresql://username:password@host:port/database -
Frontend: Configure
VITE_API_BASEenvironment variable (optional, defaults tohttp://localhost:18000)
-
-
Start development database
Use Docker to start a local PostgreSQL database:
cd server bun run db:startThis will start a Docker container named
rote-postgres-localwith the following database configuration:- User:
rote - Password:
rote_password_123 - Database:
rote - Port:
5433
If you need to reset the database, you can use:
bun run db:reset
- User:
-
Run database migrations
On first startup, you need to run database migrations. Choose based on your needs:
Method 1: Use migration files (Recommended for initial setup)
cd server bun run db:migrate:programmaticOr use drizzle-kit CLI:
bun run db:migrate
Method 2: Quick schema sync (For rapid iteration during development)
bun run db:push
Note:
db:pushdirectly syncs the schema to the database without generating migration files, suitable for rapid iteration in development environments. Production environments should use migration files. -
Start development servers
# Backend cd server bun run dev # Frontend cd web bun run dev
We follow Conventional Commits specification. Commit messages should clearly describe the changes in English:
Format:
<type>: <subject>
[optional body]
[optional footer]
Types:
feat: Add a new featurefix: Fix a bugdocs: Documentation changes onlystyle: Code style changes (formatting, missing semicolons, etc.)refactor: Code refactoring without changing functionalityperf: Performance improvementstest: Add or update testschore: Build process, tooling, or dependency updatesci: CI/CD configuration changes
Examples:
feat: add S3 region configuration support
fix: resolve login authentication error
docs: update API documentation for user endpoints
refactor: optimize database query performance
test: add unit tests for storage configurationBest Practices:
- Use imperative mood ("add" not "added" or "adds")
- Keep the subject line under 50 characters
- Capitalize the first letter of the subject
- Do not end the subject with a period
- Use the body to explain what and why vs. how
-
Before creating a PR:
- Ensure your branch is up to date with
develop - Run all tests and linting checks
- Verify your changes work as expected
- Ensure your branch is up to date with
-
PR Description should include:
- Clear description of changes
- Related issue numbers (if applicable)
- Screenshots (for UI changes)
- Testing instructions
- Breaking changes (if any)
-
Code Review:
- Address all review comments
- Keep discussions constructive
- Update your PR based on feedback
-
After approval:
- Maintainers will merge your PR
- Your feature will be included in the next release
Before submitting a PR, please ensure:
- Code passes ESLint checks:
bun run lint - Code builds successfully:
- Backend:
cd server && bun run build - Frontend:
cd web && bun run build
- Backend:
- Features work correctly
- No existing functionality is broken
- Responsive layout testing: If frontend UI changes are involved, please test at different screen sizes:
- Mobile (phone): 320px - 768px
- Tablet: 768px - 1024px
- Desktop: 1024px and above
- Ensure the interface displays correctly on different devices without layout issues or element overflow
If you encounter any issues during contribution, you can:
- Ask questions in Issues
- Check project documentation for more information
Thank you again for contributing to the Rote project!