refactor: minimal performant SPA with automated social drip system#136
refactor: minimal performant SPA with automated social drip system#136alexwelcing wants to merge 15 commits intomainfrom
Conversation
Major changes: - Strip heavy 3D components (React Three Fiber, drei, postprocessing) - Simplify homepage with clean, fast article-focused design - Rebuild article pages with ISR and Tailwind Typography - Add automated social drip system (4hr article scheduling) - Create RSS feed generator for SEO - Add GitHub Action for scheduled social posts - Slim dependencies from 50+ to ~15 packages - Optimize Next.js config for performance New features: - /api/social/next - Get next scheduled article - scripts/social-drip.ts - Automated posting to X/LinkedIn - scripts/generate-rss.ts - RSS feed generation - GitHub Action runs every 4 hours for social posts https://claude.ai/code/session_01QH7Vku2fArbh9BVTSkEKjy
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 32b5f677cd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "dependencies": { | ||
| "@emotion/react": "^11.13.0", | ||
| "@emotion/styled": "^11.13.0", | ||
| "@mkkellogg/gaussian-splats-3d": "^0.4.7", | ||
| "@radix-ui/react-dialog": "^1.1.1", | ||
| "@radix-ui/react-label": "^2.1.0", | ||
| "@react-spring/three": "^9.7.5", | ||
| "@react-three/cannon": "^6.6.0", | ||
| "@react-three/drei": "^10.7.7", | ||
| "@react-three/fiber": "^9.4.2", | ||
| "@react-three/postprocessing": "^3.0.4", | ||
| "@react-three/xr": "^6.6.28", | ||
| "@supabase/ssr": "^0.0.9", | ||
| "@supabase/supabase-js": "^2.45.1", | ||
| "@types/node": "^22.10.2", | ||
| "@types/react": "^19.0.1", | ||
| "@types/react-dom": "^19.0.2", | ||
| "ai": "^2.2.37", | ||
| "axios": "^1.7.4", | ||
| "class-variance-authority": "^0.4.0", | ||
| "clsx": "^1.2.1", | ||
| "cmdk": "^0.2.1", | ||
| "common-tags": "^1.8.2", | ||
| "eslint": "^8.57.0", | ||
| "eslint-config-next": "15.5.9", | ||
| "framer-motion": "^12.23.26", | ||
| "github-slugger": "^2.0.0", | ||
| "gpt3-tokenizer": "^1.1.5", | ||
| "gray-matter": "^4.0.3", | ||
| "gsap": "^3.12.5", | ||
| "hover.css": "^2.3.2", | ||
| "lucide-react": "^0.128.0", | ||
| "mdast": "^3.0.0", | ||
| "mdast-util-from-markdown": "^1.3.1", | ||
| "mdast-util-mdx": "^2.0.1", | ||
| "mdast-util-to-markdown": "^1.5.0", | ||
| "mdast-util-to-string": "^3.2.0", | ||
| "micromark-extension-mdxjs": "^1.0.1", | ||
| "next": "15.5.9", | ||
| "next-mdx-remote": "^4.4.1", | ||
| "next-sitemap": "^4.2.3", | ||
| "openai": "^3.3.0", | ||
| "openai-edge": "^1.2.2", | ||
| "postprocessing": "^6.38.2", | ||
| "react": "^19.0.0", | ||
| "react-dom": "^19.0.0", | ||
| "react-markdown": "^10.1.0", | ||
| "remark-gfm": "^4.0.1", | ||
| "sharp": "^0.34.4", | ||
| "styled-components": "^6.1.12", | ||
| "tailwind-merge": "^1.14.0", | ||
| "tailwindcss-animate": "^1.0.7", | ||
| "three": "^0.182.0", | ||
| "typescript": "^5.5.4", | ||
| "unist-builder": "^3.0.1", | ||
| "unist-util-filter": "^4.0.1", | ||
| "yargs": "^17.7.2" | ||
| "typescript": "^5.5.4" |
There was a problem hiding this comment.
Restore 3D deps or remove 3D pages to avoid build failure
The 3D packages (e.g., @react-three/fiber, @react-three/drei, @react-three/cannon, three) were removed from dependencies here, but pages like pages/chat.tsx, pages/studio.tsx, and pages/character-studio.tsx still import components (e.g., components/scene/Scene3D.tsx) that require those modules. Next.js compiles every page under pages/, so next build will fail with “module not found” for these imports unless the pages/components are removed or the dependencies restored.
Useful? React with 👍 / 👎.
| // Post to X (Twitter) using their API | ||
| async function postToX(content: string): Promise<PostResult> { | ||
| const bearerToken = process.env.X_BEARER_TOKEN | ||
| const apiKey = process.env.X_API_KEY | ||
| const apiSecret = process.env.X_API_SECRET | ||
| const accessToken = process.env.X_ACCESS_TOKEN | ||
| const accessSecret = process.env.X_ACCESS_TOKEN_SECRET | ||
|
|
||
| if (!bearerToken && !apiKey) { | ||
| return { success: false, platform: 'x', error: 'Missing X API credentials' } | ||
| } | ||
|
|
||
| try { | ||
| // Using Twitter API v2 | ||
| const response = await fetch('https://api.twitter.com/2/tweets', { | ||
| method: 'POST', | ||
| headers: { | ||
| 'Authorization': `Bearer ${bearerToken}`, | ||
| 'Content-Type': 'application/json', |
There was a problem hiding this comment.
X posting ignores user auth tokens and can silently 401
The X posting code only sends an app bearer token (Authorization: Bearer ${bearerToken}) but it still allows X_API_KEY/X_API_SECRET/X_ACCESS_TOKEN/X_ACCESS_TOKEN_SECRET to be set without requiring a bearer token. In that common setup, the request will go out with Bearer undefined (or an app-only token) and X will reject it, so scheduled posts never succeed. Either require a valid bearer token and fail early or implement user-context OAuth (using the access token/secret) so the request can actually create tweets.
Useful? React with 👍 / 👎.
Removed: - All 3D components (components/3d/, 3D-related files) - Old pages (about, chat, studio, workshop, character-studio, etc.) - Old API routes (art, articles, fal, game, knowledge, media, workshop) - Old lib files (generators, hooks, worlds, fal-models, etc.) - Old scripts (generate-knowledge-base, generate-fal-assets, etc.) - r3f-knowledge docs - Tests directory Kept: - Core pages: index, about, 404, articles - StructuredData component - Minimal lib/utils.ts - Social drip system (scripts + API) - RSS generator - Articles content Clean minimal SPA architecture ready for deploy. https://claude.ai/code/session_01QH7Vku2fArbh9BVTSkEKjy
- Updated Tailwind config with sun/flora/earth/parchment color palette - Redesigned all pages (home, about, articles, article detail, 404) - New warm yellows, natural greens, earthy browns theme - Updated global CSS with organic styling and smooth scrollbar - Typography improvements with serif fonts for headings - Consistent navigation and footer across all pages https://claude.ai/code/session_01QH7Vku2fArbh9BVTSkEKjy
Added terra-50, 100, 200, 300 shades that were used in the about page but not defined in the Tailwind config, causing build issues. https://claude.ai/code/session_01QH7Vku2fArbh9BVTSkEKjy
Build artifacts from latest build. https://claude.ai/code/session_01QH7Vku2fArbh9BVTSkEKjy
- Add Three.js, React Three Fiber, and Drei dependencies - Create OrganicScene component with floating particles, organic blobs, and leaves - Integrate 3D scene as hero background on homepage - Update world config with organic garden theme colors - Match sun/flora/earth color palette throughout 3D elements The 3D scene features: - Floating sun-colored particles (pollen effect) - Organic distorted blob shapes in flora/sun colors - Floating leaf elements - Soft natural lighting - Forest environment preset https://claude.ai/code/session_01QH7Vku2fArbh9BVTSkEKjy
The buildCommand was running pnpm install again which pruned dev dependencies including tsx needed for RSS generation. Vercel already runs installCommand separately. https://claude.ai/code/session_01QH7Vku2fArbh9BVTSkEKjy
The 'use client' directive is for App Router only. In Pages Router projects, it may cause issues in production. The dynamic import with ssr: false already handles client-side rendering. https://claude.ai/code/session_01QH7Vku2fArbh9BVTSkEKjy
Remove the OrganicScene 3D component from the homepage to establish a reliable deployment foundation. The organic CSS-based design with gradients and blur effects provides a beautiful experience without the complexity of Three.js client-side rendering. The 3D scene can be reintroduced once the base site is stable. https://claude.ai/code/session_01QH7Vku2fArbh9BVTSkEKjy
Rebuilt OrganicScene with a solid foundation: - Error boundary catches any Three.js crashes - WebGL availability check before rendering - Graceful static fallback (CSS gradients) when 3D unavailable - Simpler scene: floating particles + glowing orbs - No external drei dependencies that could fail - Client-side only with proper mounting checks - Lower DPR for better performance - failIfMajorPerformanceCaveat for weak devices The scene degrades gracefully - users without WebGL still see a beautiful animated gradient background. https://claude.ai/code/session_01QH7Vku2fArbh9BVTSkEKjy
Major changes:
New features:
https://claude.ai/code/session_01QH7Vku2fArbh9BVTSkEKjy