Skip to content

๐Ÿš€ Open-source directory website template built with Nuxt 4 + Sanity CMS. 3 layouts, OAuth, payments, blog & more.

License

Notifications You must be signed in to change notification settings

PBHAHAHA/Nuxt_Mkdirs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

36 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Nuxt Mkdirs

Nuxt Mkdirs

Open-source directory website template built with Nuxt 4

Nuxt Vue TailwindCSS License

English | ็ฎ€ไฝ“ไธญๆ–‡

Live Demo ยท Documentation ยท Report Bug


โœจ Features

  • ๐ŸŽจ 3 Homepage Layouts - Multiple styles, ready to use out of the box
  • ๐Ÿ“ฆ Sanity CMS - Headless CMS, no database configuration needed
  • ๐Ÿ” Multiple Auth Methods - Google / GitHub OAuth login
  • ๐Ÿ’ณ Payment Integration - Supports Stripe and Creem
  • ๐Ÿ“ง Email Service - Resend for transactional emails + Newsletter
  • ๐Ÿค– AI Auto-fill - Automatically extract website info with AI
  • ๐ŸŒ™ Dark Mode - Auto-follows system theme
  • ๐Ÿ“ฑ Responsive Design - Perfect mobile adaptation
  • โšก NuxtHub Deploy - One-click deploy to Cloudflare

๐Ÿ“ธ Screenshot

Homepage

๐Ÿ› ๏ธ Tech Stack

Category Technology
Framework Nuxt 4, Vue 3
Styling TailwindCSS 4, Radix Vue
CMS Sanity
Auth Auth.js
Payment Stripe, Creem
Email Resend
Deploy NuxtHub (Cloudflare)

๐Ÿš€ Quick Start

Prerequisites

  • Node.js 18+
  • pnpm 8+

Installation

# Clone the repository
git clone https://github.com/PBHAHAHA/Nuxt_Mkdirs.git
cd Nuxt_Mkdirs

# Install dependencies
pnpm install

# Copy environment variables
cp .env.example .env

# Start development server
pnpm dev

Visit http://localhost:3000 to see the result.

Build & Deploy

# Build for production
pnpm build

# Preview locally
pnpm preview

๐Ÿš€ Deployment

This project uses NuxtHub v0.10+ with Cloudflare Workers.

โš ๏ธ Note: NuxtHub Admin deployment will be deprecated on December 31, 2024. Please use Wrangler for deployment.

Deploy with Wrangler

  1. Copy the wrangler configuration:
cp wrangler.example.jsonc wrangler.jsonc
  1. Edit wrangler.jsonc and fill in your environment variables.

  2. Build and deploy:

pnpm build
npx wrangler deploy

Your site will be deployed to https://nuxt-mkdirs.<your-account>.workers.dev.

To use a custom domain, configure it in Cloudflare Dashboard > Workers & Pages > your project > Settings > Domains & Routes.

โš™๏ธ Configuration Guide

1. Sanity CMS Setup

Nuxt Mkdirs uses Sanity as a headless CMS to manage all content data.

  1. Create a Sanity account
  2. Create a new project and get the Project ID
  3. Create an API Token (select Editor permission)
  4. Configure CORS origins

Sanity CORS Configuration

# .env configuration
NUXT_PUBLIC_SANITY_PROJECT_ID=your_project_id
NUXT_PUBLIC_SANITY_DATASET=production
NUXT_SANITY_API_TOKEN=your_api_token
  1. Deploy Sanity Studio
pnpm dlx sanity deploy

Sanity Studio

2. Email Setup (Resend)

  1. Create a Resend account
  2. Add and verify your domain
  3. Create an API Key

Resend API Key

  1. Configure Audience ID (for Newsletter)

Resend Audience Resend Audience ID

# .env configuration
NUXT_RESEND_API_KEY=re_xxxxx
NUXT_RESEND_EMAIL_FROM=noreply@yourdomain.com
NUXT_RESEND_AUDIENCE_ID=xxxxx

3. Payment Setup

Stripe (International)

NUXT_STRIPE_SECRET_KEY=sk_xxxxx
NUXT_STRIPE_WEBHOOK_SECRET=whsec_xxxxx
NUXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_xxxxx

Creem (China-friendly)

Creem supports registration with Chinese ID, more friendly for Chinese developers.

NUXT_CREEM_API_KEY=xxxxx
NUXT_CREEM_WEBHOOK_SECRET=xxxxx
NUXT_CREEM_TEST_MODE=true
NUXT_PUBLIC_CREEM_PRO_PRODUCT_ID=xxxxx

4. OAuth Authentication Setup

Google OAuth

  1. Visit Google Cloud Console
  2. Create an OAuth Client ID

Google Credentials Google OAuth Create Google OAuth Config

# .env configuration
NUXT_AUTH_GOOGLE_CLIENT_ID=xxxxx
NUXT_AUTH_GOOGLE_CLIENT_SECRET=xxxxx

GitHub OAuth

  1. Visit GitHub Developer Settings
  2. Create an OAuth App
NUXT_AUTH_GITHUB_CLIENT_ID=xxxxx
NUXT_AUTH_GITHUB_CLIENT_SECRET=xxxxx

Auth Secret

# Generate secret
openssl rand -base64 32

# .env configuration
NUXT_AUTH_SECRET=your_generated_secret

5. AI Configuration (Optional)

Enable AI-powered auto-fill feature for website submissions.

# Choose AI provider: google, deepseek, openai
NUXT_AI_PROVIDER=google

# Google Generative AI (https://aistudio.google.com/apikey)
NUXT_GOOGLE_AI_API_KEY=xxxxx

# DeepSeek (https://platform.deepseek.com/api_keys)
NUXT_DEEPSEEK_API_KEY=xxxxx

# OpenAI (https://platform.openai.com/settings/organization/api-keys)
NUXT_OPENAI_API_KEY=xxxxx

When configured, users can click the "AI Auto-fill" button to automatically:

  • Extract website name and description
  • Generate detailed introduction
  • Download and upload logo/images
  • Suggest categories and tags

๐Ÿ“ Project Structure

nuxt-mkdirs/
โ”œโ”€โ”€ app/
โ”‚   โ”œโ”€โ”€ components/     # Vue components
โ”‚   โ”œโ”€โ”€ composables/    # Composables
โ”‚   โ”œโ”€โ”€ layouts/        # Layout components
โ”‚   โ”œโ”€โ”€ pages/          # Page routes
โ”‚   โ””โ”€โ”€ utils/          # Utility functions
โ”œโ”€โ”€ server/
โ”‚   โ”œโ”€โ”€ api/            # API routes
โ”‚   โ””โ”€โ”€ utils/          # Server utilities
โ”œโ”€โ”€ sanity/
โ”‚   โ””โ”€โ”€ schemas/        # Sanity schemas
โ””โ”€โ”€ public/             # Static assets

๐Ÿค Contributing

Contributions are welcome! Please read the Contributing Guide.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License.

๐Ÿ’– Support

If this project helps you, please consider:

  • โญ Give it a Star
  • ๐Ÿ› Submit Issues
  • ๐Ÿ“ข Share with others
  • Buy Me A Coffee

๐Ÿ“ฎ Contact


Made with โค๏ธ by PBHAHAHA

About

๐Ÿš€ Open-source directory website template built with Nuxt 4 + Sanity CMS. 3 layouts, OAuth, payments, blog & more.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published