Live Demo: blog.penguninn.com
Backend Repository: penguninn/blog-be
A modern, full-stack blog platform featuring a React TypeScript frontend with rich content creation capabilities, secure authentication, and a professional admin interface.
- Rich Text Editor - TipTap-powered WYSIWYG editor with advanced formatting
- Post Management - Create, edit, delete, and organize blog posts
- Category System - Organize content with hierarchical categories
- SEO-Optimized - Slug-based URLs and metadata support
- Keycloak Integration - Enterprise-grade authentication
- Role-Based Access - User and admin role management
- Protected Routes - Secure access to admin features
- User Profiles - Profile management and editing
- Responsive Design - Mobile-first, fully responsive interface
- Dark/Light Theme - System-aware theme switching
- Modern UI Components - Radix UI-based component library
- Loading States - Lazy loading and smooth transitions
- Vite Build System - Lightning-fast development and builds
- TypeScript - Full type safety and IntelliSense
- Code Splitting - Optimized bundle splitting for faster loads
- ESLint & Prettier - Automated code formatting and linting
- Frontend: React 19, TypeScript, Tailwind CSS
- Build Tool: Vite 6 with optimized bundles
- UI Library: Radix UI primitives with shadcn/ui
- Editor: TipTap rich text editor
- Authentication: Keycloak with React integration
- HTTP Client: Axios with proxy configuration
- Routing: React Router v7 with lazy loading
- Styling: Tailwind CSS v4 with custom design system
- Node.js β₯ 20.x
- npm β₯ 10.x
- Backend API running on port 8080 (setup guide)
- Keycloak authentication server on port 9000
# Clone the repository
git clone https://github.com/penguninn/blog-fe.git
cd blog-fe
# Install dependencies
npm install
# Setup environment variables
cp .env.example .envEdit .env with your settings:
# Keycloak Authentication (Required)
VITE_KEYCLOAK_URL=http://localhost:9000
VITE_KEYCLOAK_REALM=blog-realm
VITE_KEYCLOAK_CLIENT_ID=blog-spa
# API Configuration (Optional - uses Vite proxy by default)
VITE_API_BASE_URL=http://localhost:8080Configure your Keycloak client:
- Client ID:
blog-spa - Client Type: Public
- Valid Redirect URIs:
http://localhost:5173/* - Web Origins:
http://localhost:5173 - Root URL:
http://localhost:5173
# Start development server
npm run dev # β http://localhost:5173
# Build for production
npm run build
# Preview production build
npm run preview
# Run linting
npm run lint
# Type checking
npm run typecheck
# Format code
npm run formatsrc/
βββ components/ # Reusable UI components
β βββ ui/ # shadcn/ui components
β βββ common/ # Shared components
β βββ forms/ # Form components
βββ pages/ # Route components
β βββ Home.tsx # Blog homepage
β βββ PostDetails.tsx # Individual post view
β βββ ListPost.tsx # Post listing page
β βββ admin/ # Admin interface
βββ layouts/ # Layout components
βββ hooks/ # Custom React hooks
βββ services/ # API services
βββ utils/ # Utility functions
βββ types/ # TypeScript definitions
βββ constants/ # App constants
The frontend communicates with the backend through:
- Development: Vite proxy (
/apiβhttp://localhost:8080) - Production: Direct API calls to configured backend URL
- Authentication: Keycloak JWT tokens in request headers
- Error Handling: Axios interceptors with user-friendly messages
# Create optimized production build
npm run build
# Analyze bundle size
npm run analyzeVITE_KEYCLOAK_URL=https://your-keycloak-server.com
VITE_KEYCLOAK_REALM=production-realm
VITE_KEYCLOAK_CLIENT_ID=blog-spa-prod
VITE_API_BASE_URL=https://your-api-server.com- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Live Application: blog.penguninn.com
- Backend Repository: penguninn/blog-be
- Documentation: Project Wiki
Built with β€οΈ by penguninn