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
Method 1: Docker One-Click Deployment (Recommended)
Use Docker Compose to quickly deploy the application, including built-in Redis service, connecting to external MySQL:
# 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/adminMethod 2: Local Development Environment
1. Install Dependencies
# Install using pnpm
pnpm install2. Configure Environment Variables
Create and edit the .env file to configure database connection:
# Copy environment variable template
cp .env.example .env
# Edit .env file to configure database connectionEnvironment variable description:
| Variable Name | Description | Default Value |
|---|---|---|
DB_HOST | Database host address | localhost |
DB_PORT | Database port | 3306 |
DB_USER | Database username | root |
DB_PASSWORD | Database password | - |
DB_NAME | Database name | nuxt_blog |
REDIS_URL | Redis connection address | redis://localhost:6379 |
REDIS_PASSWORD | Redis password | - |
CACHE_STORAGE | Cache storage method (redis or file) | redis |
3. Configure Database
Ensure MySQL service is running and create the database:
# Initialize database and table structure
mysql -u root -p < server/database/schema.sqlOr use Node script for initialization:
pnpm run db:init4. Start Development Server
# Development mode
pnpm run dev
# Build and preview
pnpm run build
pnpm run preview5. 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:
| Field | Value |
|---|---|
| Username | admin |
| Password | 123456 |
| admin@demo.com |
⚠️ Important: Change the default password immediately after deploying to production!
Verify Installation
Access the following addresses to verify successful installation:
- Access frontend:
http://localhost:3000 - Access admin panel:
http://localhost:3000/admin - Log in to admin panel using default account
- 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).