How dxx/react-bilibili works
Project type and purpose
• This is a full-stack, server-side-rendered (SSR) React application that mimics the Bilibili mobile web interface.
• It consists of two Node.js/Express services:
a) bilibili-api – a custom API layer (REST + WebSocket) proxying data from official Bilibili endpoints.
b) react-bilibili SSR server – an Express server that builds and serves React pages (initial HTML + JS bundles) and proxies API calls.
• The frontend uses React (with hooks), React Router, Redux (+ thunk), React-Helmet, react-lazyload, loadable-components, cross-fetch.
File structure
Top-level:
• bilibili-api/ – standalone API service
• config/, plugin/, server/ – Webpack configs, custom plugins, and SSR server boot code
• public/, templates/ – static assets and HTML templates
• src/ – React application source (components, containers, Redux, router, entry points)
Key patterns:
• SSR container pattern (entry-server.tsx + renderer.js)
• Client-side hydration (entry-client.tsx)
• Code splitting via loadable-components
• Proxy middleware (server/dev-server.js) forwarding /api to bilibili-api
• WebSocket support in both bilibili-api (src/routers/live) and React client (ChatWS.ts)
README insights
• Confirms SSR template base, React-Router v4, Redux v4, loadable-components for lazy-loading, Express for backend.
• Explains that you must start bilibili-api on port 3010 and then SSR server.