feat: analytics, mobile portfolio, branding, and dashboard hardening#4
Merged
Conversation
ashish200729
commented
Jun 6, 2026
Collaborator
- Add production-ready analytics: UTC date buckets, full chart series, referrer normalization/aggregation, growth tips with LinkedIn/X share
- Fix dashboard route guard: block child routes during redirect/loading, split user/profile load errors, gate analytics fetch on route readiness
- Rebuild public portfolio mobile UX: natural page scroll, compact profile header, sticky section nav, safe areas, and full text wrapping
- Rebrand assets to logo-2.png with regenerated favicons and OG updates
- Add CORS config for LAN dev and portlifyai.app production origins
- Expand test coverage (47 frontend + 41 backend tests passing)
- Add production-ready analytics: UTC date buckets, full chart series, referrer normalization/aggregation, growth tips with LinkedIn/X share - Fix dashboard route guard: block child routes during redirect/loading, split user/profile load errors, gate analytics fetch on route readiness - Rebuild public portfolio mobile UX: natural page scroll, compact profile header, sticky section nav, safe areas, and full text wrapping - Rebrand assets to logo-2.png with regenerated favicons and OG updates - Add CORS config for LAN dev and portlifyai.app production origins - Expand test coverage (47 frontend + 41 backend tests passing)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
ESLint failed in CI because scripts/*.mjs and vite.config.js use console/process without browser globals. Scope Node env to those files.
There was a problem hiding this comment.
Pull request overview
This PR upgrades Portlify’s analytics and onboarding/dashboard hardening while refreshing branding and improving the public portfolio mobile UX.
Changes:
- Add richer analytics UX (UTC bucketed chart series, improved referrer tracking/aggregation, and “Growth Tips” share helpers).
- Harden dashboard/onboarding routing and navigation gating based on profile setup state.
- Rebrand public assets/domain and improve mobile portfolio layout/scroll behavior + safe area handling.
Reviewed changes
Copilot reviewed 56 out of 67 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/vite.config.js | Adds env-based API target + dev proxy for /api. |
| frontend/src/utils/sharePosts.test.js | Adds test coverage for share content builders. |
| frontend/src/utils/sharePosts.js | Implements LinkedIn/X share text + tracked portfolio URLs. |
| frontend/src/utils/seo.js | Uses versioned OG image URL via brand constants. |
| frontend/src/utils/referrer.test.js | Adds unit tests for UTM/referrer tracking and display helpers. |
| frontend/src/utils/referrer.js | Adds client-side referrer capture helpers + icon/label mapping. |
| frontend/src/utils/profileSetup.test.js | Adds tests for setup gating + route guard behavior. |
| frontend/src/utils/profileSetup.js | Centralizes “resume/profile setup” gating logic for routes/nav. |
| frontend/src/utils/api.js | Adjusts API base URL resolution for LAN dev + Vite proxy usage. |
| frontend/src/utils/analyticsChart.test.js | Adds tests for UTC chart bucketing/labels/bar heights. |
| frontend/src/utils/analyticsChart.js | Adds UTC-normalized chart series and label/tooltip helpers. |
| frontend/src/portfolio/PortfolioTemplate.jsx | Reworks portfolio mobile scroll + section navigation behavior. |
| frontend/src/portfolio/portfolio.css | Adds mobile-first layout overrides, safe-area padding, sticky nav styles. |
| frontend/src/portfolio/components/TopBar.jsx | Makes top bar sticky on mobile with safe-area padding. |
| frontend/src/portfolio/components/SectionNav.jsx | Improves mobile section nav scrolling + fades/sizing. |
| frontend/src/portfolio/components/SectionContent.jsx | Improves text wrapping and touch targets for mobile. |
| frontend/src/portfolio/components/ProfileAside.jsx | Refactors profile header for mobile/desktop + compact social buttons. |
| frontend/src/portfolio/components/PortfolioScrollArea.jsx | Disables internal scroll/fades on mobile; keeps desktop scroll behavior. |
| frontend/src/portfolio/components/LoadingState.jsx | Uses dvh + safe-area padding. |
| frontend/src/portfolio/components/Footer.jsx | Adds safe-area bottom padding and improves toggle button a11y. |
| frontend/src/portfolio/components/ErrorState.jsx | Uses dvh + safe-area padding. |
| frontend/src/pages/UsernameSelection.jsx | Redirects users based on onboarding + profile setup completeness. |
| frontend/src/pages/ResumeUpload.jsx | Adds onboarding guard + refreshes “pending resume” state via layout. |
| frontend/src/pages/ProfileEditor.jsx | Hardens profile load error handling + redirects missing-profile users. |
| frontend/src/pages/PostAuthRedirect.jsx | New post-auth landing route to resolve correct destination. |
| frontend/src/pages/Portfolio.jsx | Sends improved tracking referrer (UTM preferred, same-origin filtered). |
| frontend/src/pages/Dashboard.jsx | Uses shared “missing profile” error detection for redirects. |
| frontend/src/pages/Analytics.jsx | Replaces simple chart/referrers UI with new chart/referrer + GrowthTips. |
| frontend/src/constants/brand.js | Switches primary domain/assets + adds versioned OG/Hero constants. |
| frontend/src/components/GrowthTips.jsx | Adds share/copy UX to drive traffic (LinkedIn/X/resume line). |
| frontend/src/components/DashboardSidebar.jsx | Disables/gates nav items until profile setup is complete. |
| frontend/src/components/DashboardLayout.jsx | Splits user/profile load errors + blocks/redirects child routes robustly. |
| frontend/src/App.jsx | Adds /app route for post-auth redirect + updates Clerk redirect targets. |
| frontend/scripts/render-og-image.mjs | Adds script to render OG image via Playwright + Sharp. |
| frontend/scripts/render-og-from-svg.mjs | Adds script to render OG image from SVG via Playwright. |
| frontend/scripts/crop-og-image.mjs | Adds script to crop hero screenshot into OG image. |
| frontend/public/sitemap.xml | Updates static sitemap URLs to new domain. |
| frontend/public/robots.txt | Updates sitemap and domain reference to new domain. |
| frontend/public/og-image.svg | Updates OG SVG to use new logo + new domain text. |
| frontend/public/og-image-source.html | Adds OG HTML source template using new logo. |
| frontend/public/manifest.json | Updates PWA icon source to new logo. |
| frontend/public/favicon.svg | Updates favicon SVG to new logo. |
| frontend/package.json | Adds scripts for generating OG images. |
| frontend/index.html | Updates canonical/OG/Twitter URLs to new domain and versioned OG image. |
| frontend/.env.example | Updates env tips + app URL for new domain and proxy guidance. |
| backend/test/referrer.test.js | Adds tests for referrer sanitization/normalization/aggregation. |
| backend/test/cors.test.js | Adds tests for LAN dev + production origin allowlist behavior. |
| backend/test/analyticsDates.test.js | Adds tests ensuring UTC day bucketing and shifting behavior. |
| backend/src/utils/referrer.js | Adds canonical referrer normalization and aggregation utilities. |
| backend/src/utils/analyticsDates.js | Adds UTC day utilities to prevent timezone drift. |
| backend/src/routes/sitemap.js | Updates default frontend URL to new domain. |
| backend/src/routes/export.js | Updates exported README default URL to new domain. |
| backend/src/routes/analytics.js | Switches analytics calculations to UTC buckets + aggregates referrers. |
| backend/src/models/Analytics.js | Stores normalized referrer IDs, caps referrers, and normalizes UTC daily stats. |
| backend/src/index.js | Switches to centralized CORS config. |
| backend/src/config/cors.js | Adds production allowlist + LAN/local dev origin patterns. |
| backend/.env.example | Updates default FRONTEND_URL and port to 5001. |
Comments suppressed due to low confidence (1)
frontend/src/utils/api.js:32
- The frontend now defaults local dev backend port to 5001 (Vite proxy + backend .env.example), but this file still falls back to http://localhost:5000 in non-DEV builds and in the VITE_API_URL warning example. This can break
vite preview/ production-like runs when VITE_API_URL is unset and is confusing in the warning text.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| </ul> | ||
| <h2>Get Started</h2> | ||
| <p>Visit <a href="https://portlify.techycsr.dev">portlify.techycsr.dev</a> to create your portfolio for free.</p> | ||
| <p>Visit <a href="https://portlifyai.app">portlify.techycsr.dev</a> to create your portfolio for free.</p> |
Comment on lines
+185
to
+188
| // Update referrer stats (always tracked, including direct traffic) | ||
| const normalizedReferrer = resolveReferrer(referrer); | ||
| const referrerIndex = buildReferrerIndex(this.referrers); | ||
| const existingRef = referrerIndex.get(normalizedReferrer.id); |
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.