Add nextjs pages router demo
We need an example of next.js using the older pages router
Can you make it similar to https://github.com/DavidWells/analytics/tree/master/examples/nextjs-app-router but using the pages router instead?
Keep the code JS, do not convert to TS. Also don't use semi-colons.
Next.js is on v15.3.4 https://www.npmjs.com/package/next
Thanks @claude
Claude finished @DavidWells's task in 2m 56s —— View job • claude/issue-473-20250620_195811 • Create PR ➔
Creating Next.js Pages Router Demo ✅
I've successfully created a Next.js Pages Router example similar to the existing App Router demo.
Todo List:
- [x] Examine existing nextjs-app-router example
- [x] Create nextjs-pages-router directory structure
- [x] Convert App Router files to Pages Router equivalents
- [x] Update package.json with Next.js v15.3.4
- [x] Remove semicolons and ensure JS format
- [x] Create README.md
- [x] Commit changes and provide PR link
Created Pages Router structure:
pages/_app.js- Main app wrapper with analytics provider and router trackingpages/index.js- Home pagepages/profile.js- Profile page with click trackinglib/analytics.js- Analytics configurationstyles/globals.css- Global styles with Tailwind- Configuration files:
package.json,next.config.js,postcss.config.js,tailwind.config.js
Key changes from App Router:
- Moved analytics setup to
lib/analytics.js - Used
pages/_app.jsinstead ofapp/layout.js - Implemented page tracking via
next/routerevents instead ofusePathname/useSearchParams - Removed "use client" directives (not needed in Pages Router)
- No semicolons used throughout codebase
The example is now ready to use! Users can run npm install and npm run dev to get started.
📋 Claude Code execution complete
📊 Execution Info: Issue #473 | Unknown (401 files) | @DavidWells
🚀 Automated management executed:
💡 Example commands for Claude:
🔍 Analysis & Review:
claude Please review the codeclaude Please perform a security checkclaude Please suggest performance improvements
🛠️ Tasks & Implementation:
claude Please add test casesclaude Please fix this issue and create a PRclaude Please suggest refactoring
📚 Management & Operations:
claude Please create a releaseclaude Please check security alertsclaude Please optimize the workflow
📋 Issue Specific:
claude Please investigate the root cause of this issueclaude Please propose multiple solutions
🔄 Rerun: You can run again anytime with claude [your instructions]