Development
Contributing
Set up the repo locally, run the dev server, and submit changes.
This page helps you get a local dev environment running and explains how to contribute to MinTranslate.
Prerequisites
- Bun installed
- A modern browser (for UI testing)
Local setup
# 1) Clone
git clone <repo-url>
cd <repo-dir>
# 2) Install deps
bun install
# 3) Start dev server
bun run devThen open http://localhost:3000.
Useful scripts
bun run dev: start Vite dev server (port3000)bun run build: production buildbun run preview: preview production build locallybun run test: run Vitestbun run lint/bun run format/bun run check: Biome lint/format/check
Project structure (quick map)
src/: application code (React + TanStack Router/Start)src/routes/: file-based routes (UI routes and server handlers insrc/routes/api/)src/components/: shared UI components (src/components/ui/contains UI primitives)src/stores/: client state (TanStack Store)src/db/: local persistence (TanStack React DB / localStorage + IndexedDB)src/locales/: i18n dictionaries (e.g.en.ts,zh.ts)src/lib/: utilities and helpers
content/docs/: documentation (MDX, Fumadocs)public/: static assets
Generated/ignored (don’t commit): .tanstack/, .output/, .source/, dist/
Code style & conventions
- TypeScript is
strict: avoidanyand keep types explicit at module boundaries. - Biome is the source of truth for formatting (tabs + double quotes).
- Prefer path-alias imports:
@/…maps tosrc/…. - Don’t edit generated files (notably
src/routeTree.gen.ts).
Working on docs
- Docs live in
content/docs/as*.mdx. - Most pages have both English and Chinese versions:
page.mdxandpage.zh.mdx.- If you update one, please update the other, keeping structure and links in sync.
Security / privacy notes for contributors
- Never commit API keys or secrets.
- Provider keys are configured in-app and stored in browser
localStorage(local to your browser/device).
Submitting changes
Recommended workflow:
- Create a new branch for your change.
- Keep changes small and focused.
- Run
bun run testand (if relevant)bun run build. - Open a PR with:
- a short description
- steps to verify (e.g.
bun run dev) - screenshots for UI changes