Thank you for your interest in contributing to Lark. This guide covers everything you need to get started with the frontend codebase.
- Node.js 20 or later
- npm 10 or later
- A running Lark backend instance (default:
http://127.0.0.1:4001)
# Fork and clone the repository
git clone https://github.com/<your-username>/lark.git
cd lark/lark-web
# Install dependencies
npm install
# Start the dev server
npm run devThe app will be available at http://localhost:5173. API requests are proxied to the backend automatically.
-
Create a branch from
main:git checkout -b feat/your-feature
-
Make your changes. The dev server supports hot module replacement -- changes appear instantly.
-
Run the type checker before committing:
npx tsc --noEmit
-
Build to verify there are no production issues:
npm run build
-
Commit with a clear message following Conventional Commits:
feat: add keyboard shortcut for channel switching fix: prevent duplicate messages on reconnect docs: update environment variable table -
Push and open a pull request against
main.
- TypeScript strict mode is enabled. Avoid
any-- use proper types fromsrc/types/index.ts. - Functional components only. No class components.
- Tailwind CSS for all styling. No inline styles or CSS modules.
- Named exports for components. Default exports only at the route/page level.
- Keep components focused. If a file exceeds 200 lines, consider splitting it.
- Use custom hooks (
src/hooks/) for data fetching and side effects.
| Concern | Approach |
|---|---|
| State management | React useState / useReducer -- no external store yet |
| Data fetching | useApi hook wrapping fetch with Bearer token auth |
| Real-time updates | useWebSocket hook for server-push events |
| Routing | react-router-dom with workspace-scoped routes |
| Authentication | JWT or API key stored in localStorage |
| Error handling | ErrorBoundary component wraps the app |
- Keep PRs focused on a single change.
- Include a clear description of what changed and why.
- Add screenshots or recordings for UI changes.
- Ensure
npx tsc --noEmitandnpm run buildpass. - Link related issues using
Closes #123.
Use the bug report template. Include steps to reproduce, expected behavior, and your environment details.
Use the feature request template. Describe the problem you are trying to solve and your proposed solution.
Open a discussion on GitHub. We are happy to help.