Next.jsReact后台

Contact-Hub — Next.js 后台模板

作者 Oluwaseg

Contact Hub 是一个自托管的联系表单后端服务,多个项目通过 API 将消息发送到同一处,由仪表盘统一管理,并可通过邮件、Discord 或 Telegram 发送通知。

看看你的网站会是什么样

浏览真实页面截图,比较内容排版与手机效果。点击下方缩略图切换,放大查看整页细节。

2 个预览视图
桌面端首页1 / 2
桌面端截图首屏预览

由服务器浏览器实际访问页面后截取。

全部页面与视图 2

截图用于了解视觉与布局,交互效果请以实际项目为准。

采集于 2026-10-15查看来源

值得关注的模板亮点

从已有项目资料中,快速了解它的特点。

01

多个项目通过 per-project API key 向同一服务发送联系消息,消息按项目标记

02

管理员仪表盘支持登录、收件箱、搜索、标签、归档和批量操作

03

新消息可触发邮件、Discord webhook 或 Telegram bot 通知,未配置的提供方会被跳过

04

邮件通知使用 @unlayer/react-elements 模板,同一模板可渲染邮件 HTML 和网页预览

05

提供项目管理和 API key 轮换界面

06

README 中列出的速率限制、分析、附件支持和 reCAPTCHA 等属于计划功能,尚未说明已实现

模板详细介绍

Contact Hub 用于解决多个项目各自重复搭建联系表单后端的问题。每个项目将联系消息发送到 Contact Hub,消息按项目标记后集中存储,管理员可以在仪表盘中查看、搜索和筛选。收到新消息时,可以通过邮件、Discord webhook 或 Telegram bot 发送通知,其中邮件通知使用 @unlayer/react-elements 模板渲染,同一份 JSX 内容可分别输出邮件 HTML 和响应式网页预览。README 说明公开落地页无需配置即可运行,但仪表盘和通知功能需要自行配置 .env,包括数据库、管理员密码和至少一个通知提供方。项目基于 Next.js App Router 全栈开发,使用 PostgreSQL(Neon)、Prisma ORM、Zod 校验和 Nodemailer(Gmail)发送邮件,部署在 Vercel。README 的路线图列出了已完成和计划中的功能,计划项包括速率限制、分析、AI 垃圾邮件分类、附件支持、reCAPTCHA 和团队账户,这些尚未在 README 中说明为已实现。

Next.js后台

适合你的项目吗?

适用场景

  • 为个人作品集、副业项目或 SaaS 产品统一接收联系表单消息
  • 在仪表盘中按项目筛选、搜索和归档联系消息
  • 通过邮件、Discord 或 Telegram 即时获知新的联系请求
  • 在仪表盘中预览通知邮件的邮件端和网页端渲染效果

适合人群

  • 拥有多个项目、希望集中管理联系消息的独立开发者
  • 希望自行托管联系表单后端并掌控数据的团队或个人
  • 使用 Next.js、PostgreSQL 和 Prisma 技术栈的开发者

上手与定制指南

结合仓库当前版本的说明,按下面的资料检查内容、配置与运行要求。

  1. 1

    克隆仓库后运行 pnpm install,复制 .env.example 为 .env 并填写数据库、管理员密码和至少一个通知提供方

  2. 2

    执行 pnpm prisma migrate dev 初始化数据库,然后运行 pnpm dev

  3. 3

    访问 http://localhost:3000,在 /login 登录,并通过联系 API 提交测试消息

  4. 4

    公开落地页无需配置即可运行,仪表盘和通知功能需要完成 .env 配置

  5. 5

    完整环境变量和设置步骤参见仓库中的 SETUP.md

查看仓库使用说明

授权与来源资料

使用条件与限制

免费使用 · 保留许可声明

本次收录的是公开仓库中采用 MIT 许可的免费版本;免费范围为该版本代码,不代表外部服务或第三方素材免费。

使用时需要遵守

  • 允许免费使用、修改、商用和分发该版本代码。
  • 分发代码副本或实质性部分时,保留原作者版权声明和完整 MIT 许可声明。
  • 代码按现状提供;担保与责任限制以原许可证及适用法律为准。

额外费用与待核对事项

  • README 提及 Formspree 表单服务;真实提交需配置服务端点,其使用额度与费用需单独核对。
  • 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
  • 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
  • 公开落地页无需配置即可运行,但仪表盘和通知功能需要自行配置 .env,包括数据库、管理员密码和至少一个通知提供方。
  • 需要在 .env 中配置一个或多个通知提供方;未配置的提供方会被跳过。
  • 邮件通知通过 Gmail 和 Nodemailer 发送,需要相应的邮箱凭据配置。
  • Discord 通知依赖 webhook,需要自行创建并配置 webhook。
  • Telegram 通知依赖 bot,需要自行创建并配置 bot。
  • 使用 PostgreSQL 数据库,README 提到通过 Neon 提供,需要相应的数据库服务。
  • README 将 Vercel 列为托管平台,部署时可能需要 Vercel 账户。
