Skip to content

biezz-2/OurBlog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SaaS Blog Platform (Monorepo)

A comprehensive, production-ready SaaS platform built with Next.js 16, designed for multi-tenant blogging, newsletter management, and team collaboration. This project uses a monorepo structure powered by Turborepo.

🚀 Features

Core Content Platform

  • Multi-Tenancy: Built-in support for strict data isolation per organization.
  • Custom Domains: Map custom domains (e.g., blog.example.com) or subdomains to specific organizations.
  • Advanced Editor: Notion-style block editor powered by Tiptap, supporting local image uploads, markdown shortcuts, and rich text.

⚡️ Lightning Fast & Super Optimized

  • Blog Engine: Optimized rendering for high-performance blog posts with SEO fields (meta title, description).

Engagement & Growth

  • Comments System: Threaded comments with spam protection.
  • Newsletter: Integrated email subscription forms and management using Resend.
  • Role-Based Access Control (RBAC): Granular permissions for Owners, Admins, Editors, and Viewers.

Functionality

  • Billing & Subscriptions: Stripe integration for managing SaaS subscriptions (Free, Pro, Enterprise tiers).
  • Media Management: Centralized media handling for blog assets.
  • Monitoring: Sentry integration for error tracking and performance monitoring.

🛠 Tech Stack

  • Framework: Next.js 16 (App Router)

  • Framework: Built with Next.js 14, utilizing Server Components for optimal performance and SEO.

  • Styling: Styled with Tailwind CSS 4.0, removing unused CSS at build time for the smallest bundle size.

  • Database: Powered by Neon (Serverless Postgres), ensuring low-latency data access.

  • ORM: Managed by Prisma, providing type-safe database queries.

  • Authentication: Secured by Clerk, offering seamless user sign-ups and logins.

  • Deployment: Deployed on Vercel, leveraging its global Edge Network for speed. com/)

  • Email: Resend

  • Monorepo Tools: Turborepo

📂 Project Structure

.
├── apps
│   └── web                  # The main Next.js SaaS application
│       ├── src/app          # App Router (Routes & Layouts)
│       │   ├── (auth)       # Authentication routes
│       │   ├── dashboard    # Tenant dashboard
│       │   ├── sites        # Public-facing blog renderer (Custom Domains)
│       │   └── api          # Backend API endpoints
│       └── src/components   # App-specific components
├── packages
│   ├── db                   # Shared Database Client (Prisma)
│   ├── ui                   # Shared Design System & UI Components
│   ├── config               # Shared configurations (ESLint, Prettier)
│   └── typescript-config    # Shared TSConfig
└── turbo.json               # Turborepo pipeline configuration

🛠️ Developer Experience (DX)

🤝 Contributing

⚡ Getting Started

Prerequisites

  • Node.js 18+ (LTS recommended)
  • Docker (optional, for local DB)
  • npm or pnpm

🔧 Setup & Installation

  1. Clone the repository:
git clone https://github.com/biezz-2/blog.git
cd blog
  1. Install dependencies
npm install
  1. Environment Setup Copy the example environment file and configure your secrets.
cp .env.example .env

Update .env with your keys for Clerk, Stripe, Database, etc.

  1. Database Setup Push the schema to your database.

    # Run from root
    npm run db:push -w packages/db

    Note: Ensure your DATABASE_URL is set correctly in .env.

  2. Run Development Server Start the application in development mode.

npm run dev

The app should be running at http://localhost:3000.

📜 Scripts

Run these commands from the root directory:

  • npm run dev: Start all applications in development mode.
  • npm run build: Build all applications and packages.
  • npm run lint: Lint the codebase.
  • npm run format: Format code with Prettier.

Database Scripts (Targeting packages/db)

  • npm run db:generate -w packages/db: Generate Prisma Client.
  • npm run db:studio -w packages/db: Open Prisma Studio to view data.

🚢 Deployment

This project is optimized for deployment on Vercel.

  1. Connect your repository to Vercel.
  2. Configure the Root Directory as apps/web (or let Vercel detect the monorepo).
  3. Add your Environment Variables in the Vercel Project Settings.
  4. Deploy!

🔐 Environment Variables

Key variables required for the application to function:

| Variable | Description | |scan|scan| | DATABASE_URL | PostgreSQL Connection String | | NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY | Clerk Public Key | | CLERK_SECRET_KEY | Clerk Secret Key | | STRIPE_SECRET_KEY | Stripe Secret Key | | NEXT_PUBLIC_APP_DOMAIN | The root domain of your SaaS (e.g., saas.com) |

See .env.production.example for the full list.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors