11# @fecommunity/reactpress-client
22
3- ReactPress Client - Next.js-based frontend for ReactPress CMS with modern UI and responsive design.
3+ ReactPress Client - Next.js 14 frontend for ReactPress CMS with modern UI and responsive design.
44
55[ ![ NPM Version] ( https://img.shields.io/npm/v/@fecommunity/reactpress-client.svg )] ( https://www.npmjs.com/package/@fecommunity/reactpress-client )
66[ ![ License] ( https://img.shields.io/npm/l/@fecommunity/reactpress-client.svg )] ( https://github.com/fecommunity/reactpress/blob/master/client/LICENSE )
77[ ![ Node Version] ( https://img.shields.io/node/v/@fecommunity/reactpress-client.svg )] ( https://nodejs.org )
8+ [ ![ TypeScript] ( https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg )] ( http://www.typescriptlang.org/ )
9+ [ ![ Next.js] ( https://img.shields.io/badge/Next.js-14-black )] ( https://nextjs.org/ )
810
911## Overview
1012
11- ReactPress Client is a modern, responsive frontend application built with Next.js that serves as the user interface for the ReactPress CMS platform. It provides a rich, interactive experience for content creators and readers alike, featuring a clean design, intuitive navigation, and powerful content management capabilities.
13+ ReactPress Client is a responsive frontend application built with Next.js 14 that serves as the user interface for the ReactPress CMS platform. It provides a clean design, intuitive navigation, and content management capabilities.
14+
15+ The client is designed with a component-based architecture that promotes reusability and maintainability. It integrates with the ReactPress backend through the [ ReactPress Toolkit] ( ../toolkit ) , providing type-safe API interactions.
1216
1317## Quick Start
1418
@@ -24,30 +28,32 @@ npx @fecommunity/reactpress-client --pm2
2428
2529## Features
2630
27- - 🚀 ** Modern UI/UX ** - Built with Ant Design v5 for a polished interface
28- - 📱 ** Responsive Design ** - Works seamlessly on desktop, tablet, and mobile
31+ - ⚡ ** App Router Architecture ** with Server Components for optimal SSR
32+ - 🎨 ** Theme System ** with light/dark mode switching
2933- 🌍 ** Internationalization** - Supports Chinese and English languages
30- - 🌙 ** Dark Mode** - Light and dark theme switching
31- - ✍️ ** Markdown Editor** - Built-in rich text editor for content creation
32- - 📊 ** Analytics Dashboard** - Visualize content performance
33- - 🔍 ** Advanced Search** - Powerful content search capabilities
34- - 🖼️ ** Media Management** - Upload and manage images and files
35- - 📱 ** PWA Support** - Installable as a progressive web app
36- - ⚡ ** Performance Optimized** - Server-side rendering and code splitting
34+ - 🌙 ** Theme Switching** with system preference detection
35+ - ✍️ ** Markdown Editor** with live preview
36+ - 📊 ** Analytics Dashboard** with metrics and visualizations
37+ - 🔍 ** Search** with filtering
38+ - 🖼️ ** Media Management** with drag-and-drop upload
39+ - 📱 ** PWA Support** with offline capabilities
40+ - ♿ ** Accessibility Compliance** - WCAG 2.1 AA standards
41+ - 🚀 ** Performance Optimized** - Code splitting, image optimization, and caching
3742
3843## Requirements
3944
40- - Node.js >= 16.5.0
41- - npm or yarn package manager
45+ - Node.js >= 18.20.4
46+ - npm or pnpm package manager
4247- ReactPress Server running (for API connectivity)
4348
4449## Usage Scenarios
4550
4651### Standalone Client
4752Perfect for:
4853- Connecting to remote ReactPress API
54+ - Headless CMS implementation
4955- Custom deployment scenarios
50- - Development and testing
56+ - Microfrontend architecture
5157
5258### Full ReactPress Stack
5359Use with ReactPress server for complete CMS solution:
@@ -63,14 +69,14 @@ npx @fecommunity/reactpress-client
6369
6470ReactPress Client includes a comprehensive set of UI components:
6571
66- - ** Admin Dashboard** - Content management interface
67- - ** Article Editor** - Markdown-based content creation
68- - ** Comment System** - Reader engagement tools
69- - ** Media Library** - File management system
70- - ** User Management** - Account and profile settings
71- - ** Analytics Views** - Data visualization components
72- - ** Theme Switcher** - Light/dark mode toggle
73- - ** Language Selector** - Internationalization controls
72+ - ** Admin Dashboard** - Content management interface with role-based access
73+ - ** Article Editor** - Advanced markdown editor with media embedding
74+ - ** Comment System** - Moderation tools with spam detection
75+ - ** Media Library** - File management
76+ - ** User Management** - Account and profile settings with 2FA
77+ - ** Analytics Views** - Data visualization components with export capabilities
78+ - ** Theme Switcher** - Light/dark mode toggle with system preference detection
79+ - ** Language Selector** - Internationalization controls with RTL support
7480
7581## PM2 Support
7682
@@ -84,24 +90,27 @@ npx @fecommunity/reactpress-client --pm2
8490PM2 features:
8591- Automatic process restart on crash
8692- Memory monitoring
87- - Log management
88- - Cluster mode support
89- - Process monitoring dashboard
93+ - Log management with rotation
94+ - Process management
95+ - Health checks
9096
9197## Configuration
9298
9399The client connects to the ReactPress server via environment variables:
94100
95101``` env
96102# Server API URL
97- SERVER_API_URL=http ://localhost:3002
103+ SERVER_API_URL=https ://api.yourdomain.com
98104
99105# Client URL
100- CLIENT_URL=http ://localhost:3001
106+ CLIENT_URL=https ://yourdomain.com
101107CLIENT_PORT=3001
102108
103109# Analytics
104110GOOGLE_ANALYTICS_ID=your_ga_id
111+
112+ # Security
113+ NEXT_PUBLIC_CRYPTO_KEY=your_encryption_key
105114```
106115
107116## Development
@@ -131,18 +140,15 @@ pnpm run start
131140
132141```
133142client/
134- ├── pages/ # Next.js pages
135- │ ├── admin/ # Admin dashboard pages
136- │ ├── article/ # Article pages
137- │ └── ... # Other page routes
138- ├── src/
139- │ ├── components/ # Reusable UI components
140- │ ├── layout/ # Page layouts
141- │ ├── providers/ # API and context providers
142- │ ├── hooks/ # Custom React hooks
143- │ ├── context/ # React context providers
144- │ ├── utils/ # Utility functions
145- │ └── theme/ # Theme configurations
143+ ├── app/ # Next.js 14 App Router
144+ │ ├── (admin)/ # Admin dashboard routes
145+ │ ├── (public)/ # Public facing routes
146+ │ └── api/ # API routes
147+ ├── components/ # Reusable UI components
148+ ├── lib/ # Business logic and utilities
149+ ├── providers/ # React context providers
150+ ├── hooks/ # Custom React hooks
151+ ├── styles/ # Global styles and design tokens
146152├── public/ # Static assets
147153└── bin/ # CLI entry points
148154```
@@ -156,6 +162,7 @@ client/
156162| ` CLIENT_PORT ` | Client port | ` 3001 ` |
157163| ` NEXT_PUBLIC_GA_ID ` | Google Analytics ID | - |
158164| ` NEXT_PUBLIC_SITE_TITLE ` | Site title | ` ReactPress ` |
165+ | ` NEXT_PUBLIC_CRYPTO_KEY ` | Encryption key for sensitive data | - |
159166
160167## CLI Commands
161168
@@ -171,38 +178,99 @@ npx @fecommunity/reactpress-client --pm2
171178
172179# Specify port
173180npx @fecommunity/reactpress-client --port 3001
181+
182+ # Enable verbose logging
183+ npx @fecommunity/reactpress-client --verbose
174184```
175185
176- ## Customization
186+ ## Integration with ReactPress Toolkit
177187
178- ### Theme Customization
179- Modify theme variables in ` src/theme/ ` to customize colors, typography, and spacing.
188+ The client seamlessly integrates with the ReactPress Toolkit for API interactions:
180189
181- ### Component Extensions
182- Create custom components in ` src/components/ ` to extend functionality.
190+ ``` typescript
191+ import { api , types } from ' @fecommunity/reactpress-toolkit ' ;
183192
184- ### Page Creation
185- Add new pages in ` pages/ ` directory following Next.js routing conventions.
193+ // Fetch articles with proper typing
194+ const articles: types .IArticle [] = await api .article .findAll ();
195+
196+ // Create new article
197+ const newArticle = await api .article .create ({
198+ title: ' My New Article' ,
199+ content: ' Article content here...' ,
200+ // ... other properties
201+ });
202+ ```
203+
204+ The toolkit provides:
205+ - Strongly-typed API clients for all modules
206+ - TypeScript definitions for all data models
207+ - Utility functions for common operations
208+ - Built-in authentication and error handling
209+ - Automatic retry mechanisms for failed requests
210+
211+ ## Theme Customization
212+
213+ ReactPress Client supports advanced theme customization:
214+
215+ ### Design Token System
216+ ``` typescript
217+ // Custom theme tokens
218+ const customTokens = {
219+ colors: {
220+ primary: ' #0070f3' ,
221+ secondary: ' #7928ca' ,
222+ background: ' #ffffff' ,
223+ text: ' #000000'
224+ },
225+ typography: {
226+ fontFamily: ' Inter, sans-serif' ,
227+ fontSize: {
228+ small: ' 12px' ,
229+ medium: ' 16px' ,
230+ large: ' 20px'
231+ }
232+ }
233+ };
234+ ```
235+
236+ ### Component-Level Customization
237+ ``` typescript
238+ // Extend existing components
239+ import { Button } from ' @fecommunity/reactpress-components' ;
240+
241+ const CustomButton = styled (Button )`
242+ background-color: ${props => props .theme .colors .primary };
243+ border-radius: 8px;
244+ padding: 12px 24px;
245+ ` ;
246+ ```
186247
187248## Performance Optimization
188249
189- - ** Server-Side Rendering ** - Improved SEO and initial load performance
190- - ** Code Splitting** - Automatic route -based code splitting
191- - ** Image Optimization** - Next.js built-in image optimization
250+ - ** App Router Architecture ** - Server Components for optimal SSR
251+ - ** Automatic Code Splitting** - Route -based code splitting
252+ - ** Image Optimization** - Next.js built-in image optimization with automatic format selection
192253- ** Lazy Loading** - Component and route lazy loading
193- - ** Caching** - HTTP caching strategies
254+ - ** Caching Strategies** - HTTP caching and in-memory caching
255+ - ** Bundle Analysis** - Built-in bundle analysis tools
194256
195257## PWA Support
196258
197259ReactPress Client is a Progressive Web App with:
198- - Offline support
199- - Installable on devices
260+ - Offline support with service workers
261+ - Installable on devices with native app experience
200262- Push notifications (coming soon)
201- - App-like experience
263+ - App-like experience with splash screens
202264
203265## Testing
204266
205267``` bash
268+ # Run unit tests with Vitest
269+ pnpm run test
270+
271+ # Run integration tests with Playwright
272+ pnpm run test:e2e
273+
206274# Run linting
207275pnpm run lint
208276
@@ -211,11 +279,31 @@ pnpm run format
211279
212280# Run type checking
213281pnpm run type-check
282+
283+ # Run bundle analysis
284+ pnpm run analyze
214285```
215286
287+ ## Templates
288+
289+ ReactPress Client can be used with various professional templates:
290+
291+ ### Hello World Template
292+ ``` bash
293+ npx @fecommunity/reactpress-template-hello-world my-blog
294+ ```
295+
296+ ### Twenty Twenty Five Template
297+ ``` bash
298+ npx @fecommunity/reactpress-template-twentytwentyfive my-blog
299+ ```
300+
301+ ### Custom Templates
302+ Create your own templates by extending the client with custom components and pages.
303+
216304## Deployment
217305
218- ### Vercel Deployment
306+ ### Vercel Deployment (Recommended)
219307
220308[ ![ Deploy with Vercel] ( https://vercel.com/button )] ( https://vercel.com/new/clone?repository-url=https://github.com/fecommunity/reactpress )
221309
@@ -234,6 +322,7 @@ pnpm run start
234322- 📖 [ Documentation] ( https://github.com/fecommunity/reactpress )
235323- 🐛 [ Issues] ( https://github.com/fecommunity/reactpress/issues )
236324- 💬 [ Discussions] ( https://github.com/fecommunity/reactpress/discussions )
325+ - 📧
[ Support
] ( mailto:[email protected] ) 237326
238327## Contributing
239328
0 commit comments