A comprehensive full-stack blog application built with modern web technologies, featuring a React frontend with advanced theming, Cloudflare Workers backend, and PostgreSQL database with intelligent content management.
| Feature | Screenshot |
|---|---|
| π Homepage | ![]() |
| π Publishing | ![]() |
| π Authentication | ![]() |
| π Blog Discovery | ![]() |
- Advanced Theme System - Dark/light mode with system preference detection and smooth transitions
- Responsive Design - Mobile-first design with Tailwind CSS v4 and optimized layouts
- Real-time Feedback - Loading states, error handling, success notifications, and visual feedback
- Interactive UI - Hover effects, smooth animations, and intuitive navigation
- JWT Authentication - Secure user sessions with token-based authentication
- Protected Routes - Route guards for authenticated-only content
- User Management - Sign up, sign in, and profile management
- Rich Blog Publishing - Intuitive blog creation form with real-time validation
- Draft Management - Auto-save drafts to localStorage with manual save/clear options
- Blog CRUD Operations - Create, read, update, and delete blog posts
- Content Search - API integration for blog discovery and listing
- Intelligent Tag Extraction - Automatic tag generation from blog content with proper capitalization
- Read Time Estimation - Dynamic reading time calculation based on content length
- Author Attribution - Complete author information display
- Content Metadata - Publication dates, update tracking, and content statistics
- API Integration - Seamless backend integration with comprehensive error handling
- Type Safety - Full TypeScript support across the entire stack
- Serverless Architecture - Deployed on Cloudflare Workers for global edge performance
- Database Management - Prisma ORM with PostgreSQL and migration support
- Mock Data Fallbacks - Graceful degradation with mock content for development
This is a monorepo containing three main packages:
- React 19 with TypeScript for modern component architecture
- Vite 7 for lightning-fast development and optimized builds
- Tailwind CSS v4 with @tailwindcss/vite plugin for advanced styling
- React Router v7 for sophisticated client-side routing
- Context API for global state management (theme, authentication)
- Custom Hooks for reusable logic (useAuth, useTheme)
- Component Library - Comprehensive UI components with dark mode support
- Advanced Features:
- Smart tag extraction and capitalization
- Draft management with localStorage persistence
- Real-time content validation
- Loading skeletons and error boundaries
- Responsive design patterns
- Hono - Fast, lightweight web framework for Cloudflare Workers
- Prisma 6 - Type-safe database ORM with Accelerate for global performance
- PostgreSQL - Production-ready database with full ACID compliance
- JWT Authentication - Secure user sessions with token-based auth
- Cloudflare Workers - Serverless deployment with edge computing
- RESTful API - Comprehensive endpoints for blog and user management
- Database Migrations - Version-controlled schema management
- Type Safety - End-to-end TypeScript integration
- Zod - Runtime type validation
- Shared Types - TypeScript interfaces for API contracts
- NPM Package - Published as
@mrunal121/codelogs-blog-common
- React 19.1.1 - Latest React with concurrent features
- TypeScript - Type safety and enhanced developer experience
- Vite 7.1.2 - Next-generation frontend tooling
- Tailwind CSS 4.1.12 - Utility-first CSS framework with v4 features
- React Router DOM 7.8.0 - Advanced routing with nested routes
- Context API - Built-in state management solution
- Hono 4.7.10 - Modern web framework for edge computing
- Prisma 6.8.2 - Next-generation ORM with type safety
- Cloudflare Workers - Serverless compute platform
- PostgreSQL - Advanced relational database via Prisma Accelerate
- JWT - Industry-standard authentication tokens
- ESLint - Code linting and quality enforcement
- PostCSS - CSS processing and optimization
- Wrangler - Cloudflare Workers CLI and development tools
- TypeScript - Static type checking across the stack
- Vite - Fast build tool with HMR and optimizations
- Node.js (v18 or higher)
- npm or yarn
- Cloudflare account (for deployment)
-
Clone the repository
git clone https://github.com/Mrunal112/devlogs-blog.git cd codelogs-blogs -
Install dependencies for all packages
# Install frontend dependencies cd frontend npm install # Install backend dependencies cd ../backend npm install # Install common package dependencies cd ../common npm install
-
Set up the database
cd backend # Configure your DATABASE_URL in wrangler.jsonc npx prisma migrate dev
-
Start the backend development server
cd backend npm run dev # Backend runs on Cloudflare Workers local development environment
-
Start the frontend development server
cd frontend npm run dev # Frontend will be available at http://localhost:5173
-
Build the common package (if making changes)
cd common npm run build
codelogs-blogs/
βββ frontend/ # React frontend application
β βββ src/
β β βββ components/ # Reusable UI components
β β β βββ Auth.tsx # Authentication form component
β β β βββ AuthGuard.tsx # Route protection wrapper
β β β βββ BlogCard.tsx # Blog post card with tags and metadata
β β β βββ Footer.tsx # Application footer
β β β βββ Header.tsx # Navigation header with theme toggle
β β β βββ Layout.tsx # Main layout wrapper with theme support
β β β βββ ProtectedRoute.tsx # Protected route wrapper
β β β βββ Publish.tsx # Advanced blog publishing form with drafts
β β β βββ Quote.tsx # Inspirational quotes display
β β β βββ ThemeToggle.tsx # Dark/light mode toggle button
β β βββ contexts/ # React Context providers
β β β βββ AuthContext.tsx # Authentication state management
β β β βββ theme.ts # Theme type definitions
β β β βββ ThemeContext.tsx # Theme state provider with system detection
β β βββ hooks/ # Custom React hooks
β β β βββ useAuth.ts # Authentication hook with JWT handling
β β β βββ useTheme.ts # Theme management hook
β β βββ pages/ # Page components
β β β βββ Blog.tsx # Individual blog post page with tag extraction
β β β βββ Blogs.tsx # Blog listing page with API integration and search
β β β βββ Signin.tsx # User sign in page
β β β βββ Signup.tsx # User registration page
β β βββ routes/ # Route configuration
β β β βββ AuthRoutes.tsx # Authentication-related routes
β β β βββ index.tsx # Main route configuration with guards
β β β βββ ProtectedRoutes.tsx # Protected route definitions
β β β βββ PublicRoutes.tsx # Public route definitions
β β βββ config.ts # Frontend configuration and API URLs
β β βββ main.tsx # Application entry point with providers
β βββ vite.config.ts # Vite configuration with Tailwind CSS v4
β βββ package.json # Dependencies and build scripts
β β β βββ Blogs.tsx # Blog listing page with API integration
β β β βββ Signin.tsx # Sign in page
β β β βββ Signup.tsx # Sign up page
β β βββ routes/ # Route configuration
β β β βββ AuthRoutes.tsx # Authentication routes
β β β βββ index.tsx # Main route configuration
β β β βββ ProtectedRoutes.tsx # Protected routes
β β β βββ PublicRoutes.tsx # Public routes
β β βββ config.ts # Frontend configuration
β β βββ main.tsx # Application entry point
β βββ vite.config.ts # Vite configuration with Tailwind v4
β βββ package.json # Dependencies and scripts
βββ backend/ # Cloudflare Workers backend
β βββ src/
β β βββ routes/ # API route handlers
β β β βββ user.ts # User authentication and profile routes
β β β βββ blog.ts # Blog CRUD operations and bulk fetch
β β β βββ auth.ts # Authentication middleware and utilities
β β βββ auth/ # Authentication utilities
β β β βββ jwt.ts # JWT token creation and validation
β β βββ index.ts # Main server entry point with CORS
β βββ prisma/ # Database schema and migrations
β β βββ schema.prisma # Database schema with user and blog models
β β βββ migrations/ # Database migration files with version control
β β βββ migration_lock.toml
β β βββ 20250531144537_init_schema/
β β βββ 20250531171134_added_username/
β βββ wrangler.jsonc # Cloudflare Workers configuration and env vars
βββ common/ # Shared types and utilities
β βββ src/
β βββ index.ts # Exported TypeScript interfaces and Zod schemas
βββ README.md # This comprehensive documentation
Update backend/wrangler.jsonc with your:
- Database URL (Prisma Accelerate)
- Environment variables
- Cloudflare Workers settings
Update frontend/src/config.ts with your:
- Backend API URL
- Environment-specific settings
POST /user/signup- Create new user account with email and passwordPOST /user/signin- User login returning JWT token
GET /blog/bulk- Get all published blog posts (with optional auth header)GET /blog/:id- Get specific blog post by ID with full contentPOST /blog- Create new blog post (authenticated users only)PUT /blog/:id- Update existing blog post (authenticated, author only)DELETE /blog/:id- Delete blog post (authenticated, author only)
- Automatic Tag Extraction - Tags generated from content with proper capitalization
- Author Information - Complete author details included in responses
- Metadata - Creation/update timestamps, publication status
- Type Safety - All responses validated with TypeScript interfaces
cd backend
# Ensure your wrangler.jsonc is configured with production settings
npm run deploy
# Your API will be available at your Cloudflare Workers domaincd frontend
# Build the optimized production bundle
npm run build
# Deploy the dist/ folder to your preferred hosting service
# Recommended: Vercel, Netlify, or Cloudflare PagesBackend (wrangler.jsonc):
DATABASE_URL- Prisma Accelerate connection stringJWT_SECRET- JWT signing secret
Frontend (config.ts):
- Update
backendUrlfor your production API endpoint
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the ISC License. See the LICENSE file for details.
Mrunal - @Mrunal112
- Inspired by modern blogging platforms
- Uses cutting-edge web technologies for optimal performance
Happy Coding! π



