Skip to content
iamzehanPublic

About

Production Grade Blog site project for a Singular Author. Readers may Subscribe, Comment, React and get notified. Server is built on Express, CMS and Client side uses ReactJS.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

348 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ZincBlogs Logo ZincBlogs - Production-Grade Blogging Platform

A complete, enterprise-ready blogging platform with CMS, API, and modern frontend

Node.js React Express TypeScript PostgreSQL Prisma Vite TailwindCSS

Status License Platform

ZincBlogs Version: 1.0.0
Project ID: ZincBlogs
Repository: iamzehan/ZincBlogs
Last Updated: April 17, 2026


πŸ“‹ Table of Contents


🎯 Project Overview

ZincBlogs is a production-grade, full-stack blogging platform designed to provide a complete content management solution. It combines a robust backend API, a powerful CMS dashboard for administrators, and a beautiful public-facing frontend for readers.

The platform enables:

  • ✍️ Content Creation & Management - Authors can write and publish blog posts
  • πŸ‘₯ User Management - Comprehensive authentication and profile management
  • πŸ’¬ Community Engagement - Commenting and liking system for interaction
  • πŸ“Š Administration - Full CMS dashboard for content and subscriber management
  • πŸ” Security - JWT-based authentication, email verification, and role-based access control
  • ☁️ Cloud Integration - Cloudinary for scalable image management

πŸ—οΈ Architecture & Structure

The project follows a three-tier architecture pattern:

Blog-Project/
β”œβ”€β”€ Backend/
β”‚   β”œβ”€β”€ API/              (Express.js REST API - Core backend service)
β”‚   └── CMS/              (React administration dashboard)
└── Frontend/             (Public-facing React application)

Tier 1: Backend API (/Backend/API)

The core RESTful API service built with Express.js and TypeScript, powering ZincBlogs.

Key Responsibilities:

  • User authentication and authorization
  • Blog content management
  • Comment and like system
  • Email verification and notifications
  • Media upload handling via Cloudinary
  • Database operations with Prisma ORM
  • Background job processing (cleanup tasks)

Technology: Node.js, Express, TypeScript, Prisma, PostgreSQL, JWT, Cloudinary

πŸ“– View API Documentation


Tier 2: CMS Dashboard (/Backend/CMS)

Admin dashboard for ZincBlogs content creators and platform administrators.

Key Responsibilities:

  • Blog post creation and management
  • Media library management
  • Subscriber management and analytics
  • Dashboard metrics and analytics
  • Secure admin authentication

Technology: React 19, TypeScript, Vite, TailwindCSS, Material UI, React Query

πŸ“– View CMS Documentation


Tier 3: Frontend Application (/Frontend)

Public-facing web application for ZincBlogs readers and content consumers.

Key Responsibilities:

  • Blog discovery and reading
  • User authentication (signup/login)
  • Comment and interaction features
  • Responsive design for all devices
  • User profile management

Technology: React 19, TypeScript, Vite, TailwindCSS, React Router, React Query

πŸ“– View Frontend Documentation


πŸ› οΈ Technology Stack

Backend Technologies

Technology Version Logo Purpose
Node.js 20+ Node.js JavaScript runtime
Express.js 5.2.1 Express Web framework
TypeScript 5.9.3 TypeScript Type-safe development
Prisma ORM 7.2.0 Prisma Database toolkit & ORM
PostgreSQL Latest PostgreSQL Relational database
JWT 9.0.3 JWT Secure authentication
Cloudinary 2.9.0 Cloudinary Cloud media management
Nodemailer 7.0.12 Nodemailer Email notifications
node-cron 4.2.1 node-cron Job scheduling
Helmet 8.1.0 Helmet Security headers
Morgan 1.10.1 Morgan HTTP logging
Zod 4.3.5 Zod Schema validation
Jest Latest Jest Testing framework

Frontend Technologies

Technology Version Logo Purpose
React 19.2.0 React UI framework
TypeScript 5.9.3 TypeScript Type-safe development
Vite 7.2.4 Vite Build tool & dev server
TailwindCSS 4.1.17 TailwindCSS Utility-first CSS
Material UI 7.3.7 MUI Component library
React Router 7.13-7.14 React Router Client-side routing
React Query 5.x React Query Server state management
Vitest 4.0.13 Vitest Unit testing
React Markdown 10.1.0 React Markdown Markdown rendering
Zod 4.3.6 Zod Schema validation

