A Next.js App Router project for discovering and submitting hackathon projects and ideas with full English / 简体中文 / 日本語 support.
- Multi-lingual UI powered by
next-intlwith locale-prefixed routes and a persistent language switcher. - Typed domain layer (Prisma + SQLite) and normalized API responses with error-code → i18n key mapping.
- Reusable UI building blocks (cards, forms, uploaders, filters) plus locale-aware formatting helpers.
- Zod-based validation for APIs and forms; lightweight tests for i18n helpers and error mapping.
- Next.js 16 (App Router) + React 19
- TypeScript, Zod
- Prisma ORM (SQLite dev DB)
- Tailwind CSS utility classes
- next-intl for i18n
.
└─ src/
├─ app/ # App Router pages (scoped by locale) and API routes
├─ components/ # UI components (cards, forms, uploaders, header/footer, switcher)
├─ domain/ # Prisma data access for projects, events, ideas, categories, users
├─ i18n/ # next-intl config and locale resources (en, zh-CN, ja-JP)
├─ lib/ # HTTP client and Prisma client
├─ types/ # Shared API/domain types
└─ utils/ # Formatting, navigation, error code mapping helpers
- Install dependencies
npm install
- Database
npx prisma db push
npx prisma db seed
- Run locally
npm run dev
Open http://localhost:3000/en (or /zh-CN, /ja-JP).
- Test
npm test
npm run dev— start Next.js in dev modenpm run build— production buildnpm start— run built appnpm run lint— lint with Next defaultsnpm test— run node tests (helpers/error mapping)
- Supported locales:
en,zh-CN,ja-JP. - Resources live in
src/i18n/locales/<locale>/common.jsonwith semantic keys (e.g.,page.home.title,error.project.notFound,form.project.submit). - Locale persistence: cookie
NEXT_LOCALE+ locale-prefixed routes; switch languages via the header switcher. - See
docs/i18n.mdfor adding languages/keys and naming conventions.
- API routes under
src/app/api/*return{ success: true, data }or{ success: false, error: { code, message } }. - Error codes map to translation keys via
src/utils/errorCodes.ts. - Domain data access lives in
src/domain/*and is shared by API handlers and server components. - Endpoint details and error tables:
docs/api.md.
MIT