React + Vite 前端,使用 CSS modules 组织样式
CleanLandingPro-react-template — Vite 企业官网模板
作者 OluochBen
CleanLanding Pro 是一个 React + Vite 营销落地页模板,包含 hero、定价、评价、FAQ、联盟推广、指标和联系表单等区块,并可选配 Flask/PostgreSQL 后端用于收集线索。
看看你的网站会是什么样
浏览真实页面截图,比较内容排版与手机效果。点击下方缩略图切换,放大查看整页细节。
全部页面与视图 2
截图用于了解视觉与布局,交互效果请以实际项目为准。
值得关注的模板亮点
从已有项目资料中,快速了解它的特点。
包含 hero、定价、评价、FAQ、联盟推广、指标和联系等营销区块
响应式演示区可在不同设备 mock 之间切换
可选 Flask + SQLAlchemy + PostgreSQL 后端,POST /api/contact 返回 ticket ID
提供 Vitest + Testing Library 测试与 GitHub Actions CI 工作流
通过 CSS 变量、组件数组和 public/images 资源进行定制
模板详细介绍
CleanLanding Pro 是一个基于 React 与 Vite 的营销落地页启动套件,README 描述其包含 hero、演示预览、定价、用户评价、FAQ 手风琴、联盟推广亮点、性能指标和联系等区块,并提供可在不同设备 mock 之间切换的响应式演示区。前端使用 CSS modules,提供颜色 token、文案数组和资源等模块化定制入口。
模板附带一个可选的 Flask + SQLAlchemy + PostgreSQL 后端,用于接收联系表单提交并返回 ticket ID;后端提供 POST /api/contact 与 GET /api/health 两个路由,CORS 来源和数据库连接通过环境变量配置。前端通过 VITE_API_URL 指向后端地址。
项目包含 ESLint、Vitest + Testing Library 测试以及 GitHub Actions 工作流,README 说明现有测试覆盖 DemoPreview 的设备标签与主题切换,以及 ContactForm 的客户端校验与 fetch 调用。部署方面,前端构建产物可部署到 Netlify 等静态托管,后端需单独部署并配置数据库与密钥。README 未提供具体框架版本号、性能数据或生产环境验证结果。
适合你的项目吗?
适用场景
- 快速搭建产品营销落地页并替换品牌与文案
- 为落地页接入联系表单并将线索存入 PostgreSQL
- 在已有 React 项目中参考其区块结构与测试配置
- 将前端静态构建部署到 Netlify,后端单独部署到 Render 或 Railway 等平台
适合人群
- 需要 React 营销落地页起始结构的开发者
- 希望前端与可选 Flask 后端配合收集表单线索的团队
- 需要 Vitest 测试与 GitHub Actions CI 配置参考的项目
上手与定制指南
结合仓库当前版本的说明,按下面的资料检查内容、配置与运行要求。
- 1
前端:进入 frontend 目录,使用 pnpm/npm/yarn 安装依赖后运行 pnpm run dev,默认地址为 http://localhost:5173
- 2
后端(可选):进入 backend 目录,创建虚拟环境、安装 requirements.txt、复制 .env.example 为 .env 并配置 DATABASE_URL、SECRET_KEY、CORS_ORIGINS,然后运行 flask --app app run
- 3
前端需在 .env 中设置 VITE_API_URL 指向后端地址,默认示例为 http://localhost:5000
- 4
仓库自带 package-lock.json,若改用 pnpm 或 yarn,README 建议先移除现有 lockfile
- 5
前端构建使用 pnpm run build,产物位于 frontend/dist/,可部署到 Netlify 等静态托管
授权与来源资料
使用条件与限制
免费使用 · 保留许可声明本次收录的是公开仓库中采用 MIT 许可的免费版本;免费范围为该版本代码,不代表外部服务或第三方素材免费。
使用时需要遵守
- 允许免费使用、修改、商用和分发该版本代码。
- 分发代码副本或实质性部分时,保留原作者版权声明和完整 MIT 许可声明。
- 代码按现状提供;担保与责任限制以原许可证及适用法律为准。
额外费用与待核对事项
- 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
- 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
- 后端为可选组件;若需服务端持久化与联系表单提交,需额外部署 Flask/PostgreSQL 后端并配置数据库与密钥。
- 使用后端前需复制 .env.example 为 .env 并配置数据库连接与 secret key。
- 前端需将 VITE_API_URL 指向后端地址(默认 http://localhost:5000)才能连通联系 API。
- 后端部署需设置 DATABASE_URL、SECRET_KEY 等环境变量。
- 默认数据库 URL 期望本地存在 cleanlanding 数据库;部署到 Render、Railway、Fly.io 等需更新 DATABASE_URL。
- 跨域访问受 .env 中 CORS_ORIGINS 控制,需按允许的前端来源配置。
- 后端需单独部署,并将前端 VITE_API_URL 指向已部署的 API 地址。
- 需将前后端各自的 .env.example 复制为 .env,并按本地与生产环境调整取值。
- 后端托管需配置 DATABASE_URL、SECRET_KEY、CORS_ORIGINS。
- 需在前端环境中暴露 VITE_API_URL,使联系表单指向正确的 API。
查看原文依据
Permission is hereby granted, free of charge
许可证原文
**Quick start with backend (optional)**
README 原文
cp .env.example .env # configure DB + secret key
README 原文
This exposes the contact API at http://localhost:5000; ensure `frontend/.env` points `VITE_API_URL` to that address.
README 原文
cp .env.example .env # set DATABASE_URL, SECRET_KEY, etc.
README 原文
- **Database** – default URL expects `cleanlanding` database locally. Update `DATABASE_URL` for Render, Railway, Fly.io, etc.
README 原文
- **CORS** – `CORS_ORIGINS` in `.env` controls allowed frontends.
README 原文
Deploy the backend separately and set `VITE_API_URL` (frontend) to the deployed API URL.
README 原文
Backend `.env.example` includes `DATABASE_URL`, `SECRET_KEY`, `CORS_ORIGINS`, and `PORT`. Copy each `.env.example` to `.env`, then adjust values for local development and production (Netlify, Render, etc.).
README 原文
- Configure `DATABASE_URL`, `SECRET_KEY`, `CORS_ORIGINS`.
README 原文
https://github.com/OluochBen/CleanLandingPro-react-template/blob/main/LICENSEhttps://github.com/OluochBen/CleanLandingPro-react-template/blob/main/README.md- Expose `VITE_API_URL` in the frontend environment so the contact form points to the right API.
README 原文
DeepSeek 根据仓库许可证和 README 整理 ·2026-10-16。结果仅覆盖已读取资料,依赖、图片、字体及后续条款变更以各自原文为准。
项目核对记录与介绍依据
模板资料
- 来源平台
- GitHub
- 资料与维护参考分
- 资料较完整 · 85 / 100
- 技术栈
- Vite · React
- 网站类型
- 企业官网
这个分数如何计算
本站按许可资料(最高30分)、演示链接(12分)、预览图(10分)、Star数(15分)、记录的维护时间(15分)、描述完整度(8分)、功能记录(5分)和分类资料(5分)计算。它不是代码、安全或性能测试,也不是 Google 评分;有链接不代表已实测可用。
这个项目需要核对什么
- 记录的仓库更新时间
- 2025-11-28
- 截图检查日期
- 2026-10-16
已收录演示链接。请用你的内容与屏幕尺寸检查;有演示不代表表单、认证或支付已经可用。
目录记录的主要技术栈是 Vite。请通过依赖清单和锁文件核对实际版本与托管要求。这些说明基于收录资料,不代表代码审计或部署实测。
查看具体选型方法 →介绍的制作与核对状态
介绍由 AI 辅助整理目录与仓库资料。仓库作者不等于这篇介绍的审核者。
审核声明: codex-user-requested-batch-review-20261017 · 2026-10-16
查看当时使用的来源资料
SHA-256: e0c20b7462df70391ff385a4cf577a22c7b5001c6447772d8635b79ea0848b28
2026-10-16T14:37:34.929Z
来源文件 / 仓库# CleanLanding Pro
CleanLanding Pro is a React + Vite launch kit with a polished marketing site and optional Flask/PostgreSQL backend for capturing leads. It ships with production-ready sections (hero, demo preview, pricing, testimonials, FAQ, affiliate highlights, metrics, and contact) plus a responsive playground to showcase device-specific mocks.
---
## Overview
- **Responsive by default** – carefully tuned layouts for desktop, tablet, and mobile, including a hero sandbox that scales between mock devices.
- **Real-world sections** – pricing tiers, testimonials, FAQ accordions, affiliate highlights, performance metrics, and more.
- **Live contact flow** – React form posts to a Flask API (SQLAlchemy + Postgres) and returns a ticket ID for follow-up.
- **Customization-first** – color tokens, copy arrays, and assets are modular so you can swap branding in minutes.
- **Testing & CI** – Vitest + Testing Library cover key flows; GitHub Actions runs lint, tests, and build on every push.
---
## Tech Stack
| Layer | Stack |
| ---------- | ---------------------------------------------------------------------------- |
| Frontend | React 19, Vite, CSS modules |
| Backend | Flask, SQLAlchemy, PostgreSQL, python-dotenv |
| Tooling | ESLint, Vitest, React Testing Library, jsdom, GitHub Actions, Netlify-ready |
---
## Getting Started
```bash
cd frontend
# Install deps (pnpm, npm, or yarn)
pnpm install
# Launch development server
pnpm run dev
```
The app runs at http://localhost:5173. You can hot reload each React component as you customize copy or styles.
**Quick start with backend (optional)**
```bash
cd backend
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env # configure DB + secret key
flask --app app run
```
This exposes the contact API at http://localhost:5000; ensure `frontend/.env` points `VITE_API_URL` to that address.
---
## Scripts
| Command | Description |
| ---------------------- | -------------------------------------------- |
| `pnpm run dev` | Start Vite with hot module reload. |
| `pnpm run build` | Produce the optimized bundle in `dist/`. |
| `pnpm run preview` | Preview the production build locally. |
| `pnpm run lint` | ESLint (`eslint.config.js`). |
| `pnpm run test` | Vitest suite (jsdom + Testing Library). |
| `pnpm run test:watch` | Watch mode for Vitest. |
| `pnpm run test:coverage` | Generate coverage via V8. |
> The repo ships with `package-lock.json`. If you use pnpm or yarn, remove the existing lockfile before installing.
---
## Project Structure
```
CleanLandingPro/
├── backend/
│ ├── app.py
│ ├── config.py
│ ├── database.py
│ ├── models.py
│ ├── routes/
│ ├── requirements.txt
│ └── .env.example
├── frontend/
│ ├── src/
│ ├── public/
│ ├── package.json
│ ├── package-lock.json
│ ├── vite.config.js
│ ├── eslint.config.js
│ ├── .env.example
│ └── index.html
├── netlify.toml
├── README.md
├── USABILITY_TEST.md
└── LICENSE
```
---

---
## Backend API
The backend is optional but ready if you need server-side persistence.
```bash
cd backend
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
cp .env.example .env # set DATABASE_URL, SECRET_KEY, etc.
flask --app app run # http://localhost:5000
```
- **Routes**
- `POST /api/contact` – validates `{name, email, message}` (plus optional fields), stores them in Postgres, and returns `{message, ticketId}`.
- `GET /api/health` – simple heartbeat for uptime monitors.
- **Database** – default URL expects `cleanlanding` database locally. Update `DATABASE_URL` for Render, Railway, Fly.io, etc.
- **CORS** – `CORS_ORIGINS` in `.env` controls allowed frontends.
Deploy the backend separately and set `VITE_API_URL` (frontend) to the deployed API URL.
---
## Environment Variables
Front-end `.env.example` (under `frontend/`):
```
VITE_API_URL=http://localhost:5000
```
Backend `.env.example` includes `DATABASE_URL`, `SECRET_KEY`, `CORS_ORIGINS`, and `PORT`. Copy each `.env.example` to `.env`, then adjust values for local development and production (Netlify, Render, etc.).
---
## Customization Guide
| Area | How to customize |
| ------------------- | ------------------------------------------------------------------ |
| Branding / Tokens | Update CSS variables in `src/index.css`. |
| Copy / Content | Edit component arrays (e.g., testimonials, pricing) in `src/components/`. |
| Demo Preview | Adjust `devicePresets` in `src/components/DemoPreview.jsx`. |
| Affiliate Logos | Drop assets in `public/images` and update `src/components/Affiliate.jsx`. |
| Analytics | Replace `trackEvent` in `src/utils/analytics.js` with your provider. |
| Hero / imagery | Swap PNG/SVGs under `public/images` and update components. |
After tweaking copy or assets, run `pnpm run dev` to preview changes instantly.
---
## Testing
Vitest + Testing Library keep core flows verified.
```bash
pnpm run test # single run
pnpm run test:watch # watch mode
pnpm run test:coverage
```
Current suites cover:
- **DemoPreview** – ensures device tab and theme toggles update state.
- **ContactForm** – validates client-side errors clear and fetch calls fire.
Add new specs under `src/components/__tests__/` for any new section or interaction.
---
## Deployment
### Frontend
1. `cd frontend && pnpm run build`
2. Deploy `frontend/dist/` (Netlify, Vercel, S3/CloudFront, etc.).
Netlify-specific settings:
- Base directory: `frontend`
- Build command: `npm run build`
- Publish directory: `dist`
- `_redirects` already ensures SPA routing + FAQ deep links.
- `netlify.toml` locks Node 20 and adds `VITE_APP_ENV`.
### Backend
- Host Flask (Render, Railway, Fly.io, ECS, etc.).
- Configure `DATABASE_URL`, `SECRET_KEY`, `CORS_ORIGINS`.
- Expose `VITE_API_URL` in the frontend environment so the contact form points to the right API.
### CI
`.github/workflows/ci.yml` runs lint, tests, and build on pushes/PRs to `main` and `release/**`. Extend it with Lighthouse, preview deploys, or additional checks as needed.
---
## Contribution Guide
1. **Fork and branch**
```bash
git checkout -b feature/my-update
```
2. **Coding standards**
- Follow ESLint (`npm run lint`).
- Prefer functional components and hooks.
- Keep styles mobile-first.
3. **Testing**
- Update or add Vitest suites for new behavior.
- Ensure `npm run test` passes before committing.
4. **Commit style**
- Use clear, descriptive commit messages (e.g., `feat: add scroll spy to nav`).
- Avoid bundling unrelated changes.
5. **Pull requests**
- Describe the change, include screenshots or Looms for UI updates.
- Note any backend/env changes so reviewers can test properly.
6. **Code review**
- Respond promptly, rebase if requested, and keep history tidy.
Bug reports and feature requests are welcome via GitHub Issues. Please include reproduction steps or a short Loom demo when possible.
---
## License
MIT © CleanLanding Pro. Use it freely for personal or commercial projects. Attribution appreciated but not required.
看看同类模板
对比同技术栈与用途的模板,找到更适合的视觉与内容结构。

business-website-template
Modern UI/UX business website design made with React.
Vite · 企业官网

kiaalap
Free admin dashboard template focused on education, online course and school management. Build using Bootstrap…
Vite · 后台

saasboard
Free and open-source SaaS dashboard template for startups, businesses, and AI Tools. | Built with Meku, React,…
Vite · 后台

crowdup
Crowdfunding website template built using React, Vite, Mantine & Typescript.
Vite · 企业官网

vite-react-ts-shadcn-ui
Boilerplate template designed to quickly bootstrap a React.js Web App, SPA, website or landing page with React…
Vite · 企业官网

vite-vanilla-ts
Start a Vanilla TS Web App, SPA, website or landing page using TypeScript, Tailwind CSS 4, ESLint, Husky, Vite…
Vite · 企业官网