Shared Technologies

  • TypeScript 5.9.3 - Strict mode enabled across all projects
  • ESLint - Code quality and consistency
  • Prettier - Automatic code formatting
  • Vite - Modern build tooling (Frontend & CMS)
  • Zod - Runtime schema validation

✨ Core Features

πŸ” Authentication & Authorization

  • JWT-based stateless authentication
  • Email verification workflow
  • Secure password hashing with bcrypt
  • Session management with PostgreSQL store
  • Role-based access control (RBAC)
  • HTTP-only cookies for enhanced security

πŸ“ Content Management

  • Rich blog post creation and editing
  • Draft and publish workflow
  • Tag-based content organization
  • Full-text search capabilities
  • Markdown support with syntax highlighting
  • Media integration with Cloudinary

πŸ’¬ Community Features

  • Nested commenting system
  • Like/unlike functionality
  • Real-time notification support
  • Subscriber management

πŸ“± User Experience

  • Responsive design for all screen sizes
  • Fast loading with optimized bundles
  • Dark mode aesthetic design
  • Accessible UI components
  • Smooth animations and transitions

πŸ”’ Security

  • CORS protection with configurable origins
  • Helmet.js for security headers
  • Input validation with Zod
  • SQL injection prevention via Prisma
  • CSRF protection via session tokens
  • Rate limiting ready architecture

πŸ“Š Administration

  • Comprehensive dashboard metrics
  • Subscriber analytics
  • Content performance tracking
  • Admin-only routes and views

πŸš€ Project Setup

Prerequisites

  • Node.js v20 or higher
  • npm or yarn package manager
  • PostgreSQL 12 or higher
  • Git for version control
  • Docker (optional, for containerization)

Quick Start

1. Clone the Repository

git clone https://github.com/iamzehan/ZincBlogs.git
cd Blog-Project

2. Backend API Setup

cd Backend/API

# Install dependencies
npm install

# Configure environment variables
cp .env.example .env.local

# Setup database
npm run prisma:generate
npm run prisma:migrate

# Start development server
npm run dev

The API will be available at http://localhost:3000

3. CMS Dashboard Setup

cd Backend/CMS

# Install dependencies
npm install

# Configure environment variables
cp .env.example .env.local

# Start development server
npm run dev

The CMS will be available at http://localhost:5174

4. Frontend Setup

cd Frontend

# Install dependencies
npm install

# Configure environment variables
cp .env.example .env.local

# Start development server
npm run dev

The Frontend will be available at http://localhost:5173

Environment Configuration

Each component requires environment variables. See individual README files for specific configurations:


πŸ“‹ Coding Standards & Best Practices

1. TypeScript Strict Mode

All projects are configured with TypeScript strict mode enabled:

{
  "compilerOptions": {
    "strict": true,
    "noImplicitAny": true,
    "strictNullChecks": true,
    "strictFunctionTypes": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "noImplicitReturns": true
  }
}

This ensures:

  • Type safety across all codebase
  • Reduced runtime errors
  • Better IDE support and autocomplete
  • Easier code refactoring

2. Code Quality & Linting

  • ESLint - Enforces consistent code style
  • Prettier - Automatic code formatting
# Lint code
npm run lint

# Format code
npm run format

3. Module System

All projects use ES Modules (ESM):

  • "type": "module" in package.json
  • Modern import/export syntax
  • Better tree-shaking and bundle optimization

4. File Naming Conventions

  • Components/Controllers: PascalCase (e.g., BlogController.ts)
  • Services/Utilities: camelCase (e.g., emailService.ts)
  • Types/Interfaces: PascalCase with .d.ts extension (e.g., blog.d.ts)
  • Constants: UPPER_SNAKE_CASE (e.g., MAX_FILE_SIZE)

5. Folder Structure Organization

Backend API Structure

