Quick Start

Welcome to XinAdmin! This guide will walk you through the basic installation and configuration, and help you successfully deploy your first project in less than 10 minutes.

System Requirements

Before installation, please ensure your system meets the following requirements:

ItemMinimum VersionRecommended VersionRequired
PHP8.28.2+Yes
MySQL5.78.0+Yes
Redis4.06.0+Yes
Composer2.02.4+Yes
Node.js18.022.0+Yes
npm8.010.0+Yes
pnpm7.08.0+No

Project Installation

1. Clone the Project

git clone https://github.com/xin-admin/xin-admin-laravel.git

# Switch to the project directory for subsequent operations

cd xin-admin-laravel

2. Install Dependencies

Use the Composer package manager to install PHP dependencies

composer install

3. Environment File Configuration

cp .env.example .env

Then modify the .env file according to your database configuration:

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=xinadmin
DB_USERNAME=root
DB_PASSWORD=

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
Tip

In production environments, please be sure to change the database password and Redis password to ensure system security.

4. Generate APP_KEY

php artisan key:generate

5. Run Database Migrations

php artisan migrate --graceful
Info

The --graceful parameter ensures that the entire process is not interrupted when migration fails, and can safely handle existing tables.

6. Initialize Data

Run the following command to seed initial data into the database. The initial data includes root administrator information, menus, and permission information.

php artisan db:seed

7. Install Frontend Dependencies

Use npm or pnpm to install the required frontend dependencies

npm install
# or
pnpm install
Warning

If pnpm is not installed on your system, you can install it using the command npm install -g pnpm.

8. Start the Development Server

Use the composer script to run both frontend and backend services with one click. The backend API will run on http://localhost:8000, and the frontend will run on http://localhost:5173.

composer run-script dev

If the console outputs the following content, it means the server is running successfully:

[vite] 
[vite] > xin-admin-ui@0.0.0 dev
[vite] > vite
[vite] 
[vite] 
[vite]   VITE v7.3.1  ready in 1319 ms
[vite] 
[vite]   ➜  Local:   http://localhost:5173/
[vite]   ➜  Network: use --host to expose
[queue] 
[queue]    INFO  Processing jobs from the [default] queue.  
[queue] 
[server] 
[server]    INFO  Server running on [http://127.0.0.1:8000].  
[server] 
[server]   Press Ctrl+C to stop the server
[server]

At this point, you can access http://localhost:5173/ to enter the admin login page.

First Login

The program has started successfully! Now open your browser and visit:

Frontend Address: http://127.0.0.1:3000/login

Use the following credentials to log in:

Username: admin
Password: 123456

FAQ

Q: Composer Installation Failed

Normally, installation failures can be caused by the following reasons:

  1. Network issues - unstable network connection or firewall/proxy server blocking access. It is recommended to use a domestic mirror to accelerate installation.

  2. Missing PHP extensions - ensure the system trusts the SSL certificate of the repository and check if any PHP extensions required by Composer are missing.