Skip to content

feat: rebuild website with Next.js and add Hindi localization#4

Open
RajnishKMehta wants to merge 83 commits into
Arturo254:mainfrom
RajnishKMehta:feat/nextjs-migration
Open

feat: rebuild website with Next.js and add Hindi localization#4
RajnishKMehta wants to merge 83 commits into
Arturo254:mainfrom
RajnishKMehta:feat/nextjs-migration

Conversation

@RajnishKMehta

@RajnishKMehta RajnishKMehta commented Jun 10, 2026

Copy link
Copy Markdown

Summary

This pull request rebuilds the OpenTune website using Next.js while preserving the existing design and user experience. The project has been migrated from a static HTML implementation to a modern React and Next.js architecture, improving maintainability, scalability, and developer experience.

Hindi localization has also been added alongside the existing multilingual support.

preview

https://deploy-preview-1--opentune-nextjs.netlify.app/

Changes

  • Rebuild the website with Next.js 16 and React 19
  • Migrate from the previous static HTML implementation
  • Preserve the existing design and user experience with minor refinements
  • Add Hindi language support
  • Improve internationalization using next-intl
  • Introduce reusable React components
  • Implement styling with Tailwind CSS v4
  • Add Lucide icons and custom SVG icons where required
  • Improve project structure and code organization
  • Configure TypeScript, ESLint, Prettier, Husky, and lint-staged
  • Update metadata, localization, and build configuration

Tech Stack

  • Next.js 16
  • React 19
  • TypeScript
  • Tailwind CSS v4
  • next-intl
  • Lucide React
  • Custom SVG Icons

Notes

This is a major migration that replaces the previous HTML-based implementation with a modern Next.js codebase while maintaining the website's overall visual identity and functionality.

Closes #3

Set up the initial Next.js application structure.

- Configure Next.js, TypeScript and PNPM
- Add ESLint and Prettier configuration
- Set up App Router structure
- Add global styles and base layout
- Prepare project foundation for future migration

Legacy static site files will be removed in a separate commit.
Start the migration from the legacy static website to Next.js.

- Add App Router structure
- Add internationalization support
- Create reusable React components
- Move assets to public directory
- Add shared layouts and sections
- Configure project architecture for future features

Additional migration and cleanup work will follow in later commits.
- add proxy middleware for locale detection
- detect locale from NEXT_LOCALE cookie first
- fallback to Accept-Language header
- fallback to default locale when no match is found
- support share links using the  query parameter
- normalize redirect paths and remove locale prefixes
- redirect users to localized routes automatically
- configure middleware matcher for application routes
… support

- Replace Array.includes() with Set for O(1) locale membership checks
- Pre-compile LOCALE_PREFIX_RE regex at module level (executed once, not per-request)
- Add support for :lang placeholder (Cloudflare-style): ?go=:lang/path → detect locale and substitute
- Respect existing locale prefixes in ?go parameter without re-detection
  * ?go=/en/path → redirect to /en/path as-is
  * ?go=es/path → redirect to /es/path as-is
- Remove stripLocalePrefix helper (no longer needed)
- Minimize comments to essentials only
- All three ?go cases now handled with fast string checks, zero unnecessary allocations
Replace GPL template placeholders with project name and copyright holders.

OpenTune Web
Copyright (C) 2024 Arturo Cervantes
Copyright (C) 2026 Rajnish Kumar
- add centralized icon exports through @iCons
- add @icon/* path alias for direct icon imports
- create shared icon types and utilities
- add reusable icon base component
- implement Opentune custom icon
- support both themed and original (Mul) icon variants
- re-export Lucide icons from a single entry point
- improve icon consistency and developer experience
Create a new _template.tsx file in src/components/icons/ to serve as a guide for creating new icons, fully translated to English and including instructions on removing comments after use.
Modify the Opentune and MulOpentune components to utilize the useId hook for dynamic ID generation, ensuring unique IDs for clip paths and gradients to prevent rendering conflicts when multiple instances are present on a page.
- Replace Material Symbols with a centralized icon system
- Add custom brand icons (Opentune, Android, Windows)
- Update all UI components to use shared icons
- Remove legacy Material Symbols imports and global styles
- Improve icon type safety and maintainability
- Run Prettier formatting across the codebase
- Verify successful Next.js production build
Introduce a new MobileBottomNav component for consistent navigation across mobile views, replacing inline implementations in SupportClient and ContributorsClient
- Migrated typography to `next/font/google` (Epilogue and Lora).
- Replaced standard `<img>` tags with `next/image` for better performance and added necessary remote image patterns to `next.config.ts`.
- Eliminated `any` types in icon and translation components, replacing them with specific interfaces and utility types.
- Fixed circular CSS variable definitions for fonts and ensured the global background uses theme tokens.
- Standardized localization to English across `en.json` and `es.json`.
- Resolved linting warnings regarding unused variables.
- Added Husky pre-commit hook
- Configured lint-staged for staged files
- Run ESLint with auto-fix before commits
- Run Prettier formatting before commits
- Automatically re-stage modified files
@RajnishKMehta RajnishKMehta marked this pull request as draft June 10, 2026 20:59
RajnishKMehta and others added 4 commits June 10, 2026 21:23
- Updated RootPage to use dynamic defaultLocale from config.
- Implemented GitHub release proxy API routes with caching and token support.
- Updated ChangelogDialog and VersionsDialog to use internal API routes.
- Added 5s AbortSignal timeout to all GitHub fetch calls in lib.
- Fixed fetchTotalCommits to handle missing Link header cases.
- Exported shared navigation utilities from i18n/routing.ts.
- Updated Navbar to preserve the current path when switching languages.
@RajnishKMehta RajnishKMehta marked this pull request as ready for review June 11, 2026 04:33
@RajnishKMehta

Copy link
Copy Markdown
Author

Hi @Arturo254,

The Next.js migration is now complete and the PR is ready for review.

Preview: https://deploy-preview-1--opentune-nextjs.netlify.app

Could you please review and merge the PR if everything looks good?

After merging, the Netlify project will also need to be updated to use the new Next.js setup.

Build settings:

  • Runtime: Next.js
  • Build command: pnpm build
  • Publish directory: .next
Screenshot_20260610-211851

The website has been fully rebuilt with Next.js while preserving the existing design and functionality, and Hindi localization has also been added.

Thank you!

RajnishKMehta and others added 9 commits June 11, 2026 10:19
…_page

- Implemented fetchWithTimeout helper in src/lib/github.ts using AbortController.
- Updated /api/github/releases/latest to use fetchWithTimeout with a 5s timeout.
- Updated /api/github/releases to use fetchWithTimeout with a 5s timeout.
- Added sanitization and clamping (1-100) for the per_page query parameter in /api/github/releases.
- Verified changes with pnpm run lint and pnpm run build.
…middleware redirection

- Implemented `fetchWithTimeout` helper in `src/lib/github.ts` using `AbortController`.
- Updated GitHub API proxy routes to use `fetchWithTimeout` with a 5s timeout.
- Added sanitization and clamping (1-100) for `per_page` query parameter in `/api/github/releases`.
- Updated `src/proxy.ts` to skip internationalization for `/api` routes, fixing 404 errors in `ChangelogDialog` and `VersionsDialog`.
- Verified changes with local testing and `pnpm run build`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proposal: Hindi (hi) Translation for OpenTune Web

1 participant