Backend/API/src/
β”œβ”€β”€ config/          (Configuration files)
β”œβ”€β”€ controllers/     (Request handlers)
β”œβ”€β”€ middlewares/     (Express middlewares)
β”œβ”€β”€ routes/          (API route definitions)
β”œβ”€β”€ services/        (Business logic)
β”œβ”€β”€ types/           (TypeScript definitions)
β”œβ”€β”€ utils/           (Utility functions)
β”œβ”€β”€ mail/            (Email services)
β”œβ”€β”€ jobs/            (Background jobs)
└── prisma/          (Database schema & migrations)

Frontend/CMS Structure

src/
β”œβ”€β”€ components/      (Reusable UI components)
β”œβ”€β”€ pages/           (Page-level components)
β”œβ”€β”€ layouts/         (Layout wrappers)
β”œβ”€β”€ hooks/           (Custom React hooks)
β”œβ”€β”€ utils/           (Helper functions)
β”œβ”€β”€ types/           (TypeScript definitions)
β”œβ”€β”€ config/          (Configuration)
└── assets/          (Static assets)

6. Error Handling

  • Centralized error middleware
  • Custom error classes
  • Comprehensive error messages
  • Proper HTTP status codes
// Example: Consistent error handling
try {
  // Business logic
} catch (error) {
  next(error); // Pass to error middleware
}

7. Validation

  • Zod for schema validation
  • Input validation on all API endpoints
  • Form validation in frontend
  • Type-safe validation with TypeScript

8. Testing

  • Jest for backend unit tests
  • Vitest for frontend unit tests
  • Test files colocated with source code
  • Aim for >70% code coverage
npm run test          # Run tests
npm run test --watch  # Watch mode

9. Database Standards

  • Prisma ORM for type-safe database access
  • Migrations tracked in version control
  • Schema versioning and audit trails
  • Connection pooling for performance

10. Security Best Practices

  • Environment variables for sensitive data
  • No secrets in version control (.gitignore)
  • HTTPS in production
  • Secure cookie settings (HttpOnly, Secure, SameSite)
  • Input sanitization and validation
  • SQL injection prevention
  • XSS protection with proper escaping

πŸ’» Development Workflow

For Backend API

cd Backend/API

# Development with hot reload
npm run dev

# Build for production
npm run build

# Start production server
npm start

# Run linting
npm run lint

# Run tests
npm run test

# Database operations
npm run prisma:generate
npm run prisma:migrate
npm run prisma:studio   # Launch Prisma Studio

For CMS Dashboard

cd Backend/CMS

# Development
npm run dev

# Build for production
npm run build

# Testing
npm run test

# Linting
npm run lint

For Frontend

cd Frontend

# Development
npm run dev

# Build for production
npm run build

# Preview production build
npm run preview

# Testing
npm run test

# Linting
npm run lint

Git Workflow

# Create feature branch
git checkout -b feature/your-feature-name

# Make changes and commit
git add .
git commit -m "feat: describe your changes"

# Push to remote
git push origin feature/your-feature-name

# Create pull request and await review

πŸ“ Directory Structure

