Welcome Contributors!
Thank you for your interest in contributing to OmniSearches! This guide will help you get started with development, understand our workflow, and submit your contributions.Getting Started
Prerequisites
Ensure you have the following installed:Node.js (v18+)
Node.js (v18+)
Download from nodejs.org or use a version manager like nvm:
npm or yarn
npm or yarn
Comes with Node.js. Verify installation:
Git
Git
Required for version control:
API Keys
You’ll need API keys for development:-
Google Gemini API Key
- Sign up at Google AI Studio
- Create a new API key
- Free tier available
-
OpenRouter API Key
- Sign up at OpenRouter
- Get API key from dashboard
- Free models available (Deepseek)
Development Setup
1. Fork and Clone
2. Install Dependencies
package.json including:
- React and related libraries
- Express.js and backend dependencies
- TypeScript and build tools
- UI component libraries
3. Environment Configuration
Create a.env file in the root directory:
4. Start Development Server
- Express backend on port 3000
- Vite dev server with HMR
- Both frontend and backend in one process
5. Verify Setup
Open your browser to:Project Structure
Understanding the codebase organization:Development Workflow
Making Changes
-
Create a branch
-
Make your changes
- Write clean, readable code
- Follow existing code style
- Add comments for complex logic
-
Test your changes
-
Commit your changes
Commit Message Convention
We follow conventional commits:feat:- New featurefix:- Bug fixdocs:- Documentation changesstyle:- Code style changes (formatting, etc.)refactor:- Code refactoringtest:- Adding or updating testschore:- Maintenance tasks
Testing
Before submitting:Manual Testing
Test your changes in the browser:
- Home page loads correctly
- Search functionality works
- No console errors
- UI looks correct on different screen sizes
Code Style Guidelines
TypeScript
- Use TypeScript for all new code
- Define interfaces for complex objects
- Avoid
anytypes when possible - Use type inference where appropriate
React Components
- Use functional components with hooks
- Keep components small and focused
- Extract reusable logic into custom hooks
- Use TypeScript for props
CSS/Tailwind
- Use Tailwind utility classes
- Follow mobile-first responsive design
- Extract repeated patterns into components
- Use CSS variables from theme
File Naming
- React components:
PascalCase.tsx(e.g.,SearchInput.tsx) - Utilities/hooks:
camelCase.ts(e.g.,useImageUpload.tsx) - Pages:
PascalCase.tsx(e.g.,Home.tsx,Search.tsx) - Constants:
UPPER_SNAKE_CASE
Adding Features
New UI Components
-
Using shadcn/ui
This adds the component to
client/src/components/ui/ -
Custom Components
Create in
client/src/components/:
New API Endpoints
Add toserver/routes.ts:
State Management
For UI state (Zustand):Internationalization
Adding new translations:-
Add to English (
client/public/locales/en/translation.json): - Add to other languages (zh, zh-HK, etc.)
-
Use in components:
Database Changes
If working with the database:-
Update schema (
db/schema.ts): -
Push changes:
Submitting Your Contribution
Pull Request Process
-
Push your branch
-
Create Pull Request
- Go to GitHub repository
- Click “New Pull Request”
- Select your branch
- Fill out the PR template
-
PR Description Template
-
Code Review
- Address reviewer feedback
- Make requested changes
- Push updates to same branch
PR Guidelines
- Keep PRs focused and small
- Include descriptive commit messages
- Update documentation if needed
- Test thoroughly before submitting
- Respond to review comments promptly
Common Issues
TypeScript Errors
Issue: Type errors in code Solution:Port Already in Use
Issue: Port 3000 is already in use Solution:API Key Issues
Issue: API calls failing with authentication errors Solution:- Verify
.envfile exists in root directory - Check API keys are correct (no extra spaces)
- Restart dev server after changing
.env - Ensure environment variables are loaded in
server/env.ts
Build Failures
Issue: Production build fails Solution:Development Tips
Hot Reload
- Frontend changes reload automatically (Vite HMR)
- Backend changes require server restart
- To restart server:
Ctrl+Cthennpm run dev
Debugging
Frontend:- Use React DevTools browser extension
- Console logs in browser DevTools
- Inspect TanStack Query cache in DevTools
- Server logs printed to terminal
- Add
console.log()statements - Check request/response in Network tab
- Use tools like Postman or Thunder Client
- Test endpoints directly:
curl http://localhost:3000/api/search?q=test
Performance Profiling
Resources
Documentation
Component Libraries
Community
- GitHub Issues - Report bugs or request features
- GitHub Discussions - Ask questions and share ideas
Code of Conduct
Be Respectful
- Treat all contributors with respect
- Welcome newcomers and help them learn
- Provide constructive feedback
- Focus on the code, not the person
Be Professional
- Use clear, professional language
- Stay on topic in discussions
- Respect different opinions and approaches
- Credit others for their contributions
Be Collaborative
- Share knowledge and help others
- Ask questions when unsure
- Review PRs constructively
- Celebrate successes together
Recognition
Contributors are recognized in:- GitHub contribution graph
- Project README (significant contributions)
- Release notes
Questions?
If you have questions:- Check existing documentation
- Search GitHub issues
- Open a new issue with the “question” label
- Join community discussions