Skip to content

Conversation

@TooAngel
Copy link
Contributor

Summary

This PR migrates the complete React frontend from the core repository to webapp, enabling a clean separation between the frontend and backend services. The webapp now serves all UI components while proxying API requests to the core backend.

Changes

Components Migrated

  • Dashboard - Main dashboard with repository list and PR management
  • Repository - Repository detail display
  • RepositoryListItem - Repository list item with configuration toggle
  • PullRequest - Pull request wrapper component
  • PullRequestView - Detailed pull request view with voting stats
  • Logs - Admin logs with WebSocket connection

New Infrastructure

  • useAuth hook - Authentication state management
  • ProtectedRoute component - Route protection wrapper
  • Page components - Dashboard, Repository, PullRequest, Admin pages
  • Routing setup - Complete React Router configuration in App.jsx
  • Authentication UI - Login/logout in Header component

API Changes

All frontend API calls updated from /v1/* to /api/v1/*:

  • User endpoints: /api/v1/user/
  • Repositories: /api/v1/repositories/
  • Pull requests: /api/v1/repositories/:owner/:repo/pulls/:number
  • Configuration: /api/v1/repositories/:fullName/

Configuration

  • Added CSS modules support to Vite config
  • Installed prop-types dependency
  • Updated index.html with favicons and global styles
  • Copied all static assets (images, CSS) from core

Architecture

Before:

www.worlddriven.org → Core (Express + React + API)

After:

webapp.worlddriven.org → Webapp (Express + React)
                         └── Proxy /api/* → core (API only)

Request Flow

  1. Frontend calls /api/v1/user/
  2. Express proxy receives request
  3. Proxy strips /api prefix → /v1/user/
  4. Forwards to core backend at https://www.worlddriven.org/v1/user/
  5. Core processes request (unchanged)
  6. Response flows back through proxy to frontend

Key Benefits

  • Zero core changes - Backend remains completely unchanged
  • Clean separation - Frontend and backend can be deployed independently
  • CORS prevention - Proxy handles all cross-origin concerns
  • Cookie management - Proxy converts httpOnly cookies to Authorization headers

Testing

  • ✅ All ESLint checks pass
  • ✅ Prettier formatting verified
  • ✅ TypeScript type checking passes
  • ✅ Production build successful
  • ✅ All components properly exported and imported

Next Steps

After merge:

  1. Runtime testing with core backend
  2. Verify OAuth flow works correctly
  3. Test all API endpoints through proxy
  4. Deploy to staging environment
  5. DNS swap when ready for production

Related

This implements the frontend migration plan while maintaining full backward compatibility with the core backend.

@worlddriven
Copy link

worlddriven bot commented Nov 27, 2025

🤖 Worlddriven Status

📊 Live Status Dashboard

🗓️ Merge Date: 2025-12-01 at 05:45:18 UTC (today)
📅 Started: 2025-11-27 at 21:45:18 UTC
Speed Factor: 0.33 (67% faster due to reviews)
Positive votes: 2/3 contribution weight (coefficient: 0.67)
📈 Base Merge Time: 10 days → Current: 3 days

🎯 Want to influence when this merges?

Your review matters! As a contributor to this project, your voice helps determine the merge timeline.

How to review:

  1. Check the changes
    Files changed

  2. Leave your review
    Review changes

Your options:

  • ✅ Agree & Speed Up: Approve Approving makes this merge faster
  • ❌ Disagree & Slow Down: Request changes Requesting changes delays the merge

💡 Pro tip: The more contributors who agree, the faster this gets merged!

📊 View detailed stats on the dashboard

📋 Recent Activity

2025-11-27, 21:35:34 - Pull request opened
2025-11-27, 21:45:26 - Branch synchronized (merge timer reset)
2025-12-01, 05:52:30 - Pull request merged by worlddriven ✅


This comment is automatically updated by worlddriven

Migrate all React components, pages, and assets from the core repository to webapp. The webapp now serves the complete frontend while proxying API requests to the core backend.

Changes:
- Migrated 6 React components (Dashboard, Repository, RepositoryListItem, PullRequest, PullRequestView, Logs)
- Updated all API calls from /v1/* to /api/v1/* to work with Express proxy
- Created authentication hook (useAuth) and protected routes
- Added page components for routing (Dashboard, Repository, PullRequest, Admin)
- Configured CSS modules support in Vite
- Copied static assets (images, styles) from core
- Updated routing in App.jsx with protected routes
- Enhanced Header with authentication UI

Architecture:
- Frontend calls /api/v1/* endpoints
- Express proxy strips /api prefix and forwards to core as /v1/*
- Core backend remains completely unchanged
- Cookie-based authentication handled by proxy layer

All checks passing: linting, formatting, type checking, and build.
@TooAngel TooAngel force-pushed the feat/migrate-frontend-from-core branch from 5a7d188 to 05db099 Compare November 27, 2025 21:45
@worlddriven worlddriven bot merged commit 90c6c2e into worlddriven:main Dec 1, 2025
2 checks passed
@TooAngel TooAngel deleted the feat/migrate-frontend-from-core branch December 23, 2025 05:58
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.

1 participant