First off, thank you for considering contributing to ModelDock! It's people like you that make ModelDock a great tool for everyone.
- Fork the repository on GitHub.
- Clone your fork locally:
git clone https://github.com/yourusername/ModelDock.git cd ModelDock - Install dependencies:
npm install
- Create a new branch for your feature or bugfix:
git checkout -b feature/my-new-feature
ModelDock uses:
- Next.js (App Router)
- React and Tailwind CSS for the frontend
- Puppeteer for browser automation
- SQLite and Keytar for local secure storage
When writing code, please ensure you adhere to the existing code style. We use ESLint and Prettier for code formatting.
npm run lintHere is a high-level overview of the ModelDock codebase structure to help you navigate:
ModelDock/
├── app/ # Next.js App Router pages and API routes
│ ├── api/ # Backend API endpoints used by the frontend
│ ├── layout.tsx # Main application layout
│ └── page.tsx # Main chat interface entry point
├── components/ # Reusable React components
│ ├── chat/ # Chat UI components (messages, input, search)
│ ├── folders/ # Sidebar folder management UI
│ ├── layout/ # Global layout components (Sidebar, ChatArea)
│ └── settings/ # Settings modals and configuration UI
├── context/ # React Context providers for centralized state
├── hooks/ # Custom React hooks
├── lib/ # Core application logic and utilities
│ ├── puppeteer/ # Browser automation and LLM scraping logic
│ ├── utils/ # General utility functions
│ └── storage.ts # Database (SQLite) and secure credential (keytar) management
├── public/ # Static assets (images, fonts)
├── types/ # TypeScript type definitions and interfaces
└── package.json # Project dependencies and scripts
If you are adding support for a new LLM provider, you will generally need to:
- Add the provider URL to
PROVIDER_URLSinlib/puppeteer/browser-manager.ts. - Add the provider type to
LLMProviderintypes/index.ts. - Implement the specific DOM selectors and interaction logic to send messages and scrape responses for that provider.
- Update the UI components to show the newly supported provider.
- Ensure your code is well-tested and doesn't break existing provider integrations. Browser automation is fragile, so please test across different platforms if possible.
- Update the
README.mdwith details of changes to the interface or new providers added. - Submit a Pull Request targeting the
mainbranch. - Describe your changes clearly in the PR description, including what problem it solves and how you tested it.
By participating in this project, you agree to abide by our Code of Conduct. Please be respectful, welcoming, and collaborative.
Thank you for contributing!