feat: rebuild website with Next.js and add Hindi localization#4
Open
RajnishKMehta wants to merge 83 commits into
Open
feat: rebuild website with Next.js and add Hindi localization#4RajnishKMehta wants to merge 83 commits into
RajnishKMehta wants to merge 83 commits into
Conversation
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
Add error handling for fetching the latest release and default to 'latest' version.
Removed the latest release download link from external links.
Update download link logic to use finalDownloadUrl.
- 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.
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:
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! |
…_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`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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
Tech Stack
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