Blog-Project/
β”‚
β”œβ”€β”€ Backend/
β”‚   β”œβ”€β”€ API/
β”‚   β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”‚   β”œβ”€β”€ app.ts              (Express app setup)
β”‚   β”‚   β”‚   β”œβ”€β”€ server.ts           (Server entry point)
β”‚   β”‚   β”‚   β”œβ”€β”€ config/             (Configuration files)
β”‚   β”‚   β”‚   β”œβ”€β”€ controllers/        (Route handlers)
β”‚   β”‚   β”‚   β”œβ”€β”€ middlewares/        (Custom middlewares)
β”‚   β”‚   β”‚   β”œβ”€β”€ routes/             (API routes)
β”‚   β”‚   β”‚   β”œβ”€β”€ services/           (Business logic)
β”‚   β”‚   β”‚   β”œβ”€β”€ types/              (TypeScript types)
β”‚   β”‚   β”‚   β”œβ”€β”€ utils/              (Utilities)
β”‚   β”‚   β”‚   β”œβ”€β”€ mail/               (Email services)
β”‚   β”‚   β”‚   β”œβ”€β”€ jobs/               (Background jobs)
β”‚   β”‚   β”‚   └── prisma/             (Database schema)
β”‚   β”‚   β”œβ”€β”€ tests/                  (Unit tests)
β”‚   β”‚   β”œβ”€β”€ jest.config.ts          (Jest configuration)
β”‚   β”‚   β”œβ”€β”€ tsconfig.json           (TypeScript config)
β”‚   β”‚   β”œβ”€β”€ nodemon.json            (Nodemon config)
β”‚   β”‚   β”œβ”€β”€ package.json            (Dependencies)
β”‚   β”‚   └── README.md               (API documentation)
β”‚   β”‚
β”‚   └── CMS/
β”‚       β”œβ”€β”€ src/
β”‚       β”‚   β”œβ”€β”€ components/         (Reusable components)
β”‚       β”‚   β”œβ”€β”€ pages/              (Page components)
β”‚       β”‚   β”œβ”€β”€ layouts/            (Layout components)
β”‚       β”‚   β”œβ”€β”€ hooks/              (Custom hooks)
β”‚       β”‚   β”œβ”€β”€ utils/              (Helper utilities)
β”‚       β”‚   β”œβ”€β”€ types/              (TypeScript types)
β”‚       β”‚   β”œβ”€β”€ config/             (Configuration)
β”‚       β”‚   β”œβ”€β”€ assets/             (Static assets)
β”‚       β”‚   β”œβ”€β”€ App.tsx             (Root component)
β”‚       β”‚   └── main.tsx            (Entry point)
β”‚       β”œβ”€β”€ vite.config.ts          (Vite configuration)
β”‚       β”œβ”€β”€ tsconfig.json           (TypeScript config)
β”‚       β”œβ”€β”€ package.json            (Dependencies)
β”‚       └── README.md               (CMS documentation)
β”‚
β”œβ”€β”€ Frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/             (Reusable components)
β”‚   β”‚   β”œβ”€β”€ pages/                  (Page components)
β”‚   β”‚   β”œβ”€β”€ layouts/                (Layout components)
β”‚   β”‚   β”œβ”€β”€ hooks/                  (Custom hooks)
β”‚   β”‚   β”œβ”€β”€ utils/                  (Helper utilities)
β”‚   β”‚   β”œβ”€β”€ types/                  (TypeScript types)
β”‚   β”‚   β”œβ”€β”€ config/                 (Configuration)
β”‚   β”‚   β”œβ”€β”€ assets/                 (Static assets)
β”‚   β”‚   β”œβ”€β”€ App.tsx                 (Root component)
β”‚   β”‚   └── main.tsx                (Entry point)
β”‚   β”œβ”€β”€ public/                     (Public assets)
β”‚   β”œβ”€β”€ vite.config.ts              (Vite configuration)
β”‚   β”œβ”€β”€ tsconfig.json               (TypeScript config)
β”‚   β”œβ”€β”€ package.json                (Dependencies)
β”‚   └── README.md                   (Frontend documentation)
β”‚
β”œβ”€β”€ .git/                           (Git repository)
β”œβ”€β”€ LICENSE                         (ISC License)
└── README.md                       (This file)

πŸ“š Individual Component Documentation

For detailed information about each component, refer to their individual documentation:

Backend API

  • Full API Documentation: Backend/API/README.md
  • Includes: Quick Start, Installation, Architecture, API Endpoints, Authentication, Database Schema, Testing, Contributing

CMS Dashboard

  • Full CMS Documentation: Backend/CMS/README.md
  • Includes: Quick Start, Installation, Project Structure, Components, Pages, API Integration, State Management

Frontend Application

  • Full Frontend Documentation: Frontend/README.md
  • Includes: Quick Start, Installation, Project Structure, Pages, Components, Routes, Authentication

πŸ™ Technology Credits

This project leverages exceptional open-source technologies and their communities:

Backend

  • Express.js - Minimal and flexible Node.js web application framework
  • TypeScript - Typed superset of JavaScript
  • Prisma - Next-generation ORM for Node.js
  • PostgreSQL - Powerful, open-source relational database
  • JWT - JSON Web Tokens for secure authentication
  • Cloudinary - Cloud-based image and video management
  • Helmet.js - Security middleware for Express
  • Morgan - HTTP request logger
  • Zod - TypeScript-first schema validation
  • Jest - JavaScript testing framework

Frontend