查看原文依据

Permission is hereby granted, free of charge

许可证原文

> The public landing page works out of the box. The dashboard and notifications require your own `.env` (database, admin password, and at least one notification provider).

README 原文

Configure one or more providers in `.env`. The app skips any provider that isn't set up.

README 原文

- **Email** (Gmail via Nodemailer), rendered with the Elements template

README 原文

- **Discord** (webhook)

README 原文

- **Telegram** (bot)

README 原文

- **PostgreSQL** via **Neon**

README 原文

- **Vercel** for hosting

README 原文
https://github.com/Oluwaseg/Contact-Hub/blob/main/LICENSEhttps://github.com/Oluwaseg/Contact-Hub/blob/main/README.md

DeepSeek 根据仓库许可证和 README 整理 ·2026-10-15。结果仅覆盖已读取资料,依赖、图片、字体及后续条款变更以各自原文为准。

项目核对记录与介绍依据

模板资料

来源平台
GitHub
资料与维护参考分
资料较完整 · 80 / 100
技术栈
Next.js · React
网站类型
后台
这个分数如何计算

本站按许可资料(最高30分)、演示链接(12分)、预览图(10分)、Star数(15分)、记录的维护时间(15分)、描述完整度(8分)、功能记录(5分)和分类资料(5分)计算。它不是代码、安全或性能测试,也不是 Google 评分;有链接不代表已实测可用。

这个项目需要核对什么

记录的仓库更新时间
2026-07-22
截图检查日期
2026-10-15

已收录演示链接。请用你的内容与屏幕尺寸检查;有演示不代表表单、认证或支付已经可用。

目录记录的主要技术栈是 Next.js。请通过依赖清单和锁文件核对实际版本与托管要求。这些说明基于收录资料,不代表代码审计或部署实测。

查看具体选型方法 →

介绍的制作与核对状态

介绍由 AI 辅助整理目录与仓库资料。仓库作者不等于这篇介绍的审核者。

审核声明: codex-user-requested-batch-review-20261017 · 2026-10-16

查看当时使用的来源资料

SHA-256: 09c9f752842291f50ae1698b062a6f275cdccb881c2596afda2509b9e973bc43

2026-10-15T11:08:28.751Z

来源文件 / 仓库
# Contact Hub

**Stop rebuilding contact form backends for every side project.**

