Laravel 后端提供 RESTful API,使用 JWT 进行无状态认证
laravel-react-vite-stisla — Laravel 后台模板
作者 fhmiibrhimdev
基于 Laravel 与 React(Vite)的前后端分离后台模板,集成 Stisla 管理界面,提供 JWT 多角色认证、CRUD、搜索与分页示例。
看看你的网站会是什么样
浏览真实页面截图,比较内容排版与手机效果。点击下方缩略图切换,放大查看整页细节。
目前有 1 张原始预览,可打开完整图片查看设计细节。
截图用于了解视觉与布局,交互效果请以实际项目为准。
值得关注的模板亮点
从已有项目资料中,快速了解它的特点。
通过 Laratrust 实现基于角色的访问控制(RBAC)
前端使用 React 与 Vite,集成 Stisla 管理模板和 TailwindCSS
内置商品 CRUD 示例,包含表单校验、搜索、分页与详情展示
包含登录、注册、登出、资料更新与密码修改等认证相关页面
提供自定义 403 与 404 错误页以及图库图片管理模块
模板详细介绍
这是一个前后端分离的后台管理模板,仓库按 backend 与 frontend 两个目录组织。后端为 Laravel RESTful API,使用 JWT 进行无状态认证,并通过 Laratrust 实现基于角色的访问控制;前端为 React 配合 Vite 构建,使用 Stisla 管理模板、TailwindCSS 与 React Router 组织页面,SweetAlert2 处理交互提示。
模板内置的模块包括登录、注册、登出,用户资料更新与密码修改,商品完整 CRUD 示例(含校验),图库图片管理,以及自定义的 403 与 404 错误页。数据交互覆盖搜索、分页与详情展示。
使用前需注意:项目依赖 PHP、Composer、Node.js、NPM 以及 MySQL 或 MariaDB;后端与前端需分别启动,默认运行在 127.0.0.1:8000 与 localhost:5173。README 中给出的默认账号([email protected] / [email protected],密码均为 password)由 seeder 生成,仅用于本地演示。代码采用 MIT 许可,但演示图片、字体、图标等第三方素材需单独核对许可。
适合你的项目吗?
适用场景
- 需要 Laravel API 与 React 前端分离架构的后台项目起步
- 为管理后台搭建 JWT 多角色登录与权限控制
- 参考商品 CRUD 的搜索、分页与表单校验实现
- 在 Stisla 管理模板基础上开发数据管理界面
适合人群
- 熟悉 Laravel 与 React 的前后端开发者
- 需要后台管理模板作为项目起点的团队
- 希望参考 JWT 与 RBAC 集成方式的学习者
上手与定制指南
结合仓库当前版本的说明,按下面的资料检查内容、配置与运行要求。
- 1
环境需 PHP 8.1 及以上、Composer、Node.js 与 NPM,以及 MySQL 或 MariaDB
- 2
后端在 backend 目录执行 composer install,复制 .env.example 并配置数据库连接
- 3
依次执行 php artisan key:generate、jwt:secret、migrate:fresh --seed 与 storage:link,再运行 php artisan serve
- 4
前端在 frontend 目录执行 npm install 与 npm run dev
- 5
默认账号由 seeder 生成([email protected] 与 [email protected],密码均为 password),仅用于本地演示
授权与来源资料
使用条件与限制
免费使用 · 保留许可声明本次收录的是公开仓库中采用 MIT 许可的免费版本;免费范围为该版本代码,不代表外部服务或第三方素材免费。
使用时需要遵守
- 允许免费使用、修改、商用和分发该版本代码。
- 分发代码副本或实质性部分时,保留原作者版权声明和完整 MIT 许可声明。
- 代码按现状提供;担保与责任限制以原许可证及适用法律为准。
额外费用与待核对事项
- 使用前需在本地环境安装 PHP 8.1 及以上、Composer、Node.js 与 NPM,以及 MySQL 或 MariaDB 数据库,否则无法运行。
- 必须自行配置数据库连接信息(DB_CONNECTION、DB_HOST、DB_PORT、DB_DATABASE、DB_USERNAME、DB_PASSWORD),项目依赖外部 MySQL/MariaDB 服务。
- 需执行该命令生成 JWT 密钥,认证功能依赖此密钥,未生成则无法正常登录。
- 默认账号([email protected] 与 [email protected],密码均为 password)由 seeder 生成,仅用于本地演示,正式使用前应修改。
- 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
- 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
查看原文依据
Permission is hereby granted, free of charge
许可证原文
Ensure you have the following installed on your local machine:
README 原文
Configure your database credentials in the `.env` file:
README 原文
php artisan jwt:secret
README 原文
https://github.com/fhmiibrhimdev/laravel-react-vite-stisla/blob/main/LICENSEhttps://github.com/fhmiibrhimdev/laravel-react-vite-stisla/blob/main/README.mdAfter running the seeder (`php artisan migrate:fresh --seed`), the following default users are created:
README 原文
DeepSeek 根据仓库许可证和 README 整理 ·2026-10-02。结果仅覆盖已读取资料,依赖、图片、字体及后续条款变更以各自原文为准。
项目核对记录与介绍依据
模板资料
- 来源平台
- GitHub
- 资料与维护参考分
- 资料较完整 · 92 / 100
- 技术栈
- Laravel · Vite · React
- 网站类型
- 后台
这个分数如何计算
本站按许可资料(最高30分)、演示链接(12分)、预览图(10分)、Star数(15分)、记录的维护时间(15分)、描述完整度(8分)、功能记录(5分)和分类资料(5分)计算。它不是代码、安全或性能测试,也不是 Google 评分;有链接不代表已实测可用。
这个项目需要核对什么
- 记录的仓库更新时间
- 2026-03-02
- 截图检查日期
- 2026-10-02
已收录演示链接。请用你的内容与屏幕尺寸检查;有演示不代表表单、认证或支付已经可用。
目录记录的主要技术栈是 Laravel。请通过依赖清单和锁文件核对实际版本与托管要求。这些说明基于收录资料,不代表代码审计或部署实测。
查看具体选型方法 →介绍的制作与核对状态
介绍由 AI 辅助整理目录与仓库资料。仓库作者不等于这篇介绍的审核者。
已完成服务器许可规则与 AI 来源核对;未经过人工编辑审核。
查看当时使用的来源资料
SHA-256: 1514130b5fe57618cb2ce427375e2048e1fc3eebc0336c48fd519845d9df33fb
2026-10-02T09:58:03.224Z
来源文件 / 仓库<img width="100%" alt="LaraReact Stisla Banner" src="https://user-images.githubusercontent.com/129714988/230786429-ae7d00b6-3375-452d-bc00-adbf780ad5f5.png"> # Laravel React Vite Stisla Dashboard This project is a robust Single Page Application (SPA) starter kit that combines the power of **Laravel 10** for the backend API and **React 18 (Vite)** for a dynamic frontend. It utilizes the **Stisla Admin Template** to provide a beautiful, responsive, and user-friendly interface out of the box. Designed for developers who want a modern, fast, and scalable foundation for their web applications, featuring secure authentication, role-based access control, and CRUD scaffolding. ## 📂 Folder Structure The project is monorepo-style, separated into two distinct directories: - **`backend/`**: Laravel 10 API (Service Layer, Auth, Database). - **`frontend/`**: React + Vite + TailwindCSS (UI Layer services). ## ✨ Key Features - **Backend**: - Laravel 10 RESTful API architecture. - **JWT Authentication** (`tymon/jwt-auth`) for secure stateless communication. - **Role-Based Access Control (RBAC)** using `santigarcor/laratrust`. - Comprehensive API Resources and Controllers. - Exception handling and standardized API responses. - **Frontend**: - **React 18** powered by **Vite** for lightning-fast HMR and builds. - **Stisla Admin Template** integration (Responsive & Modern). - **TailwindCSS** for utility-first styling. - **React Router v6** for seamless client-side routing. - **SweetAlert2** for beautiful interactive alerts. - Form Handling & Validation. - Dynamic **Sidebar** & **Table** components. - **Modules Included**: - **Authentication**: Login, Register, Logout. - **User Management**: Profile update, Password change. - **Products**: Complete CRUD example with proper validation. - **Gallery**: Image management module. - **Error Pages**: Custom 403 (Forbidden) and 404 (Not Found) pages. ## 🛠 Prerequisites Ensure you have the following installed on your local machine: 1. **PHP** >= 8.1 2. **Composer** 3. **Node.js** (LTS version recommended) & **NPM** 4. **MySQL** or **MariaDB** ## 🚀 Installation Guide Follow these steps to get the project running locally. ### 1. Clone the Repository ```bash git clone https://github.com/fhmiibrhimdev/laravel-react-vite-stisla.git cd laravel-react-vite-stisla ``` ### 2. Backend Setup (Laravel) ```bash cd backend composer install cp .env.example .env ``` Configure your database credentials in the `.env` file: ```env DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=your_database_name DB_USERNAME=root DB_PASSWORD= ``` Generate keys and migrate content: ```bash php artisan key:generate php artisan jwt:secret php artisan migrate:fresh --seed php artisan storage:link php artisan serve ``` > **Note:** The backend server will run at `http://127.0.0.1:8000`. ### 3. Frontend Setup (React) Open a terminal in the `frontend` directory: ```bash cd ../frontend npm install npm run dev ``` > **Note:** The frontend application will be accessible at `http://localhost:5173`. ## 🔐 Default Credentials After running the seeder (`php artisan migrate:fresh --seed`), the following default users are created: | Role | Email | Password | |Col1|Col2|Col3| |---|---|---| | **Admin** | `[email protected]` | `password` | | **User** | `[email protected]` | `password` | ## 📄 License This project is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
看看同类模板
对比同技术栈与用途的模板,找到更适合的视觉与内容结构。

coreui-free-laravel-admin-template
CoreUI Free Laravel Bootstrap Admin Template
Laravel · 后台

sneat-bootstrap-html-laravel-admin-template-free
Most Powerful & Comprehensive Free Bootstrap 5 HTML Laravel Admin Dashboard Template built for developers!
Laravel · 后台

laqul
A complete starter kit that allows you create amazing apps that look native thanks to the Quasar Framework. Po…
Laravel · 后台

laravel9-inertiajs-reactjs-starter
This is a starter code to start the project built with Laravel 9 + InertiaJs + ReactJs, which already includes…
Laravel · 后台

TailAdmin-Laravel-Starter-Kit
TailAdmin-Laravel-Starter-Kit 开源网站模板。
Laravel · 后台

laravel-sentinel-crud-starter
This is a Starter Laravel project ,using the Sentinel Authentication ,User Role ,User Perrmisson,Role perrmiss…
Laravel · 后台
