Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Personal blog

NotificationsYou must be signed in to change notification settings

lion24/blog.nullbyte.be

Repository files navigation

A modern, full-featured blog built with Next.js, TypeScript, Prisma, PostgreSQL, and NextAuth.js for GitHub authentication.

Features

  • 📝 Write and publish blog posts with Markdown support
  • 🔐 GitHub OAuth authentication
  • 🎨 Clean, responsive design with Tailwind CSS
  • 📊 View tracking for posts
  • 🏷️ Categories and tags for organization
  • 👤 Admin dashboard for managing posts
  • 🚀 Optimized for Vercel deployment

Setup Instructions

Prerequisites

  • Node.js 18+ installed
  • PostgreSQL database (local or cloud)
  • GitHub OAuth App credentials

1. Clone and Install Dependencies

npm install

2. Set Up Environment Variables

Create a.env file with the following variables:

# DatabaseDATABASE_URL="postgresql://username:password@localhost:5432/techblog?schema=public"# NextAuthNEXTAUTH_URL="http://localhost:3000"NEXTAUTH_SECRET="your-secret-key-here"# GitHub OAuthGITHUB_CLIENT_ID="your-github-client-id"GITHUB_CLIENT_SECRET="your-github-client-secret"

3. Create GitHub OAuth App

  1. Go to GitHub Settings > Developer settings > OAuth Apps
  2. Click "New OAuth App"
  3. Fill in:
  4. Copy the Client ID and Client Secret to your.env file

4. Set Up Database

# Generate Prisma clientnpx prisma generate# Run migrationsnpx prisma migrate dev --name init# (Optional) Seed the databasenpx prisma db seed

5. Run Development Server

npm run dev

Visithttp://localhost:3000 to see your blog!

Deployment to Vercel

1. Push to GitHub

git initgit add.git commit -m"Initial commit"git remote add origin your-github-repo-urlgit push -u origin main

2. Import to Vercel

  1. Go tovercel.com
  2. Click "New Project"
  3. Import your GitHub repository
  4. Configure environment variables:
    • Add all variables from your.env file
    • UpdateNEXTAUTH_URL to your production URL

3. Set Up Production Database

You can use:

4. Deploy

Click "Deploy" and Vercel will build and deploy your blog!

Usage

Creating Posts

  1. Sign in with your GitHub account
  2. Go to/admin
  3. Click "New Post"
  4. Write your post using Markdown
  5. Add categories and tags
  6. Publish!

Post Management

  • View all posts in the admin dashboard
  • Edit existing posts
  • Toggle between draft and published states
  • Track view counts

Project Structure

tech-blog/├── src/│   ├── app/│   │   ├── api/          # API routes│   │   ├── admin/        # Admin pages│   │   ├── posts/        # Blog post pages│   │   └── layout.tsx    # Root layout│   ├── components/       # Reusable components│   ├── lib/             # Utilities│   ├── i18n/            # Internationalization│   └── types/           # TypeScript types├── messages/            # Translation files (i18n)├── prisma/│   └── schema.prisma    # Database schema├── docs/                # Project documentation└── public/              # Static assets

Documentation

For detailed documentation, see thedocs/ directory:

Contributing

Feel free to open issues or submit pull requests! See ourcontributing guidelines for more details.

License

MIT

Releases

No releases published

Packages

No packages published

Contributors2

  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp