Skip to content

SSR#2870

Draft
osamasayed wants to merge 20 commits intoproductionfrom
SSR-prod
Draft

SSR#2870
osamasayed wants to merge 20 commits intoproductionfrom
SSR-prod

Conversation

@osamasayed
Copy link
Member

No description provided.

osamasayed and others added 11 commits January 17, 2026 18:58
* fixed ssr on all pages with playwright tests

* fixed encoding problem

* applied copilot suggestions and fixed all verses fetch problem

* applied copilot suggestions
* Fix: Add SSR support for Quran in a Year section

* added playwright tests to verify elements on the homepage render when js is disabled

* fixed a test and removed useless comments

* Applied copilot and brother osama suggestions

* applied copilot suggestion

* re-used existing API
* fixed the first language switch that does not work because NEXT_LOCALE cookie isnt set for guest user

* fix tests that requires switching languages and signing up, as the UI has changed

* fixed some mocked data

* fixing some tests

* fixed some tests

* fixed a regression since new language switch UI (API settings were not being used but it was using mocked one)

* fixed all the remaining tests

* applied copilot suggestions
@osamasayed osamasayed changed the title SSR prod SSR Jan 20, 2026
@osamasayed
Copy link
Member Author

@zonetecde there are merge conflicts

zonetecde and others added 6 commits January 20, 2026 21:02
…SR branch (#2895)

* restaured all the sign-up/sign in logic from `SSR` branch

* applied copilot suggestions
* made reset button re-fetch default preferences

* applied copilot suggestions, added playwright tests, fixed a bug

* applied copilot suggestions
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements Server-Side Rendering (SSR) with intelligent default settings and localization for Quran.com. The changes migrate the application from Static Site Generation (SSG) to SSR to enable personalized content delivery based on user location and language preferences.

Changes:

  • Migrated 40+ pages from getStaticProps/getStaticPaths to getServerSideProps
  • Implemented withSsrRedux wrapper for SSR with Redux state hydration
  • Added intelligent locale detection and country-based default settings
  • Integrated user preference synchronization from server
  • Added SSR fallbacks with <noscript> tags for JavaScript-disabled scenarios
  • Integrated New Relic monitoring
  • Added comprehensive integration tests for SSR functionality

Reviewed changes

Copilot reviewed 146 out of 148 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/utils/withSsrRedux.ts New SSR wrapper that handles Redux state initialization and language detection
src/redux/Provider.tsx Updated to accept SSR-hydrated Redux state and country preferences
src/redux/store.ts Enhanced to support SSR state initialization with country preferences
src/utils/auth/syncPreferencesFromServer.ts New utility for syncing user preferences from backend
src/pages/**/*.tsx Migrated 40+ pages from SSG to SSR using withSsrRedux
types/ApiResponses.ts Added CountryLanguagePreferenceResponse type
src/api.ts Added getCountryLanguagePreference API function
Test files Added SSR-specific integration tests and updated existing tests
Configuration New Relic integration, webpack externals, MSW setup

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.

3 participants