[![Built with Elements](https://img.shields.io/badge/Built%20with-Elements-0D9488?style=flat-square)](https://github.com/unlayer/elements)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue?style=flat-square)](LICENSE)

**Repo:** https://github.com/Oluwaseg/Contact-Hub

---

## The Problem

If you build a few different apps or sites (a portfolio, a SaaS product, a side project), each one usually ends up with its own scattered way of handling "someone wants to reach me."

Maybe it's a mailto link. Maybe it's a form that quietly emails a Gmail you forget to check. Maybe you find out three weeks later that someone tried to contact you about one of your apps, but the message went to the wrong inbox and got buried.

Multiply that across every project you build, and you get a mess: no single place to see who's reached out, when, or about what.

## The Idea

Contact Hub is a small, single service that every one of your projects talks to.

Instead of each app building (and re-building) its own contact form backend, they all send their messages to one place. Contact Hub stores them, can notify you through configurable providers such as Discord, Telegram, or email, and gives you one dashboard to see everything at a glance, filterable by project.

Think of it as your own private, self-hosted, open-source version of Formspree. Built once, owned entirely by you, and reusable forever.

**Example use case** (the project names below are just some of my own apps that talk to Contact Hub):

One side project gets a feature request. Another gets a partnership inquiry. Your portfolio gets a freelance lead. Instead of checking three different inboxes, every message lands in Contact Hub, tagged by project, in one place.

## How It Fits Together

```
Portfolio         ──┐
DeadLink Watchdog ──┼──►  Contact Hub  ──►  Email notification (Elements template)
WalletWise        ──┘           │
(next project...)               ▼
                          Admin dashboard
                          (message + email/web preview)
```

Every project sends its messages to Contact Hub. Contact Hub keeps a record of everything, notifies you the moment a message arrives, and shows it all in one admin dashboard (sorted, searchable, and filterable by project).

---

## Built with Unlayer Elements

Elements is a core part of this project, not a side experiment.

Contact Hub was already a real app with a real use case: I kept rebuilding contact-form backends for every project. The challenge gave me a reason to replace hand-written notification HTML with a proper, reusable template system powered by [@unlayer/react-elements](https://github.com/unlayer/elements).

### What the template does

When someone submits a contact form, Contact Hub sends a "New Contact Message Received" notification. That email is built entirely with Elements:

| Piece | Location |
|-------|----------|
| Template component | [`src/templates/ContactMessageNotification.tsx`](src/templates/ContactMessageNotification.tsx) |
| Render helpers | [`src/lib/renderContactMessageNotification.tsx`](src/lib/renderContactMessageNotification.tsx) |
| Live email sending | [`src/lib/mailer.ts`](src/lib/mailer.ts) |
| Dashboard email preview | `/dashboard/messages/[id]/email` |
| Dashboard web preview | `/dashboard/messages/[id]/web` |

### Write once, render everywhere

The same JSX content is wrapped in two Elements root components:

- `<Email>` produces table-based HTML for Gmail, Outlook, Apple Mail (used when Nodemailer sends notifications)
- `<Page>` produces responsive web HTML (shown in the dashboard's web preview)

One template. Two outputs. No duplicated markup.

```tsx
// Shared content, two render modes
<Email>...</Email>   // notification in your inbox
<Page>...</Page>     // responsive web preview in the dashboard
```

---

## Demo

[Watch the demo video](docs/videos/demo.mp4)

## Screenshots

### Message details

![Message details view](docs/screenshots/message-preview.png)

### Email preview (Elements `<Email>` mode)

![Email preview](docs/screenshots/email-preview.png)

### Web preview (Elements `<Page>` mode)

![Web preview](docs/screenshots/web-preview.png)

---

## Quick start

Full setup guide: **[SETUP.md](SETUP.md)**

```bash
git clone https://github.com/Oluwaseg/Contact-Hub.git
cd Contact-Hub
pnpm install
cp .env.example .env   # then fill in your values
pnpm prisma migrate dev
pnpm dev
```

Open `http://localhost:3000`, sign in at `/login`, and submit a test message via the contact API (see [SETUP.md](SETUP.md) for environment variables).

> The public landing page works out of the box. The dashboard and notifications require your own `.env` (database, admin password, and at least one notification provider).

---

## Notifications

Every incoming message can trigger instant notifications through configurable providers:

- **Email** (Gmail via Nodemailer), rendered with the Elements template
- **Discord** (webhook)
- **Telegram** (bot)

Configure one or more providers in `.env`. The app skips any provider that isn't set up.

## What It Solves

- **No more guessing which inbox a message landed in.** Every message is tagged with the project it came from.
- **No more rebuilding the same contact form logic for every new project.** Build it once here, reuse it everywhere.
- **One place to check.** Instead of five different "contact" systems across five different projects, there's one.
- **A record you actually keep.** Emails get lost or archived. A proper dashboard doesn't.
- **Instant alerts.** Notifications mean you find out the moment someone reaches out.

## Why it's free

Contact Hub was built to solve a problem I kept running into across my own projects. Rather than turning it into a paid SaaS, I decided to keep it open source so anyone can self-host, contribute, or adapt it.

If it saves you time or helps your projects, consider:

- Starring the repo on GitHub
- Sharing feedback or opening issues
- [Supporting development with a donation](https://selar.com/showlove/oluwaseg) (optional, never required)

I don't intend to monetize Contact Hub. It's infrastructure I wanted for myself, and I'd rather share it than gate it.

## Why build this instead of a third-party tool?

Tools like Formspree or Getform are fine, but they come with limits on free tiers, monthly costs as you scale, and no real ownership of your data. Since the goal is to reuse this across every project for years, it made more sense to own the whole thing. No usage caps, no per-project pricing, and full control over how messages are stored and displayed.

## Roadmap

```
Done:
  Core API
  Project authentication (per-project API keys)
  Email notifications (Unlayer Elements template)
  Email + web template previews in dashboard
  Basic spam protection
  Admin dashboard (login, inbox, filters)
  Project management UI (add/remove projects, rotate keys)
  Search
  Labels / tags
  Archive & bulk actions
  Webhooks (Discord / Telegram notifications)

Planned:
  Rate limiting
  Analytics (messages per project, over time)
  AI spam / auto-categorization
  Attachments support
  reCAPTCHA verification
  Team accounts (future)
```

## Tech stack

- **Next.js** (App Router, fullstack)
- **[@unlayer/react-elements](https://github.com/unlayer/elements)** for notification email + web template rendering
- **PostgreSQL** via **Neon**
- **Prisma** ORM
- **Zod** for validation
- **Nodemailer** (Gmail) for email delivery
- **Vercel** for hosting

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md) if you want to report a bug, improve the docs, or send a pull request.

## License

MIT. See [LICENSE](LICENSE).

---

_Built by [Samuel Oluwasegun](https://github.com/Oluwaseg) as shared infrastructure for personal and portfolio projects._
反馈内容错误

看看同类模板

对比同技术栈与用途的模板,找到更适合的视觉与内容结构。