Skip to content

Getting Started

Environment Requirements

  • Node.js 18.x or higher
  • MySQL 8.0 or higher
  • Redis 5.0 or higher
  • pnpm 8.x or higher

Installation Steps

Use Docker Compose to quickly deploy the application, including built-in Redis service, connecting to external MySQL:

bash
# 1. Clone the project
git clone https://gitee.com/shuai_dd/kevi_blog-v2.git
cd kevi_blog-v2

# 2. Prepare environment variable file
cp .env.example .env

# 3. Edit .env file to configure database connection
# Database configuration
DB_HOST=localhost
DB_PORT=3306
DB_USER=root
DB_PASSWORD=your_password
DB_NAME=nuxt_blog

# Redis configuration
REDIS_URL=redis://localhost:6379
REDIS_PASSWORD=redispassword

# JWT configuration
JWT_SECRET=your_jwt_secret_key_here
JWT_EXPIRES_IN=7d

# 4. Build and start services
docker-compose up --build -d

# 5. Access the application
# Frontend app: http://localhost:3000
# Admin panel: http://localhost:3000/admin

Method 2: Local Development Environment

1. Install Dependencies

bash
# Install using pnpm
pnpm install

2. Configure Environment Variables

Create and edit the .env file to configure database connection:

bash
# Copy environment variable template
cp .env.example .env

# Edit .env file to configure database connection

Environment variable description:

Variable NameDescriptionDefault Value
DB_HOSTDatabase host addresslocalhost
DB_PORTDatabase port3306
DB_USERDatabase usernameroot
DB_PASSWORDDatabase password-
DB_NAMEDatabase namenuxt_blog
REDIS_URLRedis connection addressredis://localhost:6379
REDIS_PASSWORDRedis password-
CACHE_STORAGECache storage method (redis or file)redis

3. Configure Database

Ensure MySQL service is running and create the database:

bash
# Initialize database and table structure
mysql -u root -p < server/database/schema.sql

Or use Node script for initialization:

bash
pnpm run db:init

4. Start Development Server

bash
# Development mode
pnpm run dev

# Build and preview
pnpm run build
pnpm run preview

5. Access Application

  • Frontend app: http://localhost:3000
  • Admin panel: http://localhost:3000/admin
  • API endpoints: http://localhost:3000/api

Default Account

After system initialization, a default administrator account is created:

FieldValue
Usernameadmin
Password123456
Emailadmin@demo.com

⚠️ Important: Change the default password immediately after deploying to production!

Verify Installation

Access the following addresses to verify successful installation:

  1. Access frontend: http://localhost:3000
  2. Access admin panel: http://localhost:3000/admin
  3. Log in to admin panel using default account
  4. Check if data statistics display normally

Common Issues

1. Database Connection Failed

Check if the database configuration in .env file is correct, ensure MySQL service is running.

2. Redis Connection Failed

Check if Redis service is running, ensure Redis address and password configuration are correct.

3. Port Already in Use

If port 3000 is occupied, you can modify the environment variable PORT or change port configuration in nuxt.config.ts.

4. Permission Issues

Ensure the application has write permission to the upload directory (when using local storage).

Next Steps