A modern, full-stack blogging platform built with Next.js, Prisma, PostgreSQL, and TypeScript. This platform allows users to create and manage multiple blogs, each with its own custom subdomain (e.g., mysite.frostcore.tech
). Perfect for developers, content creators, and businesses looking to manage multiple blogs under one roof.
- Create and manage multiple blogs under one account.
- Each blog gets a unique subdomain (e.g.,
mysite.frostcore.tech
). - Isolated content and settings for each blog.
- Secure authentication with NextAuth.js.
- Supports email/password, Google, and GitHub login.
- Role-based access control for managing blogs and posts.
- Create, edit, and publish blog posts with a rich text editor.
- Save drafts and schedule posts for later.
- Manage multiple blogs from a single dashboard.
- Built with Tailwind CSS and shadcn/ui for a sleek, responsive design.
- Dark/Light mode support.
- Customizable themes and components.
- Next.js for server-side rendering and API routes.
- Prisma for database management and migrations.
- PostgreSQL as the primary database.
- TypeScript for type-safe development.
- Turbopack for faster builds and development.
- Node.js 18+
- PostgreSQL (running locally or remotely)
- pnpm (recommended package manager)
-
Fork & Clone the repository:
git clone https://github.com/your-username/next-blog.git cd next-blog
-
Install dependencies:
pnpm install
-
Set up your environment variables: Create a
.env
file in the root directory and add the following:DATABASE_URL="postgresql://username:password@localhost:5432/your_database_name?schema=public" GOOGLE_CLIENT_ID="your_google_client_id" GOOGLE_CLIENT_SECRET="your_google_client_secret" GITHUB_CLIENT_ID="your_github_client_id" GITHUB_CLIENT_SECRET="your_github_client_secret" NEXTAUTH_URL="http://localhost:3000" or "your_domain.com" for production NEXTAUTH_SECRET="run: npx auth secret or run: openssl rand -base64 32" RESEND_API_KEY="your_resend_api_key" # EMAIL_SERVER_PASSWORD="your_resend_api_key" same as RESEND_API_KEY EMAIL_SERVER_USER=resend EMAIL_SERVER_HOST=smtp.resend.com EMAIL_SERVER_PORT=465 EMAIL_FROM=[email protected] BASE_DOMAIN="localhost:3000" # for development # BASE_DOMAIN="your_domain.com" # for production PROTOCOL="http://" # for development # PROTOCOL="https://" # for production
-
Run database migrations:
pnpm prisma migrate dev --name init
-
Seed the database (optional):
pnpm seed
-
Start the development server:
pnpm dev
-
Open your browser and navigate to
http://localhost:3000
.
pnpm dev
: Start the development server with Turbopack.pnpm build
: Generate Prisma client and build the project.pnpm start
: Start the production server.pnpm lint
: Run ESLint to check for code issues.pnpm prisma studio
: Open Prisma Studio to visualize and edit the database.pnpm prisma generate
: Generate the Prisma client.pnpm prisma db push
: Push the Prisma schema state to the database.
- Frontend: Next.js, React, Tailwind CSS, shadcn/ui
- Backend: Next.js API Routes, Server Actions
- Database & Authentication: PrismaORM, PostgreSQL, NextAuth
- Utilities: Zod (validation), UUID (unique IDs), Resend (email)
next-blog/
βββ app/ # Next.js app router
β βββ ...
βββ components/ # Reusable UI components
βββ components.json # Components configuration
βββ lib/ # Utility functions
βββ middleware.ts # Middleware configuration
βββ prisma/ # Prisma schema and migrations
βββ public/ # Static assets
βββ README.md # Project README file
βββ styles/ # Global styles
β βββ ...
βββ .env # Environment variables
βββ .env.example # Example env
βββ .gitignore # Git ignore file
βββ next.config.ts # Next.js configuration
βββ next-env.d.ts # Next.js environment types
βββ tsconfig.json # TypeScript configuration
βββ eslint.config.mjs # ESLint configuration
βββ postcss.config.mjs # PostCSS configuration
βββ package.json # Project dependencies
βββ pnpm-lock.yaml # pnpm lock file
Contributions are welcome! If you'd like to contribute, please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/your-feature
). - Commit your changes (
git commit -m 'Add some feature'
). - Push to the branch (
git push origin feature/your-feature
). - Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
Keep blogging! π