Development Tools

  • ESLint - JavaScript linting utility
  • Prettier - Code formatter
  • Nodemon - Development file watcher
  • Rimraf - Cross-platform rm command
  • TSX - TypeScript execution runtime

🚧 Room for Improvements

Immediate Priorities

  1. API Documentation

    • Implement Swagger/OpenAPI documentation
    • Add API endpoint examples and response schemas
    • Generate auto-documentation from code
  2. Testing Coverage

    • Increase backend unit test coverage to >80%
    • Add integration tests for API endpoints
    • Implement E2E tests for critical workflows
    • Add component tests for React applications
  3. Performance Optimization

    • Implement caching strategy (Redis)
    • Add database query optimization and indexing
    • Implement pagination for large datasets
    • Lazy loading for images and components
    • Bundle size optimization
  4. Monitoring & Observability

    • Implement structured logging (Winston/Pino)
    • Add error tracking (Sentry integration)
    • Performance monitoring and metrics
    • API response time analytics

Medium-term Enhancements

  1. Search & Analytics

    • Full-text search implementation
    • Blog content search indexing (Elasticsearch)
    • User activity analytics dashboard
    • Content engagement metrics
  2. Advanced Features

    • Blog series and collections
    • Social media sharing integration
    • Reading time estimation
    • Table of contents generation
    • Author follow/notification system
    • Comment moderation tools
    • Multi-language support (i18n)
  3. Developer Experience

    • Docker & Docker Compose setup
    • Development environment automation
    • Pre-commit hooks for linting
    • API client code generation
    • Database seeding scripts
  4. Deployment & Infrastructure

    • CI/CD pipeline setup (GitHub Actions)
    • Automated testing on PR
    • Docker containerization
    • Kubernetes deployment specs
    • Environment-specific configurations
    • Database backup strategies

Long-term Vision

  1. Scalability

    • Microservices architecture consideration
    • Database sharding for large datasets
    • Event-driven architecture
    • Message queue implementation (RabbitMQ/Kafka)
  2. Mobile & Progressive Web App

    • React Native mobile app
    • PWA implementation
    • Offline-first capabilities
  3. Content Enhancement

    • Video upload and streaming
    • Audio/podcast support
    • Code snippet highlighting enhancements
    • Interactive content support
  4. Community Features

    • Collaboration between authors
    • Content versioning and history
    • Peer-review workflow
    • Badge and achievement system

🀝 Contributing

We welcome contributions from the community! Please follow these guidelines:

  1. Fork the Repository - Create your own fork
  2. Create a Feature Branch - git checkout -b feature/AmazingFeature
  3. Make Your Changes - Follow coding standards
  4. Commit with Clear Messages - git commit -m 'Add AmazingFeature'
  5. Push to Branch - git push origin feature/AmazingFeature
  6. Open a Pull Request - Describe your changes in detail

Contribution Areas

  • Bug fixes and improvements
  • Documentation enhancements
  • Feature implementations
  • Performance optimizations
  • Testing improvements

πŸ“„ License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

πŸ“ž Support & Contact

For questions, issues, or suggestions:

  • Open an issueApache 2.0 GitHub
  • Check existing documentation in component README files
  • Review the technologies' official documentation

πŸŽ‰ ZincBlogs Statistics

  • Total Components: 3 major applications (API, CMS, Frontend)
  • Technology Stack: 20+ production-grade libraries
  • Code Language: TypeScript (100% type-safe)
  • Database: PostgreSQL with Prisma ORM
  • Testing: Jest & Vitest
  • Build Tools: Vite & TypeScript Compiler
  • License: Apache 2.0 (Open Source)
  • Status: Production Ready βœ…

🌟 ZincBlogs

Enterprise-Grade Blogging Platform Built with Modern Technologies

ZincBlogs Logo

Empowering Content Creators and Readers

πŸš€ Get Started β€’ πŸ“š Documentation β€’ 🀝 Contribute β€’ GitHub Repository


Made with ❀️ by iamzehan

Copyright Β© 2026 ZincBlogs. Licensed under Apache License 2.0.

⬆ Back to Top

About

Production Grade Blog site project for a Singular Author. Readers may Subscribe, Comment, React and get notified. Server is built on Express, CMS and Client side uses ReactJS.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages